mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
some sensor unification, rename sensor rrds and rename the DS, add testing IPMI support (no web-part yet) - tested against Intel RMM3 and working. some further cleanups as well.
git-svn-id: http://www.observium.org/svn/observer/trunk@1758 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
31
includes/discovery/ipmi.inc.php
Normal file
31
includes/discovery/ipmi.inc.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
global $valid_sensor;
|
||||
|
||||
## 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');
|
||||
|
||||
$results = shell_exec("ipmitool -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'] . " sensor");
|
||||
|
||||
foreach (explode("\n",$results) as $sensor)
|
||||
{
|
||||
# BB +1.1V IOH | 1.089 | Volts | ok | na | 1.027 | 1.054 | 1.146 | 1.177 | na
|
||||
list($desc,$current,$unit,$state,$low_nonrecoverable,$low_limit,$low_warn,$high_warn,$high_limit,$high_nonrecoverable) = explode('|',$sensor);
|
||||
if (trim($current) != "na" && $ipmi_unit[trim($unit)])
|
||||
{
|
||||
discover_sensor($valid_sensor, $ipmi_unit[trim($unit)], $device, trim($desc), $index++, 'ipmi', trim($desc), '1', '1',
|
||||
(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');
|
||||
}
|
||||
}
|
||||
|
||||
echo("\n");
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user