mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
Added support for os SNR (#10704)
* Support new os SNR mib file * snr logo * snr includes_definitions * includes_definitions_discovery * snr includes_discovery_mempools * includes_polling_mempools * includes_polling_os * update snr.yaml * snr.snmprec * Create snr.json * Update snr.snmprec * Update snr.json * Update snr.yaml
This commit is contained in:
parent
a4c3062aad
commit
cde3e1d8a0
BIN
html/images/os/snr.png
Normal file
BIN
html/images/os/snr.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
32
includes/definitions/discovery/snr.yaml
Normal file
32
includes/definitions/discovery/snr.yaml
Normal file
@ -0,0 +1,32 @@
|
||||
mib: NAG-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: sysCpuUsage
|
||||
num_oid: '.1.3.6.1.4.1.40418.7.100.1.8.1.11.{{ $index }}'
|
||||
sensors:
|
||||
temperature:
|
||||
data:
|
||||
-
|
||||
oid: sysTemperature
|
||||
num_oid: '.1.3.6.1.4.1.40418.7.100.1.8.1.10.{{ $index }}'
|
||||
descr: 'Temperature {{ $index }}'
|
||||
state:
|
||||
data:
|
||||
-
|
||||
oid: sysFanStatus
|
||||
num_oid: '.1.3.6.1.4.1.40418.7.100.1.12.1.1.3.{{ $index }}'
|
||||
descr: 'Fan {{ $index }} status'
|
||||
states:
|
||||
- { descr: Normal, graph: 0, value: 0, generic: 0 }
|
||||
- { descr: Abnormal, graph: 0, value: 1, generic: 2 }
|
||||
-
|
||||
oid: showSwitchStartUpStatus
|
||||
num_oid: '.1.3.6.1.4.1.40418.7.100.1.16.{{ $index }}'
|
||||
descr: 'Switch {{ $index }} Startup status'
|
||||
states:
|
||||
- { descr: idle, graph: 0, value: 1, generic: 3 }
|
||||
- { descr: success, graph: 0, value: 2, generic: 0 }
|
||||
- { descr: fail, graph: 0, value: 3, generic: 2 }
|
||||
- { descr: inProgress, graph: 0, value: 4, generic: 3 }
|
14
includes/definitions/snr.yaml
Normal file
14
includes/definitions/snr.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
os: snr
|
||||
text: 'snr'
|
||||
type: network
|
||||
icon: snr
|
||||
group: snr
|
||||
mib_dir:
|
||||
- snr
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
discovery:
|
||||
- sysObjectID:
|
||||
- .1.3.6.1.4.1.40418.7
|
18
includes/discovery/mempools/snr.inc.php
Normal file
18
includes/discovery/mempools/snr.inc.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2019 hartred <tumanov@asarta.ru>
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'snr') {
|
||||
$usage = snmp_get($device, 'sysMemoryUsage.1', '-OvQ', 'NAG-MIB');
|
||||
if (is_numeric($usage)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'snr', 'Memory Usage', '1', null, null);
|
||||
}
|
||||
}
|
17
includes/polling/mempools/snr.inc.php
Normal file
17
includes/polling/mempools/snr.inc.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2019 hartred <tumanov@asarta.ru>
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$temp_data = snmp_get_multi_oid($device, ['sysMemorySize.1', 'sysMemoryBusy.1'], '-OUQs', 'NAG-MIB');
|
||||
$mempool['total'] = $temp_data['sysMemorySize.1'];
|
||||
$mempool['used'] = $temp_data['sysMemoryBusy.1'];
|
||||
$mempool['free'] = $mempool['total'] - $mempool['used'];
|
||||
unset($temp_data);
|
21
includes/polling/os/snr.inc.php
Normal file
21
includes/polling/os/snr.inc.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2019 hartred <tumanov@asarta.ru>
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$hardware = trim(snmp_get($device, '.1.3.6.1.4.1.40418.7.100.1.2.0', '-OQv'), '"');
|
||||
$version = trim(snmp_get($device, '.1.3.6.1.4.1.40418.7.100.1.3.0', '-OQv'), '"');
|
||||
|
||||
if (empty($hardware) && empty($version)) {
|
||||
$temp_data = snmp_get_multi_oid($device, ['sysHardwareVersion.1', 'sysSoftwareVersion.1'], '-OUQs', 'NAG-MIB');
|
||||
$hardware = $temp_data['sysHardwareVersion.1'];
|
||||
$version = $temp_data['sysSoftwareVersion.1'];
|
||||
unset($temp_data);
|
||||
}
|
24850
mibs/snr/NAG-MIB
Normal file
24850
mibs/snr/NAG-MIB
Normal file
File diff suppressed because it is too large
Load Diff
10947
tests/data/snr.json
Normal file
10947
tests/data/snr.json
Normal file
File diff suppressed because it is too large
Load Diff
1255
tests/snmpsim/snr.snmprec
Normal file
1255
tests/snmpsim/snr.snmprec
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user