mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02:00
MGE UPS support, various fixes
git-svn-id: http://www.observium.org/svn/observer/trunk@1093 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -75,6 +75,65 @@ if ($device['os'] == "linux")
|
||||
}
|
||||
}
|
||||
|
||||
## MGE UPS Voltages
|
||||
|
||||
if ($device['os'] == "mgeups")
|
||||
{
|
||||
echo("MGE ");
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU"));
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
list($unused,$numPhase) = explode(' ',$oids);
|
||||
for($i = 1; $i <= $numPhase;$i++)
|
||||
{
|
||||
$volt_oid = ".1.3.6.1.4.1.705.1.7.2.$i.2.1.0";
|
||||
$descr = "Output"; if ($numPhase > 1) $descr .= " Phase $i";
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv") / 10;
|
||||
$type = "mge-ups";
|
||||
$precision = 10;
|
||||
$index = $i;
|
||||
if ($current > 200 && $current < 250)
|
||||
{
|
||||
#FIXME Are these sensible values?
|
||||
$lowlimit = 210;
|
||||
$limit = 250;
|
||||
}
|
||||
else
|
||||
{
|
||||
$lowlimit = 0;
|
||||
$limit = 0;
|
||||
}
|
||||
echo discover_volt($device, $volt_oid, $index, $type, $descr, $precision, $lowlimit, $limit, $current);
|
||||
$volt_exists[$type][$index] = 1;
|
||||
}
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU"));
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
list($unused,$numPhase) = explode(' ',$oids);
|
||||
for($i = 1; $i <= $numPhase;$i++)
|
||||
{
|
||||
$volt_oid = ".1.3.6.1.4.1.705.1.6.2.$i.2.1.0";
|
||||
$descr = "Input"; if ($numPhase > 1) $descr .= " Phase $i";
|
||||
$current = snmp_get($device, $volt_oid, "-Oqv") / 10;
|
||||
$type = "mge-ups";
|
||||
$precision = 10;
|
||||
$index = 100+$i;
|
||||
if ($current > 200 && $current < 250)
|
||||
{
|
||||
#FIXME Are these sensible values?
|
||||
$lowlimit = 210;
|
||||
$limit = 250;
|
||||
}
|
||||
else
|
||||
{
|
||||
$lowlimit = 0;
|
||||
$limit = 0;
|
||||
}
|
||||
echo discover_volt($device, $volt_oid, $index, $type, $descr, $precision, $lowlimit, $limit, $current);
|
||||
$volt_exists[$type][$index] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
## Delete removed sensors
|
||||
|
||||
if($debug) { print_r($volt_exists); }
|
||||
|
||||
Reference in New Issue
Block a user