2017-06-04 21:27:00 +03:00
|
|
|
<?php
|
|
|
|
|
|
2018-01-07 05:00:47 +00:00
|
|
|
if (preg_match("/(Linux).+(ntc)/", $device['sysDescr'])) {
|
2017-06-04 21:27:00 +03:00
|
|
|
$sensor_type = "chip_battery_charge";
|
|
|
|
|
$oid = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.10.112.111.119.101.114.45.115.116.97.';
|
|
|
|
|
$lowlimit = 5;
|
|
|
|
|
$lowwarnlimit = 9;
|
|
|
|
|
$warnlimit = null;
|
|
|
|
|
$limit = null;
|
|
|
|
|
$descr = 'Battery charge';
|
|
|
|
|
$index = '116.8';
|
|
|
|
|
$value = snmp_get($device, $oid.$index, '-Oqv');
|
2018-08-13 23:40:54 +02:00
|
|
|
if (is_numeric($value)) {
|
2019-03-04 17:31:17 +00:00
|
|
|
discover_sensor($valid['sensor'], 'charge', $device, $oid.$index, $index, $sensor_type, $descr, 1, 1, $lowlimit, $lowwarnlimit, $warnlimit, $limit, $value);
|
2018-08-13 23:40:54 +02:00
|
|
|
}
|
2017-06-04 21:27:00 +03:00
|
|
|
}
|
2017-11-23 21:37:05 +01:00
|
|
|
|
|
|
|
|
$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';
|
2018-08-13 23:40:54 +02:00
|
|
|
if (is_numeric($value)) {
|
2020-02-09 20:47:03 +01:00
|
|
|
discover_sensor($valid['sensor'], 'charge', $device, $oids, $index, $type, $descr, 1, 1, $lowlimit, $lowwarnlimit, null, $limit, $value);
|
2018-08-13 23:40:54 +02:00
|
|
|
}
|
2017-11-23 21:37:05 +01:00
|
|
|
}
|
|
|
|
|
unset($oids);
|