From e1559940eed40096bce292f626bac482d27c55c9 Mon Sep 17 00:00:00 2001 From: ldep30 Date: Fri, 10 Jun 2016 16:06:33 +0200 Subject: Update rest_client.rb to support 'rest' parameter --- extra/rest_client.rb | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/extra/rest_client.rb b/extra/rest_client.rb index a16bd42..5809457 100644 --- a/extra/rest_client.rb +++ b/extra/rest_client.rb @@ -2,8 +2,32 @@ module Oxidized class RestClient require 'net/http' require 'json' - HOST = 'localhost' - PORT = 8888 + require 'uri' + require 'asetus' + + class Config + Root = File.join ENV['HOME'], '.config', 'oxidized' + end + + CFGS = Asetus.new :name=>'oxidized', :load=>false, :key_to_s=>true + CFGS.default.rest = '127.0.0.1:8888' + + begin + CFGS.load + rescue => error + raise InvalidConfig, "Error loading config: #{error.message}" + ensure + CFG = CFGS.cfg + end + + restcfg = CFG.rest + if ! restcfg.match(/^http:\/\//) + restcfg.insert(0, 'http://') + end + + HOST = URI(restcfg).host + PORT = URI(restcfg).port + PATH = URI(restcfg).path class << self def next opt={}, host=HOST, port=PORT @@ -18,7 +42,7 @@ module Oxidized def next opt data = JSON.dump opt - @web.put '/node/next/' + opt[:name].to_s, data + @web.put PATH + '/node/next/' + opt[:name].to_s, data end end -- cgit v1.2.1 From 47d2026800eb6f724626638609aa8cdaa05998b9 Mon Sep 17 00:00:00 2001 From: ldep30 Date: Wed, 15 Jun 2016 19:28:47 +0200 Subject: Update rest_client.rb --- extra/rest_client.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/rest_client.rb b/extra/rest_client.rb index 5809457..90a64e4 100644 --- a/extra/rest_client.rb +++ b/extra/rest_client.rb @@ -6,7 +6,7 @@ module Oxidized require 'asetus' class Config - Root = File.join ENV['HOME'], '.config', 'oxidized' + Root = Root = ENV['OXIDIZED_HOME'] || File.join(ENV['HOME'], '.config', 'oxidized') end CFGS = Asetus.new :name=>'oxidized', :load=>false, :key_to_s=>true @@ -21,7 +21,7 @@ module Oxidized end restcfg = CFG.rest - if ! restcfg.match(/^http:\/\//) + unless restcfg.match(/^http:\/\//) restcfg.insert(0, 'http://') end -- cgit v1.2.1 From b5011707b9193ec4ecd4c4ee8df903b7becc1a6b Mon Sep 17 00:00:00 2001 From: ldep30 Date: Wed, 15 Jun 2016 20:21:51 +0200 Subject: Update rest_client.rb --- extra/rest_client.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extra/rest_client.rb b/extra/rest_client.rb index 90a64e4..35d93ae 100644 --- a/extra/rest_client.rb +++ b/extra/rest_client.rb @@ -16,11 +16,9 @@ module Oxidized CFGS.load rescue => error raise InvalidConfig, "Error loading config: #{error.message}" - ensure - CFG = CFGS.cfg end - restcfg = CFG.rest + restcfg = CFGS.cfg.rest unless restcfg.match(/^http:\/\//) restcfg.insert(0, 'http://') end -- cgit v1.2.1 From 30c847235fed631a1a82291a39be57152722a875 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Thu, 28 Jul 2016 10:37:00 +0300 Subject: bump version --- CHANGELOG.md | 4 ++++ lib/oxidized/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e7b220..c193dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.16.2 +- BUGFIX: when not using git (by @danilopopeye) +- BUGFIX: screenos update + # 0.16.1 - BUGFIX: unnecessary puts statement removed from git.rb diff --git a/lib/oxidized/version.rb b/lib/oxidized/version.rb index 40996a8..023f184 100644 --- a/lib/oxidized/version.rb +++ b/lib/oxidized/version.rb @@ -1,3 +1,3 @@ module Oxidized - VERSION = '0.16.1' + VERSION = '0.16.2' end -- cgit v1.2.1 From ed7c5574a197605658dfc5c8d5563d55e483eef3 Mon Sep 17 00:00:00 2001 From: Arnoud Vermeer Date: Mon, 22 Aug 2016 15:22:30 +0200 Subject: Remove secrets from A10 config and 'show running-config' doesn't have 'all-partitions' in 64-bit Advanced Core OS (ACOS) version 4.1.0-P4, build 12 (Jul-22-2016,15:49) --- lib/oxidized/model/acos.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/oxidized/model/acos.rb b/lib/oxidized/model/acos.rb index bb9846e..f4d4464 100644 --- a/lib/oxidized/model/acos.rb +++ b/lib/oxidized/model/acos.rb @@ -6,6 +6,13 @@ class ACOS < Oxidized::Model ##ACOS prompt changes depending on the state of the device prompt /^([-\w.\/:?\[\]\(\)]+[#>]\s?)$/ + cmd :secret do |cfg| + cfg.gsub!(/community read encrypted (\S+)/, 'community read encrypted ') # snmp + cfg.gsub!(/secret encrypted (\S+)/, 'secret encrypted ') # tacacs-server + cfg.gsub!(/password encrypted (\S+)/, 'password encrypted ') # user + cfg + end + cmd 'show version' do |cfg| cfg.gsub! /\s(Last configuration saved at).*/, ' \\1 ' cfg.gsub! /\s(Memory).*/, ' \\1 ' @@ -22,7 +29,7 @@ class ACOS < Oxidized::Model comment cfg end - cmd 'show running-config all-partitions' do |cfg| + cmd 'show running-config' do |cfg| cfg.gsub! /(Current configuration).*/, '\\1 ' cfg.gsub! /(Configuration last updated at).*/, '\\1 ' cfg.gsub! /(Configuration last saved at).*/, '\\1 ' -- cgit v1.2.1 From 2c4ac17756320fa4abba2eee9ad32badb15043c7 Mon Sep 17 00:00:00 2001 From: Arnoud Vermeer Date: Mon, 22 Aug 2016 15:23:59 +0200 Subject: Cisco Adaptive Security Appliance Software Version 9.4(2)6 reports TACACS config like this: aaa-server tacacs (OUTSIDE) host 192.168.1.1 key assadasda Updated the regex to be backward compatible. --- lib/oxidized/model/asa.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oxidized/model/asa.rb b/lib/oxidized/model/asa.rb index a41348e..df30059 100644 --- a/lib/oxidized/model/asa.rb +++ b/lib/oxidized/model/asa.rb @@ -15,7 +15,7 @@ class ASA < Oxidized::Model cfg.gsub! /username (\S+) password (\S+) (.*)/, 'username \1 password