diff --git a/doc/Extensions/Oxidized.md b/doc/Extensions/Oxidized.md index 9123c2ed8..da00b7df9 100644 --- a/doc/Extensions/Oxidized.md +++ b/doc/Extensions/Oxidized.md @@ -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 diff --git a/html/includes/api_functions.inc.php b/html/includes/api_functions.inc.php index 8db6f28a4..83ad9b511 100644 --- a/html/includes/api_functions.inc.php +++ b/html/includes/api_functions.inc.php @@ -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'])) {