Netonix switch update

New mib
Added total power consumption and dc power input (for dc switches)
Small cleanups
This commit is contained in:
Tony Murray
2016-09-26 10:34:49 -05:00
parent 8b68429a06
commit 1b4d44b2f8
12 changed files with 333 additions and 97 deletions

View File

@@ -1,22 +1,34 @@
<?php <?php
/* /**
* LibreNMS module for Netonix * netonix.inc.php
* *
* Copyright (c) 2016 Tony Murray <murraytony@gmail.com> * LibreNMS mempools module for Netonix
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify
* under the terms of the GNU General Public License as published by the * it under the terms of the GNU General Public License as published by
* Free Software Foundation, either version 3 of the License, or (at your * the Free Software Foundation, either version 3 of the License, or
* option) any later version. Please see LICENSE.txt at the top level of * (at your option) any later version.
* the source code distribution for details. *
*/ * 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'netonix') { if ($device['os'] == 'netonix') {
echo 'NETONIX : '; echo 'NETONIX : ';
$free = str_replace('"', "", snmp_get($device, 'UCD-SNMP-MIB::memTotalFree.0', '-OvQU')); $free = snmp_get($device, 'UCD-SNMP-MIB::memTotalFree.0', '-OvQU');
if (is_numeric($free)) { if (is_numeric($free)) {
discover_mempool($valid_mempool, $device, 0, 'netonix', 'Memory', '1024'); discover_mempool($valid_mempool, $device, 0, 'netonix', 'Memory', 1024);
} }
} }

View File

