more reformat and optimization

git-svn-id: http://www.observium.org/svn/observer/trunk@1837 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-15 09:57:13 +00:00
parent 3a4e92e246
commit 0236f7aff8
44 changed files with 235 additions and 196 deletions
@@ -7,8 +7,8 @@ if ($device['os'] == "ipoman")
{
echo(" IPOMANII-MIB ");
if(!is_array($cache['ipoman']))
{
if (!is_array($cache['ipoman']))
{
echo("outletConfigDesc ");
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, "outletConfigDesc", $cache['ipoman']['out'], "IPOMANII-MIB");
echo("outletConfigLocation ");
@@ -26,9 +26,9 @@ if ($device['os'] == "ipoman")
echo("inletStatusFrequency ");
$oids = snmpwalk_cache_multi_oid($device, "inletStatusFrequency", $oids, "IPOMANII-MIB");
if(is_array($oids))
if (is_array($oids))
{
foreach($oids as $index => $entry)
foreach ($oids as $index => $entry)
{
$freq_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.4.' . $index;
$divisor = 10;
@@ -36,9 +36,10 @@ if ($device['os'] == "ipoman")
$current = $entry['inletStatusFrequency'] / 10;
$low_limit = $entry['inletConfigFrequencyLow'];
$high_limit = $entry['inletConfigFrequencyHigh'];
echo(discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current));
discover_sensor($valid_sensor, 'freq', $device, $freq_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, NULL, NULL, $high_limit, $current);
# FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
}
}
}
?>