apc and arista fixes from fenestro

git-svn-id: http://www.observium.org/svn/observer/trunk@1862 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-03-15 17:10:44 +00:00
parent 3181f3e0b8
commit b0ed81624c
2 changed files with 23 additions and 2 deletions

View File

@ -17,6 +17,27 @@ if ($device['os'] == "apc")
discover_sensor($valid_sensor, 'temperature', $device, $oid, $index, 'apc', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
}
# InRow Chiller.
# A silly check to find out if it's the right hardware.
$oids = snmp_get($device, "airIRRCGroupSetpointsCoolMetric.0", "-OsqnU", "PowerNet-MIB");
if ($oids)
{
echo("APC InRow Chiller ");
$temps = array();
$temps['airIRRCUnitStatusRackInletTempMetric'] = "Rack Inlet";
$temps['airIRRCUnitStatusSupplyAirTempMetric'] = "Supply Air";
$temps['airIRRCUnitStatusReturnAirTempMetric'] = "Return Air";
$temps['airIRRCUnitStatusEnteringFluidTemperatureMetric'] = "Entering Fluid";
$temps['airIRRCUnitStatusLeavingFluidTemperatureMetric'] = "Leaving Fluid";
foreach($temps as $obj => $descr)
{
$oids = snmp_get($device, $obj . ".0", "-OsqnU", "PowerNet-MIB");
list($oid,$current) = explode(' ',$oids);
$divisor = 10;
$sensorType = substr($descr, 0, 2);
echo(discover_sensor($valid_sensor, 'temperature', $device, $oid, '0', $sensorType, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current));
}
}
}
?>
?>

View File

@ -1,6 +1,6 @@
<?php
$version = preg_replace("/.+ version (.+) running on .+ (\S+)$/", "\||\\2", $sysDescr );
$version = preg_replace("/.+ version (.+) running on .+ (\S+)$/", "\\1||\\2", $sysDescr );
list($version,$hardware) = explode("||", $version);
?>