mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-02 00:32:09 +02:00
MGE UPS current support
git-svn-id: http://www.observium.org/svn/observer/trunk@1132 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -44,6 +44,59 @@ if ($device['os'] == "apc")
|
||||
}
|
||||
}
|
||||
|
||||
## MGE UPS
|
||||
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++)
|
||||
{
|
||||
$current_oid = ".1.3.6.1.4.1.705.1.7.2.1.5.$i";
|
||||
$descr = "Output"; if ($numPhase > 1) $descr .= " Phase $i";
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
if (!$current)
|
||||
{
|
||||
$current_oid .= ".0";
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
}
|
||||
$current /= 10;
|
||||
$type = "mge-ups";
|
||||
$precision = 10;
|
||||
$index = $i;
|
||||
$warnlimit = NULL;
|
||||
$lowlimit = 0;
|
||||
$limit = NULL;
|
||||
echo discover_current($device, $current_oid, $index, $type, $descr, $precision, $lowlimit, $warnlimit, $limit, $current);
|
||||
$current_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++)
|
||||
{
|
||||
$current_oid = ".1.3.6.1.4.1.705.1.7.2.1.6.$i";
|
||||
$descr = "Input"; if ($numPhase > 1) $descr .= " Phase $i";
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
if (!$current)
|
||||
{
|
||||
$current_oid .= ".0";
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
}
|
||||
$current /= 10;
|
||||
$type = "mge-ups";
|
||||
$precision = 10;
|
||||
$index = 100+$i;
|
||||
$warnlimit = NULL;
|
||||
$lowlimit = 0;
|
||||
$limit = NULL;
|
||||
echo discover_current($device, $current_oid, $index, $type, $descr, $precision, $lowlimit, $warnlimit, $limit, $current);
|
||||
$current_exists[$type][$index] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
## Delete removed sensors
|
||||
|
||||
if($debug) { print_r($current_exists); }
|
||||
|
||||
Reference in New Issue
Block a user