make ipmitool path configurable

git-svn-id: http://www.observium.org/svn/observer/trunk@1768 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-12-20 21:20:47 +00:00
parent 730d8405bd
commit 0a24da6945
4 changed files with 4 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ $config['ping'] = "/bin/ping";
$config['mtr'] = "/usr/bin/mtr";
$config['nmap'] = "/usr/bin/nmap";
$config['nagios_plugins'] = "/usr/lib/nagios/plugins";
$config['ipmitool'] = "/usr/bin/ipmitool";
### RRDCacheD - Make sure it can write to your RRD dir!

View File

@@ -10,7 +10,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');
$results = shell_exec("ipmitool -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'] . " sensor|sort");
$results = shell_exec($config['ipmitool'] . " -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'] . " sensor|sort");
foreach (explode("\n",$results) as $sensor)
{

View File

@@ -473,6 +473,7 @@ function createHost ($host, $community, $snmpver, $port = 161)
if (mysql_affected_rows())
{
$device_id = mysql_result(mysql_query("SELECT device_id FROM devices WHERE hostname = '$host'"),0);
# vv FIXME set_dev_attrib()
mysql_query("INSERT INTO devices_attribs (attrib_type, attrib_value, device_id) VALUES ('discover','1','$device_id')");
return("Created host : $host (id:$device_id) (os:$host_os)");
}

View File

@@ -9,7 +9,7 @@ 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("ipmitool -c -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'] . " sdr");
$results = shell_exec($config['ipmitool'] . " -c -H " . $ipmi['host'] . " -U " . $ipmi['user'] . " -P " . $ipmi['password'] . " sdr");
echo(" done.\n");
foreach (explode("\n",$results) as $row)