mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 08:01:38 +02:00
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:
@@ -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";
|
||||||
|
|||||||
@@ -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"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -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"; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
@@ -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"),'" ');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user