Delta UPS support, also by generalising rfc1628 support; recognize some more hardware

git-svn-id: http://www.observium.org/svn/observer/trunk@1562 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-07-30 22:25:07 +00:00
parent 3d49459420
commit d3d2ef5f67
13 changed files with 1721 additions and 2905 deletions
+6 -6
View File
@@ -120,9 +120,9 @@ if ($device['os'] == "mgeups")
}
## Riello UPS
if ($device['os'] == "netmanplus")
if ($device['os'] == "netmanplus" || $device['os'] == 'deltaups')
{
echo("NetMan Plus ");
echo("RFC1628 ");
$oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.6", "-Osqn", "UPS-MIB");
if ($debug) { echo($oids."\n"); }
@@ -139,7 +139,7 @@ if ($device['os'] == "netmanplus")
$precision = 10;
$current = snmp_get($device, $current_oid, "-O vq") / $precision;
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1));
$type = "netmanplus";
$type = "rfc1628";
$index = 500+$current_id;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', NULL, NULL, NULL, NULL, $current);
}
@@ -153,7 +153,7 @@ if ($device['os'] == "netmanplus")
$current_oid = ".1.3.6.1.2.1.33.1.4.4.1.3.$i";
$descr = "Output"; if ($numPhase > 1) $descr .= " Phase $i";
$current = snmp_get($device, $current_oid, "-Oqv");
$type = "netmanplus";
$type = "rfc1628";
$precision = 1;
$index = $i;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
@@ -167,7 +167,7 @@ if ($device['os'] == "netmanplus")
$current_oid = "1.3.6.1.2.1.33.1.3.3.1.4.$i";
$descr = "Input"; if ($numPhase > 1) $descr .= " Phase $i";
$current = snmp_get($device, $current_oid, "-Oqv");
$type = "netmanplus";
$type = "rfc1628";
$precision = 1;
$index = 100+$i;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
@@ -181,7 +181,7 @@ if ($device['os'] == "netmanplus")
$current_oid = "1.3.6.1.2.1.33.1.5.3.1.3.$i";
$descr = "Bypass"; if ($numPhase > 1) $descr .= " Phase $i";
$current = snmp_get($device, $current_oid, "-Oqv");
$type = "netmanplus";
$type = "rfc1628";
$precision = 1;
$index = 200+$i;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
+6 -6
View File
@@ -45,10 +45,10 @@ if ($device['os'] == "mgeups")
}
}
## Riello UPS
if ($device['os'] == "netmanplus")
## RFC1628
if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
{
echo("NetMan Plus ");
echo("RFC1628 ");
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.3.2.0", "-OsqnU"));
if ($debug) { echo($oids."\n"); }
@@ -58,7 +58,7 @@ if ($device['os'] == "netmanplus")
$freq_oid = "1.3.6.1.2.1.33.1.3.3.1.2.$i";
$descr = "Input"; if ($numPhase > 1) $descr .= " Phase $i";
$current = snmp_get($device, $freq_oid, "-Oqv") / 10;
$type = "netmanplus";
$type = "rfc1628";
$divisor = 10;
$index = '3.2.0.'.$i;
echo discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
@@ -67,7 +67,7 @@ if ($device['os'] == "netmanplus")
$freq_oid = "1.3.6.1.2.1.33.1.4.2.0";
$descr = "Output";
$current = snmp_get($device, $freq_oid, "-Oqv") / 10;
$type = "netmanplus";
$type = "rfc1628";
$divisor = 10;
$index = '4.2.0';
echo discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
@@ -75,7 +75,7 @@ if ($device['os'] == "netmanplus")
$freq_oid = "1.3.6.1.2.1.33.1.5.1.0";
$descr = "Bypass";
$current = snmp_get($device, $freq_oid, "-Oqv") / 10;
$type = "netmanplus";
$type = "rfc1628";
$divisor = 10;
$index = '5.1.0';
echo discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
@@ -2,12 +2,14 @@
echo("IP Addresses : ");
# FIXME function!
$oids = shell_exec($config['snmpwalk'] . " -M " . $config['mibdir'] . " -m IP-MIB -".$device['snmpver']." -Osq -c ".$device['community']." ".$device['hostname'].":".$device['port']." ipAdEntIfIndex");
$oids = trim($oids);
$oids = str_replace("ipAdEntIfIndex.", "", $oids);
foreach(explode("\n", $oids) as $data) {
$data = trim($data);
list($oid,$ifIndex) = explode(" ", $data);
# FIXME function!
$mask = shell_exec($config['snmpget']. " -M " . $config['mibdir'] ." -m IP-MIB -O qv -".$device['snmpver']." -c ".$device['community']." ".$device['hostname'].":".$device['port']." ipAdEntNetMask.$oid");
$mask = trim($mask);
$network = trim(shell_exec ($config['ipcalc'] . " $oid/$mask | grep Network | cut -d\" \" -f 4"));
+8
View File
@@ -0,0 +1,8 @@
<?php
if(!$os)
{
if (strstr($sysObjectId, ".1.3.6.1.4.1.2254.2.4")) { $os = "deltaups"; }
}
?>
+1
View File
@@ -4,6 +4,7 @@ if(!$os) {
if(strstr($sysDescr, "JETDIRECT")) { $os = "jetdirect"; }
else if(strstr($sysDescr, "HP ETHERNET MULTI-ENVIRONMENT")) { $os = "jetdirect"; }
else if(strstr($sysObjectId, ".1.3.6.1.4.1.11.1")) { $os = "jetdirect"; }
}
+2
View File
@@ -6,6 +6,8 @@ if(!$os)
{
if(strstr($sysObjectId, ".1.3.6.1.4.1.901.1")) { $os = "wxgoos"; }
}
if (strstr($sysObjectId, ".1.3.6.1.4.1.17373")) { $os = "wxgoos"; }
}
?>
@@ -2,12 +2,12 @@
global $valid_sensor;
if($device['os'] == "netmanplus")
if($device['os'] == "netmanplus" || $device['os'] == 'deltaups')
{
$oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.7", "-Osqn", "UPS-MIB");
if ($debug) { echo($oids."\n"); }
$oids = trim($oids);
if ($oids) echo("NetMan Plus Battery Temperature ");
if ($oids) echo("RFC1628 Battery Temperature ");
foreach(explode("\n", $oids) as $data)
{
$data = trim($data);
@@ -19,7 +19,7 @@ if($device['os'] == "netmanplus")
$temperature_oid = "1.3.6.1.2.1.33.1.2.7.$temperature_id";
$temperature = snmp_get($device, $temperature_oid, "-Ovq");
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($temperature_id+1));
discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $temperature_id, 'netmanplus', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature);
discover_sensor($valid_sensor, 'temperature', $device, $temperature_oid, $temperature_id, 'rfc1628', $descr, '1', '1', NULL, NULL, NULL, NULL, $temperature);
}
}
}
+23 -23
View File
@@ -205,10 +205,10 @@ if ($device['os'] == "mgeups")
}
}
## Riello UPS Voltages
if ($device['os'] == "netmanplus")
## RFC1628 UPS Voltages
if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
{
echo("NetMan Plus ");
echo("RFC1628 ");
$oids = snmp_walk($device, "1.3.6.1.2.1.33.1.2.5", "-Osqn", "UPS-MIB");
if ($debug) { echo($oids."\n"); }
@@ -226,8 +226,8 @@ if ($device['os'] == "netmanplus")
$volt = snmp_get($device, $volt_oid, "-O vq") / $divisor;
#$volt = trim(shell_exec($config['snmpget'] . " -O qv -$snmpver -c $community $hostname:$port $volt_oid")) / $divisor;
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($volt_id+1));
$type = "netmanplus";
$index = 500+$volt_id;
$type = "rfc1628";
$index = "1.2.5.".$volt_id;
echo discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $volt);
}
}
@@ -237,12 +237,12 @@ if ($device['os'] == "netmanplus")
list($unused,$numPhase) = explode(' ',$oids);
for($i = 1; $i <= $numPhase;$i++)
{
$volt_oid = ".1.3.6.1.2.1.33.1.4.4.1.2.$i";
$descr = "Output"; if ($numPhase > 1) $descr .= " Phase $i";
$current = snmp_get($device, $volt_oid, "-Oqv");
$type = "netmanplus";
$divisor = 1;
$index = $i;
$volt_oid = ".1.3.6.1.2.1.33.1.4.4.1.2.$i";
$descr = "Output"; if ($numPhase > 1) $descr .= " Phase $i";
$type = "rfc1628";
$divisor = 10; if ($device['os'] == "netmanplus") { $divisor = 1; };
$current = snmp_get($device, $volt_oid, "-Oqv") / $divisor;
$index = $i;
echo discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
}
@@ -251,12 +251,12 @@ if ($device['os'] == "netmanplus")
list($unused,$numPhase) = explode(' ',$oids);
for($i = 1; $i <= $numPhase;$i++)
{
$volt_oid = "1.3.6.1.2.1.33.1.3.3.1.3.$i";
$descr = "Input"; if ($numPhase > 1) $descr .= " Phase $i";
$current = snmp_get($device, $volt_oid, "-Oqv");
$type = "netmanplus";
$divisor = 1;
$index = 100+$i;
$volt_oid = "1.3.6.1.2.1.33.1.3.3.1.3.$i";
$descr = "Input"; if ($numPhase > 1) $descr .= " Phase $i";
$type = "rfc1628";
$divisor = 10; if ($device['os'] == "netmanplus") { $divisor = 1; };
$current = snmp_get($device, $volt_oid, "-Oqv") / $divisor;
$index = 100+$i;
echo discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
}
@@ -265,12 +265,12 @@ if ($device['os'] == "netmanplus")
list($unused,$numPhase) = explode(' ',$oids);
for($i = 1; $i <= $numPhase;$i++)
{
$volt_oid = "1.3.6.1.2.1.33.1.5.3.1.2.$i";
$descr = "Bypass"; if ($numPhase > 1) $descr .= " Phase $i";
$current = snmp_get($device, $volt_oid, "-Oqv");
$type = "netmanplus";
$divisor = 1;
$index = 200+$i;
$volt_oid = "1.3.6.1.2.1.33.1.5.3.1.2.$i";
$descr = "Bypass"; if ($numPhase > 1) $descr .= " Phase $i";
$type = "rfc1628";
$divisor = 10; if ($device['os'] == "netmanplus") { $divisor = 1; };
$current = snmp_get($device, $volt_oid, "-Oqv") / $divisor;
$index = 200+$i;
echo discover_sensor($valid_sensor, 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
}
}
-1
View File
@@ -14,7 +14,6 @@
if($data[1]['entPhysicalContainedIn'] == "0")
{
echo("woo");
if(isset($data[1]['entPhysicalSoftwareRev']) && $data[1]['entPhysicalSoftwareRev'] != "")
{
$version = $data[1]['entPhysicalSoftwareRev'];
+4
View File
@@ -252,6 +252,10 @@ $os = "gamatronicups";
$config['os'][$os]['text'] = "Gamatronic UPS Stack";
$config['os'][$os]['type'] = "power";
$os = "deltaups";
$config['os'][$os]['text'] = "Delta UPS";
$config['os'][$os]['type'] = "power";
$os = "airport";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['text'] = "Apple AirPort";