Initial IPMI type detect version

This commit is contained in:
Rudy Hardeman
2015-05-13 08:33:48 +02:00
parent cfee101767
commit 41ad518c25
3 changed files with 16 additions and 3 deletions

View File

@@ -655,4 +655,10 @@ $config['callback_clear'] = 'https://stats.libren
// Stat graphs
$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";
?>

View File

@@ -13,7 +13,14 @@ if ($ipmi['host'] = get_dev_attrib($device,'ipmi_hostname'))
$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;

View File

@@ -6,7 +6,7 @@ if ($ipmi['host'] = get_dev_attrib($device,'ipmi_hostname'))
{
$ipmi['user'] = get_dev_attrib($device,'ipmi_username');
$ipmi['password'] = get_dev_attrib($device,'ipmi_password');
$ipmi['type'] = get_dev_attrib($device,'ipmi_type');
echo("Fetching IPMI sensor data...");
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'];
}
$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");
foreach (explode("\n",$results) as $row)