@@ -1,15 +1,27 @@
<?php <?php
/* /**
* LibreNMS module for Netonix * netonix.inc.php
* *
* Copyright (c) 2016 Tony Murray <murraytony@gmail.com> * LibreNMS os discovery module for Netonix
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify
* under the terms of the GNU General Public License as published by the * it under the terms of the GNU General Public License as published by
* Free Software Foundation, either version 3 of the License, or (at your * the Free Software Foundation, either version 3 of the License, or
* option) any later version. Please see LICENSE.txt at the top level of * (at your option) any later version.
* the source code distribution for details. *
*/ * 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if (starts_with($sysObjectId, '.1.3.6.1.4.1.46242')) { if (starts_with($sysObjectId, '.1.3.6.1.4.1.46242')) {
$os = 'netonix'; $os = 'netonix';

View File

@@ -1,10 +1,32 @@
<?php <?php
/**
* netonix.inc.php
*
* LibreNMS processors module for Netonix
*
* 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'netonix') { if ($device['os'] == 'netonix') {
echo 'NETONIX : '; echo 'NETONIX : ';
// $system = snmp_get($device, 'ssCpuSystem.0', '-OvQ', 'UCD-SNMP-MIB'); $idle = snmp_get($device, 'UCD-SNMP-MIB::ssCpuIdle.0', '-OvQ');
// $user = snmp_get($device, 'ssCpuUser.0', '-OvQ', 'UCD-SNMP-MIB');
$idle = snmp_get($device, 'ssCpuIdle.0', '-OvQ', 'UCD-SNMP-MIB');
if (is_numeric($idle)) { if (is_numeric($idle)) {
discover_processor($valid['processor'], $device, 0, 0, 'ucd-old', 'CPU', '1', (100 - $idle)); discover_processor($valid['processor'], $device, 0, 0, 'ucd-old', 'CPU', '1', (100 - $idle));

View File

@@ -0,0 +1,38 @@
<?php
/**
* netonix.inc.php
*
* LibreNMS current module for Netonix
*
* 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'netonix') {
echo 'Netonix: ';
$dcinput_oid = '.1.3.6.1.4.1.46242.7.0'; // NETONIX-SWITCH-MIB::dcdcInputCurrent.0
$dcinput_value = snmp_get($device, $dcinput_oid, '-Oqv');
$descr = 'DC Power Input';
$divisor = 10;
if (is_numeric($dcinput_value) && $dcinput_value > 0) {
discover_sensor($valid['sensor'], 'current', $device, $dcinput_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $dcinput_value / $divisor);
}
}

View File

@@ -1,19 +1,32 @@
<?php <?php
/* /**
* LibreNMS module for Netonix * netonix.inc.php
* *
* Copyright (c) 2016 Tony Murray <murraytony@gmail.com> * LibreNMS fanspeeds module for Netonix
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify
* under the terms of the GNU General Public License as published by the * it under the terms of the GNU General Public License as published by
* Free Software Foundation, either version 3 of the License, or (at your * the Free Software Foundation, either version 3 of the License, or
* option) any later version. Please see LICENSE.txt at the top level of * (at your option) any later version.
* the source code distribution for details. *
*/ * 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
// Netonix Fan Speeds // Netonix Fan Speeds
if ($device['os'] == 'netonix') { if ($device['os'] == 'netonix') {
echo 'Netonix: '; echo 'Netonix: ';
// NETONIX-SWITCH-MIB::fanTable .1.3.6.1.4.1.46242.2
$oids = snmpwalk_cache_multi_oid($device, 'fanTable', array(), 'NETONIX-SWITCH-MIB', '+'.$config['mibdir'].'/netonix'); $oids = snmpwalk_cache_multi_oid($device, 'fanTable', array(), 'NETONIX-SWITCH-MIB', '+'.$config['mibdir'].'/netonix');
if (is_array($oids)) { if (is_array($oids)) {
foreach ($oids as $index => $entry) { foreach ($oids as $index => $entry) {

View File

@@ -0,0 +1,38 @@
<?php
/**
* netonix.inc.php
*
* LibreNMS power module for Netonix
*
* 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'netonix') {
echo 'Netonix: ';
$power_oid = '.1.3.6.1.4.1.46242.6.0'; // NETONIX-SWITCH-MIB::totalPowerConsumption
$power_value = snmp_get($device, $power_oid, '-Oqv');
$descr = 'Total Consumption';
$divisor = 10;
if (is_numeric($power_value) && $power_value > 0) {
discover_sensor($valid['sensor'], 'power', $device, $power_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $power_value / $divisor);
}
}

View File

@@ -1,16 +1,30 @@
<?php <?php
/* /**
* LibreNMS * netonix.inc.php
* *
* Copyright (c) 2016 Tony Murray <murrayton@gmail.com> * LibreNMS states module for Netonix
* 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 * This program is free software: you can redistribute it and/or modify
* Free Software Foundation, either version 3 of the License, or (at your * it under the terms of the GNU General Public License as published by
* option) any later version. Please see LICENSE.txt at the top level of * the Free Software Foundation, either version 3 of the License, or
* the source code distribution for details. * (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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/ */
if ($device['os'] == 'netonix') { if ($device['os'] == 'netonix') {
// NETONIX-SWITCH-MIB::poeStatus
$temp = snmpwalk_cache_multi_oid($device, '.1.3.6.1.4.1.46242.5.1.2', array()); $temp = snmpwalk_cache_multi_oid($device, '.1.3.6.1.4.1.46242.5.1.2', array());
$cur_oid = '.1.3.6.1.4.1.'; $cur_oid = '.1.3.6.1.4.1.';

View File

@@ -1,19 +1,32 @@
<?php <?php
/* /**
* LibreNMS module for Netonix * netonix.inc.php
* *
* Copyright (c) 2016 Tony Murray <murraytony@gmail.com> * LibreNMS temperatures module for Netonix
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify
* under the terms of the GNU General Public License as published by the * it under the terms of the GNU General Public License as published by
* Free Software Foundation, either version 3 of the License, or (at your * the Free Software Foundation, either version 3 of the License, or
* option) any later version. Please see LICENSE.txt at the top level of * (at your option) any later version.
* the source code distribution for details. *
*/ * 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
// Netonix Temperatures // Netonix Temperatures
if ($device['os'] == 'netonix') { if ($device['os'] == 'netonix') {
echo 'Netonix: '; echo 'Netonix: ';
// NETONIX-SWITCH-MIB::tempTable .1.3.6.1.4.1.46242.3
$oids = snmpwalk_cache_multi_oid($device, 'tempTable', array(), 'NETONIX-SWITCH-MIB', '+'.$config['mibdir'].'/netonix'); $oids = snmpwalk_cache_multi_oid($device, 'tempTable', array(), 'NETONIX-SWITCH-MIB', '+'.$config['mibdir'].'/netonix');
if (is_array($oids)) { if (is_array($oids)) {
foreach ($oids as $index => $entry) { foreach ($oids as $index => $entry) {
@@ -25,4 +38,4 @@ if ($device['os'] == 'netonix') {
} }
} }
} }
}//end if }

View File

@@ -1,19 +1,32 @@
<?php <?php
/* /**
* LibreNMS module for Netonix * netonix.inc.php
* *
* Copyright (c) 2016 Tony Murray <murraytony@gmail.com> * LibreNMS voltages module for Netonix
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify
* under the terms of the GNU General Public License as published by the * it under the terms of the GNU General Public License as published by
* Free Software Foundation, either version 3 of the License, or (at your * the Free Software Foundation, either version 3 of the License, or
* option) any later version. Please see LICENSE.txt at the top level of * (at your option) any later version.
* the source code distribution for details. *
*/ * 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
// Netonix Voltages // Netonix Voltages
if ($device['os'] == 'netonix') { if ($device['os'] == 'netonix') {
echo 'Netonix: '; echo 'Netonix: ';
// NETONIX-SWITCH-MIB::voltageTable .1.3.6.1.4.1.46242.4
$oids = snmpwalk_cache_multi_oid($device, 'voltageTable', array(), 'NETONIX-SWITCH-MIB', '+'.$config['mibdir'].'/netonix'); $oids = snmpwalk_cache_multi_oid($device, 'voltageTable', array(), 'NETONIX-SWITCH-MIB', '+'.$config['mibdir'].'/netonix');
if (is_array($oids)) { if (is_array($oids)) {
foreach ($oids as $index => $entry) { foreach ($oids as $index => $entry) {

View File

@@ -1,15 +1,27 @@
<?php <?php
/* /**
* LibreNMS module for Netonix * netonix.inc.php
* *
* Copyright (c) 2016 Tony Murray <murraytony@gmail.com> * LibreNMS mempools module for Netonix
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify
* under the terms of the GNU General Public License as published by the * it under the terms of the GNU General Public License as published by
* Free Software Foundation, either version 3 of the License, or (at your * the Free Software Foundation, either version 3 of the License, or
* option) any later version. Please see LICENSE.txt at the top level of * (at your option) any later version.
* the source code distribution for details. *
*/ * 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
if ($device['os'] == 'netonix') { if ($device['os'] == 'netonix') {
$total = snmp_get($device, "UCD-SNMP-MIB::memTotalReal.0", "-OvQU") * 1024; $total = snmp_get($device, "UCD-SNMP-MIB::memTotalReal.0", "-OvQU") * 1024;

View File

@@ -1,16 +1,29 @@
<?php <?php
/* /**
* LibreNMS module for Netonix * netonix.inc.php
* *
* Copyright (c) 2016 Tony Murray <murraytony@gmail.com> * LibreNMS os poller module for Netonix
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify
* under the terms of the GNU General Public License as published by the * it under the terms of the GNU General Public License as published by
* Free Software Foundation, either version 3 of the License, or (at your * the Free Software Foundation, either version 3 of the License, or
* option) any later version. Please see LICENSE.txt at the top level of * (at your option) any later version.
* the source code distribution for details. *
*/ * 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 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
$version = snmp_get($device, 'firmwareVersion.0', '-OQv', 'NETONIX-SWITCH-MIB', $config['mibdir'].':'.$config['mibdir'].'/netonix'); //NETONIX-SWITCH-MIB::firmwareVersion.0
$version = snmp_get($device, '.1.3.6.1.4.1.46242.1.0', '-OQv');
$version = str_replace('.n.........', '', $version); // version display bug in 1.3.9 $version = str_replace('.n.........', '', $version); // version display bug in 1.3.9
$hardware = $poll_device['sysDescr']; $hardware = $poll_device['sysDescr'];

View File

@@ -7,11 +7,11 @@ IMPORTS
DisplayString,TEXTUAL-CONVENTION FROM SNMPv2-TC; DisplayString,TEXTUAL-CONVENTION FROM SNMPv2-TC;
netonixSwitch MODULE-IDENTITY netonixSwitch MODULE-IDENTITY
LAST-UPDATED "9803231700Z" LAST-UPDATED "9803231800Z"
ORGANIZATION "Netonix" ORGANIZATION "Netonix"
CONTACT-INFO "eric@netonix.com" CONTACT-INFO "eric@netonix.com"
DESCRIPTION "The MIB Module for Netonix Switches." DESCRIPTION "The MIB Module for Netonix Switches."
REVISION "9803231700Z" REVISION "9803231800Z"
DESCRIPTION "The MIB Module for Netonix Switches." DESCRIPTION "The MIB Module for Netonix Switches."
::= { enterprises 46242 } ::= { enterprises 46242 }
@@ -22,7 +22,10 @@ netonixSwitchGroup OBJECT-GROUP
temp, temp,
voltageDescription, voltageDescription,
voltage, voltage,
poeStatus poeStatus,
totalPowerConsumption,
dcdcInputCurrent,
dcdcEfficiency
} }
STATUS current STATUS current
DESCRIPTION "A collection of objects providing basic instrumentation and control of an SNMPv2 entity." DESCRIPTION "A collection of objects providing basic instrumentation and control of an SNMPv2 entity."
@@ -44,6 +47,18 @@ VoltageTC ::= TEXTUAL-CONVENTION
DESCRIPTION "A voltage with 2 decimal places" DESCRIPTION "A voltage with 2 decimal places"
SYNTAX Integer32 SYNTAX Integer32
PowerTC ::= TEXTUAL-CONVENTION
DISPLAY-HINT "d-1"
STATUS current
DESCRIPTION "Power consumption in watts with 1 decimal place"
SYNTAX Integer32
CurrentTC ::= TEXTUAL-CONVENTION
DISPLAY-HINT "d-1"
STATUS current
DESCRIPTION "Current in amps with 1 decimal place"
SYNTAX Integer32
firmwareVersion OBJECT-TYPE firmwareVersion OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255)) SYNTAX DisplayString (SIZE (0..255))
MAX-ACCESS read-only MAX-ACCESS read-only
@@ -51,6 +66,27 @@ firmwareVersion OBJECT-TYPE
DESCRIPTION "The version of the firmware running on the switch" DESCRIPTION "The version of the firmware running on the switch"
::= { netonixSwitch 1 } ::= { netonixSwitch 1 }
totalPowerConsumption OBJECT-TYPE
SYNTAX PowerTC
MAX-ACCESS read-only
STATUS current
DESCRIPTION "Total power being consumed by the switch, in Watts"
::= { netonixSwitch 6 }
dcdcInputCurrent OBJECT-TYPE
SYNTAX CurrentTC
MAX-ACCESS read-only
STATUS current
DESCRIPTION "DCDC Input Current in amps"
::= { netonixSwitch 7 }
dcdcEfficiency OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION "DCDC power supply efficiency, percentage"
::= { netonixSwitch 8 }
fanTable OBJECT-TYPE fanTable OBJECT-TYPE
SYNTAX SEQUENCE OF FanEntry SYNTAX SEQUENCE OF FanEntry
MAX-ACCESS not-accessible MAX-ACCESS not-accessible
@@ -86,14 +122,14 @@ fanSpeed OBJECT-TYPE
::= { fanEntry 2 } ::= { fanEntry 2 }
poeStatusTable OBJECT-TYPE poeStatusTable OBJECT-TYPE
SYNTAX SEQUENCE OF PoEStatus SYNTAX SEQUENCE OF PoEStatusEntry
MAX-ACCESS not-accessible MAX-ACCESS not-accessible
STATUS current STATUS current
DESCRIPTION "PoE Status per port." DESCRIPTION "PoE Status per port."
::= { netonixSwitch 5 } ::= { netonixSwitch 5 }
poeStatusEntry OBJECT-TYPE poeStatusEntry OBJECT-TYPE
SYNTAX PoeStatusEntry SYNTAX PoEStatusEntry
MAX-ACCESS not-accessible MAX-ACCESS not-accessible
STATUS current STATUS current
DESCRIPTION "An entry containing poe status." DESCRIPTION "An entry containing poe status."