From 31897758e54c001f776e8aff4da2fed786be4fc3 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Fri, 12 Feb 2016 14:27:55 -0600 Subject: [PATCH] Restore $config['oxidized']['features']['versioning']. --- doc/Extensions/Oxidized.md | 3 +++ html/pages/device/showconfig.inc.php | 5 +++-- html/pages/settings/external.inc.php | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/Extensions/Oxidized.md b/doc/Extensions/Oxidized.md index 3d2bc3ade0..9123c2ed80 100644 --- a/doc/Extensions/Oxidized.md +++ b/doc/Extensions/Oxidized.md @@ -13,6 +13,9 @@ $config['oxidized']['url'] = 'http://127.0.0.1:8888'; ``` LibreNMS supports config versioning if Oxidized does. This is known to work with the git output module. +```php +$config['oxidized']['features']['versioning'] = true; +``` 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. 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': diff --git a/html/pages/device/showconfig.inc.php b/html/pages/device/showconfig.inc.php index c79c4aacbe..e704c50602 100644 --- a/html/pages/device/showconfig.inc.php +++ b/html/pages/device/showconfig.inc.php @@ -105,8 +105,9 @@ 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='.(isset($node_info['full_name']) ? $node_info['full_name'] : $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='.(isset($node_info['full_name']) ? $node_info['full_name'] : $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 0705a146e8..fe89d4645e 100644 --- a/html/pages/settings/external.inc.php +++ b/html/pages/settings/external.inc.php @@ -13,6 +13,10 @@ $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',