fixes to mge ups discovery to also work on their proxy agent, also get the serial number now

git-svn-id: http://www.observium.org/svn/observer/trunk@1594 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-07-31 23:23:50 +00:00
parent 976986f325
commit 610d0c9d6f
8 changed files with 36 additions and 15 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ if ($device['os'] == "mgeups")
echo("MGE "); echo("MGE ");
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU")); $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU"));
if ($debug) { echo($oids."\n"); } if ($debug) { echo($oids."\n"); }
list($unused,$numPhase) = explode(' ',$oids); $numPhase = count(explode("\n",$oids));
for($i = 1; $i <= $numPhase;$i++) for($i = 1; $i <= $numPhase;$i++)
{ {
unset($current); unset($current);
@@ -33,7 +33,7 @@ if ($device['os'] == "mgeups")
} }
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU")); $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU"));
if ($debug) { echo($oids."\n"); } if ($debug) { echo($oids."\n"); }
list($unused,$numPhase) = explode(' ',$oids); $numPhase = count(explode("\n",$oids));
for($i = 1; $i <= $numPhase;$i++) for($i = 1; $i <= $numPhase;$i++)
{ {
unset($current); unset($current);
@@ -8,7 +8,7 @@ if ($device['os'] == "mgeups")
echo("MGE "); echo("MGE ");
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU")); $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU"));
if ($debug) { echo($oids."\n"); } if ($debug) { echo($oids."\n"); }
list($unused,$numPhase) = explode(' ',$oids); $numPhase = count(explode("\n",$oids));
for($i = 1; $i <= $numPhase;$i++) for($i = 1; $i <= $numPhase;$i++)
{ {
$freq_oid = ".1.3.6.1.4.1.705.1.7.2.1.3.$i"; $freq_oid = ".1.3.6.1.4.1.705.1.7.2.1.3.$i";
@@ -27,7 +27,7 @@ if ($device['os'] == "mgeups")
} }
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU")); $oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU"));
if ($debug) { echo($oids."\n"); } if ($debug) { echo($oids."\n"); }
list($unused,$numPhase) = explode(' ',$oids); $numPhase = count(explode("\n",$oids));
for($i = 1; $i <= $numPhase;$i++) for($i = 1; $i <= $numPhase;$i++)
{ {
$freq_oid = ".1.3.6.1.4.1.705.1.6.2.1.3.$i"; $freq_oid = ".1.3.6.1.4.1.705.1.6.2.1.3.$i";
+3 -3
View File
@@ -1,11 +1,11 @@
<?php <?php
if(!$os) { if(!$os)
{
if(strstr($sysDescr, "Pulsar M")) { $os = "mgeups"; } if(strstr($sysDescr, "Pulsar M")) { $os = "mgeups"; }
else if (preg_match("/^Galaxy /", $sysDescr)) { $os = "mgeups"; } else if (preg_match("/^Galaxy /", $sysDescr)) { $os = "mgeups"; }
else if (preg_match("/^Evolution /", $sysDescr)) { $os = "mgeups"; } else if (preg_match("/^Evolution /", $sysDescr)) { $os = "mgeups"; }
else if ($sysDescr == "MGE UPS SYSTEMS - Network Management Proxy") { $os = "mgeups"; }
} }
?> ?>
+1
View File
@@ -3,6 +3,7 @@
if(!$os) { if(!$os) {
if(strstr($sysDescr, "Xerox Phaser")) { $os = "xerox"; } if(strstr($sysDescr, "Xerox Phaser")) { $os = "xerox"; }
else if(strstr($sysDescr, "Xerox WorkCentre")) { $os = "xerox"; }
} }
+4 -4
View File
@@ -6,9 +6,9 @@ global $valid_sensor;
if ($device['os'] == "mgeups") if ($device['os'] == "mgeups")
{ {
echo("MGE "); echo("MGE ");
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.7.1", "-OsqnU")); $oids = trim(snmp_walk($device, "mgoutputVoltage", "-OsqnU", "MG-SNMP-UPS-MIB"));
if ($debug) { echo($oids."\n"); } if ($debug) { echo($oids."\n"); }
list($unused,$numPhase) = explode(' ',$oids); $numPhase = count(explode("\n",$oids));
for($i = 1; $i <= $numPhase;$i++) for($i = 1; $i <= $numPhase;$i++)
{ {
$volt_oid = ".1.3.6.1.4.1.705.1.7.2.1.2.$i"; $volt_oid = ".1.3.6.1.4.1.705.1.7.2.1.2.$i";
@@ -25,9 +25,9 @@ if ($device['os'] == "mgeups")
$index = $i; $index = $i;
echo discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); echo discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
} }
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU")); $oids = trim(snmp_walk($device, "mgeinputVoltage", "-OsqnU", "MG-SNMP-UPS-MIB"));
if ($debug) { echo($oids."\n"); } if ($debug) { echo($oids."\n"); }
list($unused,$numPhase) = explode(' ',$oids); $numPhase = count(explode("\n",$oids));
for($i = 1; $i <= $numPhase;$i++) for($i = 1; $i <= $numPhase;$i++)
{ {
$volt_oid = ".1.3.6.1.4.1.705.1.6.2.1.2.$i"; $volt_oid = ".1.3.6.1.4.1.705.1.6.2.1.2.$i";
+9 -2
View File
@@ -1,6 +1,13 @@
<?php <?php
$version = trim(snmp_get($device, "1.3.6.1.4.1.705.1.1.4.0", "-OQv"),'"'); # MG-SNMP-UPS-MIB::upsmgIdentFamilyName.0 = STRING: "PULSAR M"
$hardware = $sysDescr; # MG-SNMP-UPS-MIB::upsmgIdentModelName.0 = STRING: "2200"
# MG-SNMP-UPS-MIB::upsmgIdentSerialNumber.0 = STRING: "AQ1H01024"
$version = trim(snmp_get($device, "upsmgIdentFirmwareVersion.0", "-OQv", "MG-SNMP-UPS-MIB"),'" ');
$hardware = trim(snmp_get($device,"upsmgIdentFamilyName.0","-OQv","MG-SNMP-UPS-MIB"),'" ');
$hardware .= ' ' . trim(snmp_get($device,"upsmgIdentModelName.0","-OQv","MG-SNMP-UPS-MIB"),'" ');
$serial = trim(snmp_get($device,"upsmgIdentSerialNumber.0","-OQv","MG-SNMP-UPS-MIB"),'" ');
?> ?>
+13
View File
@@ -18,6 +18,19 @@
# gamatronic: unknown # gamatronic: unknown
# mge: unknown # mge: unknown
# MG-SNMP-UPS-MIB::upsmgConfigLowBatteryLevel.0 = INTEGER: 20
# MG-SNMP-UPS-MIB::upsmgBatteryRemainingTime.0 = INTEGER: 15750
# MG-SNMP-UPS-MIB::upsmgBatteryLevel.0 = INTEGER: 100
# MG-SNMP-UPS-MIB::upsmgBatteryFaultBattery.0 = INTEGER: no(2)
# MG-SNMP-UPS-MIB::upsmgBatteryReplacement.0 = INTEGER: no(2)
# MG-SNMP-UPS-MIB::upsmgBatteryLowBattery.0 = INTEGER: no(2)
# MG-SNMP-UPS-MIB::upsmgBatteryChargerFault.0 = INTEGER: no(2)
# MG-SNMP-UPS-MIB::upsmgBatteryLowCondition.0 = INTEGER: no(2)
# MG-SNMP-UPS-MIB::upsmgOutputOnBattery.0 = INTEGER: no(2)
# MG-SNMP-UPS-MIB::upsmgOutputOnByPass.0 = INTEGER: no(2)
# MG-SNMP-UPS-MIB::upsmgOutputUtilityOff.0 = INTEGER: no(2)
# MG-SNMP-UPS-MIB::upsmgOutputOverLoad.0 = INTEGER: no(2)
# MG-SNMP-UPS-MIB::upsmgAgentCommUPS.0 = INTEGER: 1
# apc: unknown # apc: unknown
+1 -1
View File
@@ -312,7 +312,7 @@ $config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "zyxel"; $config['os'][$os]['icon'] = "zyxel";
$os = "ies"; $os = "ies";
$config['os'][$os]['text'] = "ZyXEL IES DSLAM"; $config['os'][$os]['text'] = "ZyXEL DSLAM";
$config['os'][$os]['type'] = "network"; $config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "zyxel"; $config['os'][$os]['icon'] = "zyxel";