2010-07-31 19:49:11 +00:00
|
|
|
<?php
|
|
|
|
|
2012-05-25 12:24:34 +00:00
|
|
|
// APC
|
2015-07-10 13:36:21 +02:00
|
|
|
if ($device['os'] == 'apc') {
|
2016-10-11 17:34:09 +01:00
|
|
|
$oids = snmp_walk($device, '.1.3.6.1.4.1.318.1.1.8.5.3.2.1.4', '-OsqnU', '');
|
2015-08-20 15:59:43 +02:00
|
|
|
d_echo($oids."\n");
|
2010-07-31 19:49:11 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
if ($oids) {
|
|
|
|
echo 'APC In ';
|
2010-07-31 19:49:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$divisor = 1;
|
2015-07-10 13:36:21 +02:00
|
|
|
$type = 'apc';
|
|
|
|
foreach (explode("\n", $oids) as $data) {
|
|
|
|
$data = trim($data);
|
|
|
|
if ($data) {
|
|
|
|
list($oid,$current) = explode(' ', $data, 2);
|
|
|
|
$split_oid = explode('.', $oid);
|
|
|
|
$index = $split_oid[(count($split_oid) - 1)];
|
2016-10-11 17:34:09 +01:00
|
|
|
$oid = '.1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.'.$index;
|
2015-07-10 13:36:21 +02:00
|
|
|
$descr = 'Input Feed '.chr(64 + $index);
|
|
|
|
discover_sensor($valid['sensor'], 'frequency', $device, $oid, "3.2.1.4.$index", $type, $descr, $divisor, '1', null, null, null, null, $current);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-11 17:34:09 +01:00
|
|
|
$oids = snmp_walk($device, '.1.3.6.1.4.1.318.1.1.8.5.4.2.1.4', '-OsqnU', '');
|
2015-08-20 15:59:43 +02:00
|
|
|
d_echo($oids."\n");
|
2015-07-10 13:36:21 +02:00
|
|
|
|
|
|
|
if ($oids) {
|
|
|
|
echo ' APC Out ';
|
|
|
|
}
|
2010-07-31 19:49:11 +00:00
|
|
|
|
|
|
|
$divisor = 1;
|
2015-07-10 13:36:21 +02:00
|
|
|
$type = 'apc';
|
|
|
|
foreach (explode("\n", $oids) as $data) {
|
|
|
|
$data = trim($data);
|
|
|
|
if ($data) {
|
|
|
|
list($oid,$current) = explode(' ', $data, 2);
|
|
|
|
$split_oid = explode('.', $oid);
|
|
|
|
$index = $split_oid[(count($split_oid) - 3)];
|
2016-10-11 17:34:09 +01:00
|
|
|
$oid = '.1.3.6.1.4.1.318.1.1.8.5.4.2.1.4.'.$index;
|
2015-07-10 13:36:21 +02:00
|
|
|
$descr = 'Output Feed';
|
|
|
|
if (count(explode("\n", $oids)) > 1) {
|
|
|
|
$descr .= " $index";
|
|
|
|
}
|
|
|
|
|
|
|
|
discover_sensor($valid['sensor'], 'frequency', $device, $oid, "4.2.1.4.$index", $type, $descr, $divisor, '1', null, null, null, null, $current);
|
|
|
|
}
|
|
|
|
}
|
2011-03-15 09:57:13 +00:00
|
|
|
|
2016-10-11 17:34:09 +01:00
|
|
|
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.3.2.4.0', '-OsqnU', '');
|
2015-08-20 15:59:43 +02:00
|
|
|
d_echo($oids."\n");
|
2015-07-10 13:36:21 +02:00
|
|
|
|
|
|
|
if ($oids) {
|
|
|
|
echo ' APC In ';
|
|
|
|
list($oid,$current) = explode(' ', $oids);
|
|
|
|
$divisor = 1;
|
|
|
|
$type = 'apc';
|
|
|
|
$index = '3.2.4.0';
|
|
|
|
$descr = 'Input';
|
|
|
|
discover_sensor($valid['sensor'], 'frequency', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
|
|
|
}
|
|
|
|
|
2016-10-11 17:34:09 +01:00
|
|
|
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.4.2.2.0', '-OsqnU', '');
|
2015-08-20 15:59:43 +02:00
|
|
|
d_echo($oids."\n");
|
2015-07-10 13:36:21 +02:00
|
|
|
|
|
|
|
if ($oids) {
|
|
|
|
echo ' APC Out ';
|
|
|
|
list($oid,$current) = explode(' ', $oids);
|
|
|
|
$divisor = 1;
|
|
|
|
$type = 'apc';
|
|
|
|
$index = '4.2.2.0';
|
|
|
|
$descr = 'Output';
|
|
|
|
discover_sensor($valid['sensor'], 'frequency', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
|
|
|
}
|
|
|
|
}//end if
|