From aa9d4798dca58b48e066c0129eb9db517384e400 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Fri, 12 Feb 2016 10:23:49 -0600 Subject: [PATCH] Remove $config['oxidized']['features']['versioning']. I did not update the schema to remove the entry from the config table. Update the documentation a bit. Issue #2812 --- doc/Extensions/Oxidized.md | 14 +++++--------- html/pages/device/showconfig.inc.php | 5 ++--- html/pages/settings/external.inc.php | 4 ---- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/doc/Extensions/Oxidized.md b/doc/Extensions/Oxidized.md index e74bf5c3cd..3d2bc3ade0 100644 --- a/doc/Extensions/Oxidized.md +++ b/doc/Extensions/Oxidized.md @@ -12,14 +12,10 @@ $config['oxidized']['enabled'] = TRUE; $config['oxidized']['url'] = 'http://127.0.0.1:8888'; ``` -We also support config versioning within Oxidized, this will allow you to see the old configs stored. - -```php -$config['oxidized']['features']['versioning'] = true; -``` +LibreNMS supports config versioning if Oxidized does. This is known to work with the git output module. Oxidized supports various ways to utilise credentials to login to devices, you can specify global username/password within Oxidized, Group level username/password or per device. -We currently support sending groups back to Oxidized so that you can then define group credentials within Oxidized. To enable this support please switch on 'Enable the return of groups to Oxidized': +LibreNMS currently supports sending groups back to Oxidized so that you can then define group credentials within Oxidized. To enable this support please switch on 'Enable the return of groups to Oxidized': ```php $config['oxidized']['group_support'] = true; @@ -35,7 +31,7 @@ $config['oxidized']['default_group'] = 'default'; Oxidized has support for feeding devices into it via an API call, support for Oxidized has been added to the LibreNMS API. A sample config for Oxidized is provided below. -You will need to configure default credentials for your devices, LibreNMS doesn't provide login credentials at this time. +You will need to configure default credentials for your devices in the Oxidized config, LibreNMS doesn't provide login credentials at this time. ```bash source: @@ -61,7 +57,7 @@ $config['oxidized']['reload_nodes'] = TRUE; ``` -### Using Groups +#### 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. 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: @@ -80,7 +76,7 @@ groups: password: ``` -### Miscellaneous +#### Miscellaneous If you have devices which you do not wish to appear in Oxidized then you can edit those devices in Device -> Edit -> Misc and enable "Exclude from Oxidized?" diff --git a/html/pages/device/showconfig.inc.php b/html/pages/device/showconfig.inc.php index 3ee08d6039..2efa9cfeed 100644 --- a/html/pages/device/showconfig.inc.php +++ b/html/pages/device/showconfig.inc.php @@ -103,11 +103,10 @@ if (is_admin()) { } } else if ($config['oxidized']['enabled'] === true && isset($config['oxidized']['url'])) { + // fetch info about the node and then a list of versions for that node $node_info = json_decode(file_get_contents($config['oxidized']['url'].'/node/show/'.$device['hostname'].'?format=json'), true); + $config_versions = json_decode(file_get_contents($config['oxidized']['url'].'/node/version?node_full='.(!empty($node_info['group']) ? $node_info['group'].'/' : '').$device['hostname'].'&format=json'), true); - if ($config['oxidized']['features']['versioning'] === true) { // fetch a list of versions - $config_versions = json_decode(file_get_contents($config['oxidized']['url'].'/node/version?node_full='.(!empty($node_info['group']) ? $node_info['group'].'/' : '').$device['hostname'].'&format=json'), true); - } if (is_array($config_versions)) { $config_total = count($config_versions); } diff --git a/html/pages/settings/external.inc.php b/html/pages/settings/external.inc.php index fe89d4645e..0705a146e8 100644 --- a/html/pages/settings/external.inc.php +++ b/html/pages/settings/external.inc.php @@ -13,10 +13,6 @@ $oxidized_conf = array( 'descr' => 'URL to your Oxidized API', 'type' => 'text', ), - array('name' => 'oxidized.features.versioning', - 'descr' => 'Enable config versioning access', - 'type' => 'checkbox', - ), array('name' => 'oxidized.group_support', 'descr' => 'Enable the return of groups to Oxidized', 'type' => 'checkbox',