mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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!
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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)");
|
||||
}
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user