mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added support for os in oxidized groups
This commit is contained in:
@@ -62,7 +62,7 @@ $config['oxidized']['reload_nodes'] = TRUE;
|
||||
|
||||
#### Using Groups
|
||||
|
||||
To return a group to Oxidized you can do this by matching a regex for either hostname or location. The order is hostname is matched first, if nothing is found then location is attempted.
|
||||
To return a group to Oxidized you can do this by matching a regex for either hostname, os or location. The order is hostname is matched first, if nothing is found then os is tried and then location is attempted.
|
||||
The first match found will be used. To match on the device hostnames that contain 'lon-sw' or if the location contains 'London' then you would place the following within config.php:
|
||||
|
||||
```php
|
||||
@@ -70,6 +70,12 @@ $config['oxidized']['group']['hostname'][] = array('regex' => '/^lon-sw/', 'grou
|
||||
$config['oxidized']['group']['location'][] = array('regex' => '/london/', 'group' => 'london-switches');
|
||||
```
|
||||
|
||||
To match on a device os of edgeos then please use the following:
|
||||
|
||||
```php
|
||||
$config['oxidized']['group']['os'][] = array('match' => 'edgeos', 'group' => 'wireless');
|
||||
```
|
||||
|
||||
If you need to, you can specify credentials for groups by using the following in your Oxidized config:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -953,6 +953,14 @@ function list_oxidized() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty($device['group'])) {
|
||||
foreach ($config['oxidized']['group']['os'] as $host_group) {
|
||||
if ($host_group['match'] === $device['os']) {
|
||||
$device['group'] = $host_group['group'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($device['group'])) {
|
||||
foreach ($config['oxidized']['group']['location'] as $host_group) {
|
||||
if (preg_match($host_group['regex'].'i', $device['location'])) {
|
||||
|
||||
Reference in New Issue
Block a user