feature: Added additional sensors for ups-nut

* Add db schema for ups-nut alerting

* Add db schema for ups-nut alerting

* Add db schema for ups-nut alerting

* Add db schema for ups-nut alerting
This commit is contained in:
Martin Zatloukal
2017-11-23 21:37:05 +01:00
committed by Neil Lathwood
parent 9113f81272
commit 8c8a2e05c6
4 changed files with 108 additions and 0 deletions

View File

@@ -13,3 +13,18 @@ if (preg_match("/(Linux).+(ntc)/", $chip)) {
$value = snmp_get($device, $oid.$index, '-Oqv');
discover_sensor($valid['sensor'], 'charge', $device, $oid.$index, $index, $sensor_type, $descr, '1', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
}
$oids = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.1';
$value = snmp_get($device, $oids, '-Osqnv');
if (!empty($value)) {
$type = 'ups-nut';
$index = 1;
$limit = 100;
$lowlimit = 0;
$lowwarnlimit = 10;
$descr = 'Battery Charge';
discover_sensor($valid['sensor'], 'ups_nut', $device, $oids, $index, $type, $descr, 1, 1, $lowlimit, $lowwarnlimit, null, $limit, $value);
}
unset($oids);

View File

@@ -0,0 +1,17 @@
<?php
$oids = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.8';
$value = snmp_get($device, $oids, '-Osqnv');
if (!empty($value)) {
$type = 'ups-nut';
$index = 8;
$limit = 100;
$lowlimit = 0;
$lowwarnlimit = 0;
$descr = 'Ups Load';
discover_sensor($valid['sensor'], 'ups_nut', $device, $oids, $index, $type, $descr, 1, 1, $lowlimit, $lowwarnlimit, null, $limit, $value);
}
unset($oids);

View File

@@ -0,0 +1,17 @@
<?php
$oids = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.3';
$value = snmp_get($device, $oids, '-Osqnv');
if (!empty($value)) {
$type = 'ups-nut';
$index = 3;
$limit = 1000;
$lowlimit = 0;
$lowwarnlimit = 0;
$descr = 'Time Remaining';
discover_sensor($valid['sensor'], 'ups_nut', $device, $oids, $index, $type, $descr, 60, 1, $lowlimit, $lowwarnlimit, null, $limit, $value);
}
unset($oids);

View File

@@ -90,3 +90,62 @@ if (preg_match("/(Linux).+(ntc)/", $chip)) {
$value = snmp_get($device, $oid.$index, '-Oqv');
discover_sensor($valid['sensor'], 'voltage', $device, $oid.$index, $index, $sensor_type, $descr, '1', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
}
$oids = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.4';
$value = snmp_get($device, $oids, '-Osqnv');
if (!empty($value)) {
$type = 'ups-nut';
$index = 4;
$limit = 60;
$lowlimit = 0;
$lowwarnlimit = 0;
$descr = 'Battery Voltage';
discover_sensor($valid['sensor'], 'ups_nut', $device, $oids, $index, $type, $descr, 1, 1, $lowlimit, $lowwarnlimit, null, $limit, $value);
}
unset($oids);
$oids = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.5';
$value = snmp_get($device, $oids, '-Osqnv');
if (!empty($value)) {
$type = 'ups-nut';
$index = 5;
$limit = 60;
$lowlimit = 0;
$lowwarnlimit = 0;
$descr = 'Battery Nominal';
discover_sensor($valid['sensor'], 'ups_nut', $device, $oids, $index, $type, $descr, 1, 1, $lowlimit, $lowwarnlimit, null, $limit, $value);
}
unset($oids);
$oids = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.6';
$value = snmp_get($device, $oids, '-Osqnv');
if (!empty($value)) {
$type = 'ups-nut';
$index = 6;
$limit = 0;
$lowlimit = 0;
$lowwarnlimit = 0;
$descr = 'Line Nominal';
discover_sensor($valid['sensor'], 'ups_nut', $device, $oids, $index, $type, $descr, 1, 1, $lowlimit, $lowwarnlimit, null, $limit, $value);
}
unset($oids);
$oids = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.7';
$value = snmp_get($device, $oids, '-Osqnv');
if (!empty($value)) {
$type = 'ups-nut';
$index = 7;
$limit = 280;
$lowlimit = 200;
$lowwarnlimit = 0;
$descr = 'Input Voltage';
discover_sensor($valid['sensor'], 'ups_nut', $device, $oids, $index, $type, $descr, 1, 1, $lowlimit, $lowwarnlimit, null, $limit, $value);
}