2015-05-17 16:42:09 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if ($device['os'] == 'raritan')
|
|
|
|
{
|
|
|
|
// Check Inlets
|
|
|
|
$inlet_oids = snmp_walk($device,"inletLabel","-Osqn","PDU2-MIB");
|
|
|
|
$inlet_oids = trim($inlet_oids);
|
|
|
|
if ($inlet_oids) echo("PDU Inlet ");
|
|
|
|
foreach (explode("\n", $inlet_oids) as $inlet_data)
|
|
|
|
{
|
|
|
|
$inlet_data = trim($inlet_data);
|
|
|
|
if ($inlet_data)
|
|
|
|
{
|
|
|
|
list($inlet_oid,$inlet_descr) = explode(" ", $inlet_data,2);
|
|
|
|
$inlet_split_oid = explode('.', $inlet_oid);
|
2015-05-17 18:25:03 +02:00
|
|
|
$inlet_index = $inlet_split_oid[count($inlet_split_oid)-2].".".$inlet_split_oid[count($inlet_split_oid)-1];
|
2015-05-17 16:42:09 +02:00
|
|
|
|
2015-05-17 18:25:03 +02:00
|
|
|
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.23";
|
|
|
|
$inlet_divisor = pow(10,snmp_get($device, "inletSensorDecimalDigits.$inlet_index.frequency", "-Ovq","PDU2-MIB"));
|
|
|
|
$inlet_frequency = snmp_get($device, "measurementsInletSensorValue.$inlet_index.frequency", "-Ovq", "PDU2-MIB") / $inlet_divisor;
|
2015-05-17 16:42:09 +02:00
|
|
|
|
|
|
|
if ($inlet_frequency >= 0) {
|
2015-05-17 18:25:03 +02:00
|
|
|
discover_sensor($valid['sensor'], 'frequency', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, 1, NULL, NULL, NULL, NULL, $inlet_frequency);
|
2015-05-17 16:42:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|