Merge pull request #988 from NURDspace/issue-985

IPMI Detection/Discovery
This commit is contained in:
Neil Lathwood
2015-05-13 15:19:01 +01:00
4 changed files with 29 additions and 4 deletions

View File

@@ -430,6 +430,17 @@ $config['update'] = 1;
```
By default, LibreNMS will auto update itself every 24 hours. You can stop this from happening by setting `update` to 0.
#### IPMI
Setup the types of IPMI protocols to test a host for and it what order.
```php
$config['ipmi']['type'] = array();
$config['ipmi']['type'][] = "lanplus";
$config['ipmi']['type'][] = "lan";
$config['ipmi']['type'][] = "imb";
$config['ipmi']['type'][] = "open";
```
#### Distributed poller settings
Please see [Distributed Poller](http://docs.librenms.org/Extensions/Distributed-Poller/) section of the docs for setup and configuration options.
Please see [Distributed Poller](http://docs.librenms.org/Extensions/Distributed-Poller/) section of the docs for setup and configuration options.

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,15 @@ 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;
}
}
echo $ipmi_type;
$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)