mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
git-svn-id: http://www.observium.org/svn/observer/trunk@1590 61d68cd4-352d-0410-923a-c4978735b2b8
45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
<?php
|
|
|
|
global $valid_sensor;
|
|
|
|
## XUPS
|
|
if ($device['os'] == "powerware")
|
|
{
|
|
echo("XUPS-MIB ");
|
|
|
|
# I'm not sure if there is provision for frequency of multiple phases in this MIB -TL
|
|
|
|
# XUPS-MIB::xupsInputFrequency.0 = INTEGER: 500
|
|
$freq_oid = ".1.3.6.1.4.1.534.1.3.1.0";
|
|
$descr = "Input";
|
|
$divisor = 10;
|
|
$current = snmp_get($device, $freq_oid, "-Oqv") / $divisor;
|
|
$type = "xups";
|
|
$index = '3.1.0';
|
|
echo discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
|
|
|
# XUPS-MIB::xupsOutputFrequency.0 = INTEGER: 500
|
|
$freq_oid = "1.3.6.1.4.1.534.1.4.2.0";
|
|
$descr = "Output";
|
|
$divisor = 10;
|
|
$current = snmp_get($device, $freq_oid, "-Oqv") / $divisor;
|
|
$type = "xups";
|
|
$index = '4.2.0';
|
|
echo discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
|
|
|
# XUPS-MIB::xupsBypassFrequency.0 = INTEGER: 500
|
|
$freq_oid = "1.3.6.1.4.1.534.1.5.1.0";
|
|
$descr = "Bypass";
|
|
$divisor = 10;
|
|
$current = snmp_get($device, $freq_oid, "-Oqv");
|
|
if ($current != "")
|
|
{
|
|
# Bypass is not always available in SNMP
|
|
$current /= $divisor;
|
|
$type = "xups";
|
|
$index = '5.1.0';
|
|
echo discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
|
}
|
|
}
|
|
?>
|