Minor fixes, some cleanups, and standardising on echo("x") instead of echo "x"

git-svn-id: http://www.observium.org/svn/observer/trunk@1728 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-11-20 14:04:07 +00:00
parent 0cd548f0f2
commit 30bdd952ee
63 changed files with 199 additions and 283 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ if ($device['os'] == "apc")
{
$descr = "Output";
}
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current));
}
}
@@ -60,7 +60,7 @@ if ($device['os'] == "apc")
$warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC!
$descr = "Output Feed";
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current));
}
}
@@ -2,37 +2,36 @@
global $valid_sensor;
if ($device['os'] == "gamatronicups") {
if ($device['os'] == "gamatronicups")
{
for ($i = 1; $i <= 3; $i++)
{
$current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.4.1.1.3.$i";
$descr = "Input Phase $i";
$current = snmp_get($device, $current_oid, "-Oqv");
$type = "gamatronicups";
$precision = 1;
$index = $i;
$lowlimit = 0;
$warnlimit = NULL;
$limit = NULL;
for($i = 1; $i <= 3 ;$i++) {
$current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.4.1.1.3.$i";
$descr = "Input Phase $i";
$current = snmp_get($device, $current_oid, "-Oqv");
$type = "gamatronicups";
$precision = 1;
$index = $i;
$lowlimit = 0;
$warnlimit = NULL;
$limit = NULL;
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current));
}
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current);
}
for($i = 1; $i <= 3 ;$i++) {
$current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.5.1.1.3.$i";
$descr = "Output Phase $i";
$current = snmp_get($device, $current_oid, "-Oqv");
$type = "gamatronicups";
$precision = 1;
$index = 100+$i;
$lowlimit = 0;
$warnlimit = NULL;
$limit = NULL;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current);
}
for ($i = 1; $i <= 3; $i++)
{
$current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.5.1.1.3.$i";
$descr = "Output Phase $i";
$current = snmp_get($device, $current_oid, "-Oqv");
$type = "gamatronicups";
$precision = 1;
$index = 100+$i;
$lowlimit = 0;
$warnlimit = NULL;
$limit = NULL;
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, NULL, NULL, NULL, $current));
}
}
?>
+2 -2
View File
@@ -40,7 +40,7 @@ if ($device['os'] == "ipoman")
$descr = (trim($ipoman_array['in'][$index]['inletConfigDesc'],'"') != '' ? trim($ipoman_array['in'][$index]['inletConfigDesc'],'"') : "Inlet $index");
$current = $entry['inletStatusCurrent'] / $divisor;
$high_limit = $entry['inletConfigCurrentHigh'];
echo discover_sensor($valid_sensor, 'current', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current);
echo(discover_sensor($valid_sensor, 'current', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current));
# FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
}
}
@@ -54,7 +54,7 @@ if ($device['os'] == "ipoman")
$descr = (trim($ipoman_array['out'][$index]['outletConfigDesc'],'"') != '' ? trim($ipoman_array['out'][$index]['outletConfigDesc'],'"') : "Output $index");
$current = $entry['outletStatusCurrent'] / $divisor;
$high_limit = $entry['outletConfigCurrentHigh'];
echo discover_sensor($valid_sensor, 'current', $device, $cur_oid, '2.3.1.3.'.$index, $type, $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current);
echo(discover_sensor($valid_sensor, 'current', $device, $cur_oid, '2.3.1.3.'.$index, $type, $descr, $divisor, '1', NULL, NULL, NULL, $high_limit, $current));
}
}
}
+2 -2
View File
@@ -28,7 +28,7 @@ if ($device['os'] == "mgeups")
$lowlimit = 0;
$limit = NULL;
$lowwarnlimit = NULL;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current));
}
$oids = trim(snmp_walk($device, "1.3.6.1.4.1.705.1.6.1", "-OsqnU"));
@@ -53,7 +53,7 @@ if ($device['os'] == "mgeups")
$lowlimit = 0;
$limit = NULL;
$lowwarnlimit = NULL;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current));
}
}
?>
+4 -4
View File
@@ -24,7 +24,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1));
$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);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '10', '1', NULL, NULL, NULL, NULL, $current));
}
}
@@ -39,7 +39,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
$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);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
}
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.3.2.0", "-OsqnU"));
@@ -53,7 +53,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
$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);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
}
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.5.2.0", "-OsqnU"));
@@ -67,7 +67,7 @@ if ($device['os'] == "netmanplus" || $device['os'] == "deltaups")
$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);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, '1', '1', NULL, NULL, NULL, NULL, $current));
}
}
+3 -3
View File
@@ -24,7 +24,7 @@ if ($device['os'] == "powerware")
$descr = "Battery" . (count(explode("\n",$oids)) == 1 ? '' : ' ' . ($current_id+1));
$type = "xups";
$index = "1.2.3.".$current_id;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
}
}
@@ -39,7 +39,7 @@ if ($device['os'] == "powerware")
$type = "xups";
$divisor = 1;
$index = "4.4.1.3.".$i;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
}
$oids = trim(snmp_walk($device, "xupsInputCurrent", "-OsqnU", "XUPS-MIB"));
@@ -53,7 +53,7 @@ if ($device['os'] == "powerware")
$type = "xups";
$divisor = 1;
$index = "3.4.1.3.".$i;
echo discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current);
echo(discover_sensor($valid_sensor, 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
}
}