From a34b95835279cd3effa22f49d142c3e0c03a0b78 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Fri, 5 Feb 2016 17:57:17 -0600 Subject: [PATCH 1/5] Add hardware and version for Netonix. --- includes/polling/os/netonix.inc.php | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 includes/polling/os/netonix.inc.php diff --git a/includes/polling/os/netonix.inc.php b/includes/polling/os/netonix.inc.php new file mode 100644 index 0000000000..bd63ed309e --- /dev/null +++ b/includes/polling/os/netonix.inc.php @@ -0,0 +1,3 @@ + Date: Mon, 8 Feb 2016 15:50:54 -0600 Subject: [PATCH 2/5] Do not hardcode mib path --- includes/polling/os/netonix.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/polling/os/netonix.inc.php b/includes/polling/os/netonix.inc.php index bd63ed309e..50c1782a8b 100644 --- a/includes/polling/os/netonix.inc.php +++ b/includes/polling/os/netonix.inc.php @@ -1,3 +1,3 @@ Date: Tue, 9 Feb 2016 08:01:41 -0600 Subject: [PATCH 3/5] Use $config['mibdir'] instead of $config['mib_dir'] --- includes/polling/os/netonix.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/polling/os/netonix.inc.php b/includes/polling/os/netonix.inc.php index 50c1782a8b..3b58eb81c8 100644 --- a/includes/polling/os/netonix.inc.php +++ b/includes/polling/os/netonix.inc.php @@ -1,3 +1,3 @@ Date: Tue, 9 Feb 2016 13:31:36 -0600 Subject: [PATCH 4/5] Add fanspeed,temp, and voltage for Netonix switches. --- .../sensors/fanspeeds/netonix.inc.php | 17 +++++++++++++++++ .../sensors/temperatures/netonix.inc.php | 17 +++++++++++++++++ .../discovery/sensors/voltages/netonix.inc.php | 18 ++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 includes/discovery/sensors/fanspeeds/netonix.inc.php create mode 100644 includes/discovery/sensors/temperatures/netonix.inc.php create mode 100644 includes/discovery/sensors/voltages/netonix.inc.php diff --git a/includes/discovery/sensors/fanspeeds/netonix.inc.php b/includes/discovery/sensors/fanspeeds/netonix.inc.php new file mode 100644 index 0000000000..0a4a942d86 --- /dev/null +++ b/includes/discovery/sensors/fanspeeds/netonix.inc.php @@ -0,0 +1,17 @@ + $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 diff --git a/includes/discovery/sensors/temperatures/netonix.inc.php b/includes/discovery/sensors/temperatures/netonix.inc.php new file mode 100644 index 0000000000..fbaf910eca --- /dev/null +++ b/includes/discovery/sensors/temperatures/netonix.inc.php @@ -0,0 +1,17 @@ + $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 diff --git a/includes/discovery/sensors/voltages/netonix.inc.php b/includes/discovery/sensors/voltages/netonix.inc.php new file mode 100644 index 0000000000..f800df6e9a --- /dev/null +++ b/includes/discovery/sensors/voltages/netonix.inc.php @@ -0,0 +1,18 @@ + $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 From f45bceecba55821e6f4dbaea0d593410ea9bfeb6 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Tue, 9 Feb 2016 13:36:44 -0600 Subject: [PATCH 5/5] The fanspeed is frequently 0 rpm. --- includes/discovery/sensors/fanspeeds/netonix.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/discovery/sensors/fanspeeds/netonix.inc.php b/includes/discovery/sensors/fanspeeds/netonix.inc.php index 0a4a942d86..b2882d0b58 100644 --- a/includes/discovery/sensors/fanspeeds/netonix.inc.php +++ b/includes/discovery/sensors/fanspeeds/netonix.inc.php @@ -10,7 +10,7 @@ if ($device['os'] == 'netonix') { $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); + discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $device['os'], $descr, '1', '1', '0', '0', null, null, $current); } } }