Add fanspeed,temp, and voltage for Netonix switches.

This commit is contained in:
Tony Murray
2016-02-09 13:31:36 -06:00
parent 1b59ae9648
commit 0422d8e589
3 changed files with 52 additions and 0 deletions
@@ -0,0 +1,17 @@
<?php
// Netonix Fan Speeds
if ($device['os'] == 'netonix') {
echo 'Netonix: ';
$oids = snmpwalk_cache_multi_oid($device, 'fanTable', array(), 'NETONIX-SWITCH-MIB', '+'.$config['mibdir'].'/netonix');
if (is_array($oids)) {
foreach ($oids as $index => $entry) {
if (is_numeric($entry['fanSpeed']) && is_numeric($index)) {
$descr = $index;
$oid = '.1.3.6.1.4.1.46242.2.1.2.'.$index;
$current = $entry['fanSpeed'];
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $device['os'], $descr, '1', '1', null, null, null, null, $current);
}
}
}
}//end if
@@ -0,0 +1,17 @@
<?php
// Netonix Temperatures
if ($device['os'] == 'netonix') {
echo 'Netonix: ';
$oids = snmpwalk_cache_multi_oid($device, 'tempTable', array(), 'NETONIX-SWITCH-MIB', '+'.$config['mibdir'].'/netonix');
if (is_array($oids)) {
foreach ($oids as $index => $entry) {
if (is_numeric($entry['temp']) && is_numeric($index) && $entry['temp'] > '0') {
$descr = $entry['tempDescription'];
$oid = '.1.3.6.1.4.1.46242.3.1.3.'.$index;
$current = $entry['temp'];
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $device['os'], $descr, '1', '1', null, null, null, null, $current);
}
}
}
}//end if
@@ -0,0 +1,18 @@
<?php
// Netonix Voltages
if ($device['os'] == 'netonix') {
echo 'Netonix: ';
$oids = snmpwalk_cache_multi_oid($device, 'voltageTable', array(), 'NETONIX-SWITCH-MIB', '+'.$config['mibdir'].'/netonix');
if (is_array($oids)) {
foreach ($oids as $index => $entry) {
if (is_numeric($entry['voltage']) && is_numeric($index) && $entry['voltage'] > '0') {
$descr = $entry['voltageDescription'];
$oid = '.1.3.6.1.4.1.46242.4.1.3.'.$index;
$current = $entry['voltage'];
$divisor = 100;
discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $device['os'], $descr, $divisor, '1', null, null, null, null, $current);
}
}
}
}//end if