mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add sentry3 voltage detection (from falz)
git-svn-id: http://www.observium.org/svn/observer/trunk@2035 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
60
includes/discovery/voltages/sentry3.inc.php
Normal file
60
includes/discovery/voltages/sentry3.inc.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
if ($device['os'] == "sentry3")
|
||||
{
|
||||
$oids = snmp_walk($device, "infeedVoltage", "-OsqnU", "Sentry3-MIB");
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
if ($oids) echo("Sentry3-MIB ");
|
||||
$divisor = 10;
|
||||
$type = "sentry3";
|
||||
|
||||
foreach (explode("\n", $oids) as $data)
|
||||
{
|
||||
$data = trim($data);
|
||||
if ($data)
|
||||
{
|
||||
list($oid,$descr) = explode(" ", $data,2);
|
||||
$split_oid = explode('.',$oid);
|
||||
$descr = "Tower " . $index;
|
||||
$index = $split_oid[count($split_oid)-1];
|
||||
$oid = "1.3.6.1.4.1.1718.3.2.2.1.11.1." . $index;
|
||||
$current = snmp_get($device, $oid, "-Oqv") / $divisor;
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
if ($device['os'] == "sentry3")
|
||||
{
|
||||
$oids = snmp_walk($device, "infeedVoltage", "-OsqnU", "Sentry3-MIB");
|
||||
if ($debug) { echo($oids."\n"); }
|
||||
if ($oids) echo("Sentry3-MIB ");
|
||||
$divisor = 10;
|
||||
$type = "sentry3";
|
||||
|
||||
foreach (explode("\n", $oids) as $data)
|
||||
{
|
||||
$data = trim($data);
|
||||
if ($data)
|
||||
{
|
||||
list($oid,$descr) = explode(" ", $data,2);
|
||||
$split_oid = explode('.',$oid);
|
||||
$descr = "Tower " . $index;
|
||||
$index = $split_oid[count($split_oid)-1];
|
||||
$oid = "1.3.6.1.4.1.1718.3.2.2.1.11." . $index . ".1";
|
||||
$current = snmp_get($device, $oid, "-Oqv") / $divisor;
|
||||
|
||||
discover_sensor($valid_sensor, 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user