call ipmitool locally when polling the observium host itself, solves some issues with a shared IPMI on the observium host box NIC

git-svn-id: http://www.observium.org/svn/observer/trunk@2685 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-10-13 16:16:24 +00:00
parent dccb561725
commit 0417fe1948
2 changed files with 13 additions and 2 deletions

View File

@@ -8,7 +8,12 @@ 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');
$results = shell_exec($config['ipmitool'] . " -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'] . " sensor|sort");
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");
$index = 0;

View File

@@ -8,7 +8,13 @@ if ($ipmi['host'] = get_dev_attrib($device,'ipmi_hostname'))
$ipmi['password'] = get_dev_attrib($device,'ipmi_password');
echo("Fetching IPMI sensor data...");
$results = shell_exec($config['ipmitool'] . " -c -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'] . " sdr");
if ($config['own_hostname'] != $device['hostname'] || $ipmi['host'] != 'localhost')
{
$remote = " -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'];
}
$results = external_exec($config['ipmitool'] . " -c " . $remote . " sdr 2>/dev/null");
echo(" done.\n");
foreach (explode("\n",$results) as $row)