mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
added support for megatec ups - added battery voltage
This commit is contained in:
@@ -55,7 +55,7 @@ if ($device['os'] == 'netagent2') {
|
||||
$voltage
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$out_voltage_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.1.0';
|
||||
$out_voltage = snmp_get($device, $out_voltage_oid, '-Oqv');
|
||||
|
||||
@@ -87,4 +87,36 @@ if ($device['os'] == 'netagent2') {
|
||||
$voltage
|
||||
);
|
||||
}
|
||||
|
||||
$battery_voltage_oid = '.1.3.6.1.4.1.935.1.1.1.2.2.2.0';
|
||||
$battery_voltage = snmp_get($device, $battery_voltage_oid, '-Oqv');
|
||||
|
||||
if (!empty($battery_voltage) || $battery_voltage == 0) {
|
||||
$type = 'netagent2';
|
||||
$index = 2;
|
||||
$limit = 100;
|
||||
$warnlimit = null;
|
||||
$lowlimit = null;
|
||||
$lowwarnlimit = null;
|
||||
$divisor = 10;
|
||||
$voltage = $battery_voltage / $divisor;
|
||||
$descr = 'Battery Voltage';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'voltage',
|
||||
$device,
|
||||
$battery_voltage_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$voltage
|
||||
);
|
||||
}
|
||||
}//end if
|
||||
|
||||
Reference in New Issue
Block a user