2010-07-31 19:49:11 +00:00
|
|
|
<?php
|
|
|
|
|
2012-05-25 11:29:53 +00:00
|
|
|
/// APC
|
2012-05-15 18:18:20 +00:00
|
|
|
if ($device['os'] == "apc")
|
2010-07-31 19:49:11 +00:00
|
|
|
{
|
|
|
|
$oids = snmp_walk($device, "1.3.6.1.4.1.318.1.1.8.5.3.2.1.4", "-OsqnU", "");
|
|
|
|
if ($debug) { echo($oids."\n"); }
|
|
|
|
if ($oids) echo("APC In ");
|
|
|
|
$divisor = 1;
|
|
|
|
$type = "apc";
|
2011-03-15 09:57:13 +00:00
|
|
|
foreach (explode("\n", $oids) as $data)
|
2010-07-31 19:49:11 +00:00
|
|
|
{
|
|
|
|
$data = trim($data);
|
2011-03-15 09:57:13 +00:00
|
|
|
if ($data)
|
2010-07-31 19:49:11 +00:00
|
|
|
{
|
|
|
|
list($oid,$current) = explode(" ", $data,2);
|
|
|
|
$split_oid = explode('.',$oid);
|
|
|
|
$index = $split_oid[count($split_oid)-1];
|
|
|
|
$oid = "1.3.6.1.4.1.318.1.1.8.5.3.2.1.4." . $index;
|
|
|
|
$descr = "Input Feed " . chr(64+$index);
|
2011-05-04 11:04:19 +00:00
|
|
|
discover_sensor($valid['sensor'], 'frequency', $device, $oid, "3.2.1.4.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
2010-07-31 19:49:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$oids = snmp_walk($device, "1.3.6.1.4.1.318.1.1.8.5.4.2.1.4", "-OsqnU", "");
|
|
|
|
if ($debug) { echo($oids."\n"); }
|
|
|
|
if ($oids) echo(" APC Out ");
|
|
|
|
$divisor = 1;
|
|
|
|
$type = "apc";
|
2011-03-15 09:57:13 +00:00
|
|
|
foreach (explode("\n", $oids) as $data)
|
2010-07-31 19:49:11 +00:00
|
|
|
{
|
|
|
|
$data = trim($data);
|
2011-03-15 09:57:13 +00:00
|
|
|
if ($data)
|
2010-07-31 19:49:11 +00:00
|
|
|
{
|
|
|
|
list($oid,$current) = explode(" ", $data,2);
|
|
|
|
$split_oid = explode('.',$oid);
|
|
|
|
$index = $split_oid[count($split_oid)-3];
|
|
|
|
$oid = "1.3.6.1.4.1.318.1.1.8.5.4.2.1.4." . $index;
|
|
|
|
$descr = "Output Feed"; if (count(explode("\n", $oids)) > 1) { $descr .= " $index"; }
|
2011-05-04 11:04:19 +00:00
|
|
|
discover_sensor($valid['sensor'], 'frequency', $device, $oid, "4.2.1.4.$index", $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
2010-07-31 19:49:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$oids = snmp_get($device, "1.3.6.1.4.1.318.1.1.1.3.2.4.0", "-OsqnU", "");
|
|
|
|
if ($debug) { echo($oids."\n"); }
|
|
|
|
if ($oids)
|
|
|
|
{
|
|
|
|
echo(" APC In ");
|
|
|
|
list($oid,$current) = explode(" ",$oids);
|
|
|
|
$divisor = 1;
|
|
|
|
$type = "apc";
|
|
|
|
$index = "3.2.4.0";
|
|
|
|
$descr = "Input";
|
2011-05-04 11:04:19 +00:00
|
|
|
discover_sensor($valid['sensor'], 'frequency', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
2010-07-31 19:49:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$oids = snmp_get($device, "1.3.6.1.4.1.318.1.1.1.4.2.2.0", "-OsqnU", "");
|
|
|
|
if ($debug) { echo($oids."\n"); }
|
|
|
|
if ($oids)
|
|
|
|
{
|
|
|
|
echo(" APC Out ");
|
|
|
|
list($oid,$current) = explode(" ",$oids);
|
|
|
|
$divisor = 1;
|
|
|
|
$type = "apc";
|
|
|
|
$index = "4.2.2.0";
|
|
|
|
$descr = "Output";
|
2011-05-04 11:04:19 +00:00
|
|
|
discover_sensor($valid['sensor'], 'frequency', $device, $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
|
|
|
|
2012-05-15 18:18:20 +00:00
|
|
|
?>
|