2010-12-15 17:54:42 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
## IPMI
|
|
|
|
if ($ipmi['host'] = get_dev_attrib($device,'ipmi_hostname'))
|
|
|
|
{
|
|
|
|
echo("IPMI : ");
|
|
|
|
|
|
|
|
$ipmi['user'] = get_dev_attrib($device,'ipmi_username');
|
|
|
|
$ipmi['password'] = get_dev_attrib($device,'ipmi_password');
|
2011-03-16 17:53:20 +00:00
|
|
|
|
2011-10-13 16:16:24 +00:00
|
|
|
if ($config['own_hostname'] != $device['hostname'] || $ipmi['host'] != 'localhost')
|
|
|
|
{
|
|
|
|
$remote = " -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$results = external_exec($config['ipmitool'] . $remote . " sensor 2>/dev/null|sort");
|
2011-03-16 17:53:20 +00:00
|
|
|
|
2010-12-26 21:36:22 +00:00
|
|
|
$index = 0;
|
2010-12-15 17:54:42 +00:00
|
|
|
|
|
|
|
foreach (explode("\n",$results) as $sensor)
|
|
|
|
{
|
2011-03-16 17:53:20 +00:00
|
|
|
# BB +1.1V IOH | 1.089 | Volts | ok | na | 1.027 | 1.054 | 1.146 | 1.177 | na
|
2010-12-15 17:54:42 +00:00
|
|
|
list($desc,$current,$unit,$state,$low_nonrecoverable,$low_limit,$low_warn,$high_warn,$high_limit,$high_nonrecoverable) = explode('|',$sensor);
|
2010-12-20 12:26:26 +00:00
|
|
|
$index++;
|
2011-05-09 08:18:30 +00:00
|
|
|
if (trim($current) != "na" && $config['ipmi_unit'][trim($unit)])
|
2010-12-15 17:54:42 +00:00
|
|
|
{
|
2011-05-09 08:18:30 +00:00
|
|
|
discover_sensor($valid['sensor'], $config['ipmi_unit'][trim($unit)], $device, trim($desc), $index, 'ipmi', trim($desc), '1', '1',
|
2010-12-15 17:54:42 +00:00
|
|
|
(trim($low_limit) == 'na' ? NULL : trim($low_limit)), (trim($low_warn) == 'na' ? NULL : trim($low_warn)),
|
|
|
|
(trim($high_warn) == 'na' ? NULL : trim($high_warn)), (trim($high_limit) == 'na' ? NULL : trim($high_limit)),
|
|
|
|
$current, 'ipmi');
|
|
|
|
}
|
|
|
|
}
|
2011-03-16 17:53:20 +00:00
|
|
|
|
2010-12-15 17:54:42 +00:00
|
|
|
echo("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|