mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Initial IPMI type detect version
This commit is contained in:
@@ -655,4 +655,10 @@ $config['callback_clear'] = 'https://stats.libren
|
|||||||
// Stat graphs
|
// Stat graphs
|
||||||
$config['alert_graph_date_format'] = '%Y-%m-%d %H:%i';
|
$config['alert_graph_date_format'] = '%Y-%m-%d %H:%i';
|
||||||
|
|
||||||
|
// IPMI type
|
||||||
|
$config['ipmi']['type'][] = "lanplus";
|
||||||
|
$config['ipmi']['type'][] = "lan";
|
||||||
|
$config['ipmi']['type'][] = "imb";
|
||||||
|
$config['ipmi']['type'][] = "open";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -13,7 +13,14 @@ if ($ipmi['host'] = get_dev_attrib($device,'ipmi_hostname'))
|
|||||||
$remote = " -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'];
|
$remote = " -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = external_exec($config['ipmitool'] . $remote . " sensor 2>/dev/null|sort");
|
foreach ($config['ipmi']['type'] as $ipmi_type) {
|
||||||
|
$results = external_exec($config['ipmitool'] . " -I $ipmi_type". $remote . " sensor 2>/dev/null|sort");
|
||||||
|
if ($results != "")
|
||||||
|
{
|
||||||
|
set_dev_attrib($device, 'ipmi_type', $ipmi_type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ if ($ipmi['host'] = get_dev_attrib($device,'ipmi_hostname'))
|
|||||||
{
|
{
|
||||||
$ipmi['user'] = get_dev_attrib($device,'ipmi_username');
|
$ipmi['user'] = get_dev_attrib($device,'ipmi_username');
|
||||||
$ipmi['password'] = get_dev_attrib($device,'ipmi_password');
|
$ipmi['password'] = get_dev_attrib($device,'ipmi_password');
|
||||||
|
$ipmi['type'] = get_dev_attrib($device,'ipmi_type');
|
||||||
echo("Fetching IPMI sensor data...");
|
echo("Fetching IPMI sensor data...");
|
||||||
|
|
||||||
if ($config['own_hostname'] != $device['hostname'] || $ipmi['host'] != 'localhost')
|
if ($config['own_hostname'] != $device['hostname'] || $ipmi['host'] != 'localhost')
|
||||||
@@ -14,7 +14,7 @@ if ($ipmi['host'] = get_dev_attrib($device,'ipmi_hostname'))
|
|||||||
$remote = " -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'];
|
$remote = " -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = external_exec($config['ipmitool'] . " -c " . $remote . " sdr 2>/dev/null");
|
$results = external_exec($config['ipmitool'] . " -I ".$ipmi['type']." -c " . $remote . " sdr 2>/dev/null");
|
||||||
echo(" done.\n");
|
echo(" done.\n");
|
||||||
|
|
||||||
foreach (explode("\n",$results) as $row)
|
foreach (explode("\n",$results) as $row)
|
||||||
|
|||||||
Reference in New Issue
Block a user