newdevice: added more support for dasan-nos (#5298)

This commit is contained in:
Neil Lathwood 2017-01-06 04:12:58 +00:00 committed by Tony Murray
parent 81024f0d4e
commit 1b7d3e0ab8
8 changed files with 130 additions and 3 deletions

View File

@ -6,6 +6,8 @@ mib_dir:
- dasan
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.6296.1.2.5

View File

@ -0,0 +1,35 @@
<?php
/**
* dasan-nos.inc.php
*
* LibreNMS mempool discovery module for Dasan NOS
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
if ($device['os'] === 'dasan-nos') {
echo 'Dasan NOS: ';
$total = snmp_get($device, 'dsTotalMem.0', '-OvQU', 'DASAN-SWITCH-MIB', 'dasan');
$used = snmp_get($device, 'dsUsedMem.0', '-OvQU', 'DASAN-SWITCH-MIB', 'dasan');
$free = snmp_get($device, 'dsFreeMem.0', '-OvQU', 'DASAN-SWITCH-MIB', 'dasan');
if (is_numeric($total) && is_numeric($used) && is_numeric($free)) {
discover_mempool($valid_mempool, $device, 0, 'dasan-nos', 'Memory Utilization', '1', null, null);
}
}

View File

@ -0,0 +1,33 @@
<?php
/**
* dasan-nos.inc.php
*
* LibreNMS processor discovery module for Dasan NOS
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
if ($device['os'] === 'dasan-nos') {
echo 'Dasan NOS : ';
$descr = 'Processor';
$usage = snmp_get($device, 'dsCpuLoad5s.0', '-Ovq', 'DASAN-SWITCH-MIB', 'dasan');
if (is_numeric($usage)) {
discover_processor($valid['processor'], $device, 'dsCpuLoad5s.0', '0', 'dasan-nos', $descr, '1', $usage);
}
}

View File

@ -0,0 +1,28 @@
<?php
/**
* dasan-nos.inc.php
*
* LibreNMS mempool poller module for Dasan NOS
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
$mempool['total'] = snmp_get($device, 'dsTotalMem.0', '-OvQU', 'DASAN-SWITCH-MIB');
$mempool['used'] = snmp_get($device, 'dsUsedMem.0', '-OvQU', 'DASAN-SWITCH-MIB');
$mempool['free'] = snmp_get($device, 'dsFreeMem.0', '-OvQU', 'DASAN-SWITCH-MIB');

View File

@ -25,4 +25,7 @@
list($hardware, $version) = explode(' ', $poll_device['sysDescr'], 2);
$version = preg_replace('/\/(.*)/', '', $version);
$tmp = snmp_get_multi_oid($device, 'dsSerialNumber.0 dsFirmwareVersion', '-OQUs', 'DASAN-SWITCH-MIB:DASAN-PRODUCTS-MIB');
$serial = $tmp['dsSerialNumber.0'];
$version = $tmp['dsFirmwareVersion.0'];

View File

@ -0,0 +1,26 @@
<?php
/**
* dasan-nos.inc.php
*
* LibreNMS processor poller module for Dasan NOS
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <neil@lathwood.co.uk>
*/
$proc = snmp_get($device, 'dsCpuLoad5s.0', '-Ovq', 'DASAN-SWITCH-MIB');

View File

@ -485,7 +485,7 @@ v5924MD OBJECT IDENTIFIER ::= { v5900 23 }
v5924P OBJECT IDENTIFIER ::= { v5900 24 }
v5908P OBJECT IDENTIFIER ::= { v5900 25 }
v5924C-R OBJECT IDENTIFIER ::= { v5900 26 }
smc7824M_VSW OBJECT IDENTIFIER ::= { v5900 27 }
smc7824MVSW OBJECT IDENTIFIER ::= { v5900 27 }
v5924O OBJECT IDENTIFIER ::= { v5900 28 }
v5908O OBJECT IDENTIFIER ::= { v5900 29 }
v5904 OBJECT IDENTIFIER ::= { v5900 30 }

View File

@ -3266,7 +3266,7 @@
v30a(15),
v12a997(16),
v12b997(17),
v17a_8k(18)
v17a8k(18)
}
MAX-ACCESS read-write
STATUS current