2010-07-31 19:49:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
global $valid_sensor;
|
|
|
|
|
|
|
|
## MGE UPS Frequencies
|
2011-03-15 09:57:13 +00:00
|
|
|
if ($device['os'] == "mgeups")
|
2010-07-31 19:49:11 +00:00
|
|
|
{
|
|
|
|
echo("MGE ");
|
|
|
|
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU"));
|
|
|
|
if ($debug) { echo($oids."\n"); }
|
2010-07-31 23:23:50 +00:00
|
|
|
$numPhase = count(explode("\n",$oids));
|
2010-07-31 19:49:11 +00:00
|
|
|
for($i = 1; $i <= $numPhase;$i++)
|
|
|
|
{
|
|
|
|
$freq_oid = ".1.3.6.1.4.1.705.1.7.2.1.3.$i";
|
|
|
|
$descr = "Output"; if ($numPhase > 1) $descr .= " Phase $i";
|
|
|
|
$current = snmp_get($device, $freq_oid, "-Oqv");
|
|
|
|
if (!$current)
|
|
|
|
{
|
|
|
|
$freq_oid .= ".0";
|
|
|
|
$current = snmp_get($device, $freq_oid, "-Oqv");
|
|
|
|
}
|
|
|
|
$current /= 10;
|
|
|
|
$type = "mge-ups";
|
|
|
|
$divisor = 10;
|
|
|
|
$index = $i;
|
2011-03-15 09:57:13 +00:00
|
|
|
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
2010-07-31 19:49:11 +00:00
|
|
|
}
|
|
|
|
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU"));
|
|
|
|
if ($debug) { echo($oids."\n"); }
|
2010-07-31 23:23:50 +00:00
|
|
|
$numPhase = count(explode("\n",$oids));
|
2010-07-31 19:49:11 +00:00
|
|
|
for($i = 1; $i <= $numPhase;$i++)
|
|
|
|
{
|
|
|
|
$freq_oid = ".1.3.6.1.4.1.705.1.6.2.1.3.$i";
|
|
|
|
$descr = "Input"; if ($numPhase > 1) $descr .= " Phase $i";
|
|
|
|
$current = snmp_get($device, $freq_oid, "-Oqv");
|
|
|
|
if (!$current)
|
|
|
|
{
|
|
|
|
$freq_oid .= ".0";
|
|
|
|
$current = snmp_get($device, $freq_oid, "-Oqv");
|
|
|
|
}
|
|
|
|
$current /= 10;
|
|
|
|
$type = "mge-ups";
|
|
|
|
$divisor = 10;
|
|
|
|
$index = 100+$i;
|
2011-03-15 09:57:13 +00:00
|
|
|
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
2010-07-31 19:49:11 +00:00
|
|
|
}
|
|
|
|
}
|
2011-03-15 09:57:13 +00:00
|
|
|
|
|
|
|
?>
|