From a8b2b1fed85886e3706bf0985736eb4552ccf971 Mon Sep 17 00:00:00 2001 From: Keenan Tims Date: Mon, 31 Jul 2023 05:51:21 -0700 Subject: [PATCH 01/11] Allow dots & dashes in cumulus prompt username (#2870) * Allow dots & dashes in cumulus prompt username * Fix merge * Update changelog --- CHANGELOG.md | 1 + lib/oxidized/model/cumulus.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1b2c1231..052ae13d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - fixed netscaler backups with hostname set #2828 (@electrocret) - Do not redirect stderr when fetching opnsense version since default shell (csh) doesn't support it (@spike77453) - Fixed fan RPM speeds included in Aruba CX diffs (@danpoltawski) +- fixed prompt for Cumulus to allow usernames with dots and dashes (@ktims) ## [0.29.1 - 2023-04-24] diff --git a/lib/oxidized/model/cumulus.rb b/lib/oxidized/model/cumulus.rb index 4d342bb83..acb7c8a92 100644 --- a/lib/oxidized/model/cumulus.rb +++ b/lib/oxidized/model/cumulus.rb @@ -1,7 +1,7 @@ class Cumulus < Oxidized::Model using Refinements - prompt /^((\w*)@(.*)):/ + prompt /^(([\w.-]*)@(.*)):/ comment '# ' # add a comment in the final conf From c9d9156cc1e26787756cb677939fcb7df7b94372 Mon Sep 17 00:00:00 2001 From: Andrew Larin <126486096+avl-dev@users.noreply.github.com> Date: Mon, 31 Jul 2023 15:52:01 +0300 Subject: [PATCH 02/11] New model for Asterfusion Network Operating System (#2836) Co-authored-by: Andrey Larin --- CHANGELOG.md | 1 + docs/Supported-OS-Types.md | 2 ++ lib/oxidized/model/asternos.rb | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 lib/oxidized/model/asternos.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 052ae13d4..207d788e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## Added - model for D-Link cisco like CLI (@mirackle-spb) - model for Ruijie Networks RGOS devices (@spike77453) +- model for Asterfusion Network Operating System (@avl-dev) - pagination for http source (@davama) + Added ability to send mail with the Docker container diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 7b42248a2..2efff373c 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -32,6 +32,8 @@ * Aruba * [AOS-CX](/lib/oxidized/model/aoscx.rb) * [AOSW](/lib/oxidized/model/aosw.rb) +* Asterfusion + * [AsterNOS](/lib/oxidized/model/asternos.rb) * AudioCodes * [AudioCodes](/lib/oxdized/model/audiocodes.rb) * [MediaPack MP-1xx, Mediant1000](/lib/oxdized/model/audiocodesmp.rb) diff --git a/lib/oxidized/model/asternos.rb b/lib/oxidized/model/asternos.rb new file mode 100644 index 000000000..3775482d1 --- /dev/null +++ b/lib/oxidized/model/asternos.rb @@ -0,0 +1,23 @@ +class AsterNOS < Oxidized::Model + using Refinements + + prompt /^[^\$]+\$/ + comment '# ' + + cmd :all do |cfg| + cfg = cfg.each_line.to_a[1..-2].join + end + + cmd 'show version' do |cfg| + # @model = Regexp.last_match(1) if cfg =~ /^Model: (\S+)/ + comment cfg + end + + cmd "show runningconfiguration all" + + + cfg :ssh do + # exec true + pre_logout 'exit' + end +end From efa1cb5e0238b1ccc2fdb598b053d20e7afd45e1 Mon Sep 17 00:00:00 2001 From: Dave Bell <101636305+davesbell@users.noreply.github.com> Date: Mon, 31 Jul 2023 14:08:40 +0100 Subject: [PATCH 03/11] Remove constantly updating dates from Adtran config (#2840) * Remove constantly updating dates from Adtran config * Update CHANGELOG.md --- CHANGELOG.md | 2 +- lib/oxidized/model/adtran.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 207d788e7..323345847 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,9 +29,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - fixed netscaler backups with hostname set #2828 (@electrocret) - Do not redirect stderr when fetching opnsense version since default shell (csh) doesn't support it (@spike77453) - Fixed fan RPM speeds included in Aruba CX diffs (@danpoltawski) +- Remove constantly updating dates from backup of Adtran config (@davesbell) - fixed prompt for Cumulus to allow usernames with dots and dashes (@ktims) - ## [0.29.1 - 2023-04-24] ## Added diff --git a/lib/oxidized/model/adtran.rb b/lib/oxidized/model/adtran.rb index a42855500..90cd0c580 100644 --- a/lib/oxidized/model/adtran.rb +++ b/lib/oxidized/model/adtran.rb @@ -14,7 +14,11 @@ class Adtran < Oxidized::Model cfg end - cmd 'show running-config' + cmd 'show running-config' do |cfg| + # Strip out line at the top which displays the current date/time + # ! Created : Mon Jun 26 2023 10:07:07 + cfg.gsub! /! Createds+:.*\n/, '' + end cfg :ssh do if vars :enable From ebf1423918930e32925186449c5b698b448f91cb Mon Sep 17 00:00:00 2001 From: Janno Schouwenburg Date: Mon, 31 Jul 2023 15:08:59 +0200 Subject: [PATCH 04/11] Ericsson Minilink 6600 support (#2893) --- CHANGELOG.md | 1 + docs/Supported-OS-Types.md | 1 + lib/oxidized/model/ml66.rb | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 lib/oxidized/model/ml66.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 323345847..62f2a2fa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - model for Ruijie Networks RGOS devices (@spike77453) - model for Asterfusion Network Operating System (@avl-dev) - pagination for http source (@davama) +- model for Ericsson Miniling 6600 series (@schouwenburg) + Added ability to send mail with the Docker container + Documentation to send mail with hooks diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 2efff373c..925d5ea9c 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -119,6 +119,7 @@ * [Eltex](/lib/oxidized/model/eltex.rb) * Ericsson/Redback * [IPOS (former SEOS)](/lib/oxidized/model/ipos.rb) + * [Minilink 6600](/lib/oxidized/model/ml66.rb) * Extreme Networks * [Enterasys B/C-Series](/lib/oxidized/model/enterasys.rb) * [Enterasys 800-Series](/lib/oxidized/model/enterasys800.rb) diff --git a/lib/oxidized/model/ml66.rb b/lib/oxidized/model/ml66.rb new file mode 100644 index 000000000..86b80fe0d --- /dev/null +++ b/lib/oxidized/model/ml66.rb @@ -0,0 +1,34 @@ +class ML66 < Oxidized::Model + comment '! ' + prompt /.*#/ + + expect /User:.*$/ do |data, re| + send "admin_user\n" + send "#{@node.auth[:password]}\n" + data.sub re, '' + end + + cmd 'show version' do |cfg| + cfg.gsub! /Uptime/, '' + comment cfg + end + + cmd 'show inventory hw all' do |cfg| + comment cfg + end + + cmd 'show inventory sw all' do |cfg| + comment cfg + end + + cmd 'show license status all' do |cfg| + comment cfg + end + + cmd 'show running-config' + + cfg :ssh do + pre_logout 'logout' + end + +end From 1d839712796b8047e582a2c91e998f123543d0cd Mon Sep 17 00:00:00 2001 From: MichiMeyer <45043976+MichiMeyer@users.noreply.github.com> Date: Fri, 4 Aug 2023 13:39:42 +0200 Subject: [PATCH 05/11] fix adva config for restore (#2899) --- CHANGELOG.md | 1 + lib/oxidized/model/adva.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62f2a2fa6..8891d3911 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - tp-link: fixed enable mode post login entrance (@mirackle-spb) - dlink: fixed prompt for other dlink switches, added additional uptime removal expressions (@mirackle-spb) - Collect VC info for juniper ex3400 (@ermuller) +- adva: fix config content for recovery process, collect config delta instead of current (@MichiMeyer) ## Fixed diff --git a/lib/oxidized/model/adva.rb b/lib/oxidized/model/adva.rb index 8b47acf8a..185dc9826 100644 --- a/lib/oxidized/model/adva.rb +++ b/lib/oxidized/model/adva.rb @@ -18,7 +18,7 @@ class ADVA < Oxidized::Model cfg.cut_both end - cmd 'show running-config current' do |cfg| + cmd 'show running-config delta' do |cfg| cfg.each_line.reject { |line| line.match /^Preparing configuration file.*/ }.join end From 494d877243b3341221972a813868ef03b443c1e9 Mon Sep 17 00:00:00 2001 From: Cyril LAVIER Date: Tue, 15 Aug 2023 07:18:13 -0400 Subject: [PATCH 06/11] Add support for AricentISS firware 2.x (#2866) --- CHANGELOG.md | 1 + lib/oxidized/model/aricentiss.rb | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8891d3911..0e782bf39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## Added - model for D-Link cisco like CLI (@mirackle-spb) - model for Ruijie Networks RGOS devices (@spike77453) +- added support for AricentISS 2.x firmware (@davromaniak) - model for Asterfusion Network Operating System (@avl-dev) - pagination for http source (@davama) - model for Ericsson Miniling 6600 series (@schouwenburg) diff --git a/lib/oxidized/model/aricentiss.rb b/lib/oxidized/model/aricentiss.rb index a8dfb9cea..bb49855e4 100644 --- a/lib/oxidized/model/aricentiss.rb +++ b/lib/oxidized/model/aricentiss.rb @@ -2,6 +2,10 @@ # #show version # Switch ID Hardware Version Firmware Version # 0 SSE-G48-TG4 (P2-01) 1.0.16-9 +# and +# # show version +# Switch ID Hardware Version Firmware Version +# 0 MBM-XEM-002 (B6-01) 2.1.3-25 class AricentISS < Oxidized::Model using Refinements @@ -13,6 +17,9 @@ class AricentISS < Oxidized::Model # 1.0.18-15 is known to include the corrected spelling post_login 'no cli pagination' post_login 'no cli pagignation' + # Starting firmware 2.0, pagination is done differently. + # This configuration is reset after the session ends. + post_login 'conf t; set cli pagination off; exit' pre_logout 'exit' end From 94b241f94d0802446fe2ebaaf3e0b0ecedb1b9d7 Mon Sep 17 00:00:00 2001 From: Justin Lentz Date: Tue, 15 Aug 2023 06:18:37 -0500 Subject: [PATCH 07/11] Gitcrypt refinements (#2886) * use Refinements * Update CHANGELOG.md --- CHANGELOG.md | 1 + lib/oxidized/output/gitcrypt.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e782bf39..ec238c9cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - fixed netscaler backups with hostname set #2828 (@electrocret) - Do not redirect stderr when fetching opnsense version since default shell (csh) doesn't support it (@spike77453) - Fixed fan RPM speeds included in Aruba CX diffs (@danpoltawski) +- Gitcrypt output refinements (@electrocret) - Remove constantly updating dates from backup of Adtran config (@davesbell) - fixed prompt for Cumulus to allow usernames with dots and dashes (@ktims) diff --git a/lib/oxidized/output/gitcrypt.rb b/lib/oxidized/output/gitcrypt.rb index 08986d9d3..3d6a456ad 100644 --- a/lib/oxidized/output/gitcrypt.rb +++ b/lib/oxidized/output/gitcrypt.rb @@ -1,5 +1,6 @@ module Oxidized class GitCrypt < Output + using Refinements class GitCryptError < OxidizedError; end begin require 'git' From 39bb8cc643b46a5e157afcb3a29c221b35137d2b Mon Sep 17 00:00:00 2001 From: Ritesh <51510930+ritzbhuj@users.noreply.github.com> Date: Wed, 16 Aug 2023 03:51:12 +0200 Subject: [PATCH 08/11] added model mimosab11 (#2902) * added model mimosab11 * Update mimosab11.rb Fixed errors picked up on test * Update mimosab11.rb * additional change to CHANGELOG and Supported OS types for PR #2902 --- CHANGELOG.md | 2 +- docs/Supported-OS-Types.md | 2 ++ lib/oxidized/model/mimosab11.rb | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 lib/oxidized/model/mimosab11.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index ec238c9cf..f5ef8580e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - model for Asterfusion Network Operating System (@avl-dev) - pagination for http source (@davama) - model for Ericsson Miniling 6600 series (@schouwenburg) - +- model for Mimosa B11 (@ritzbhuj) + Added ability to send mail with the Docker container + Documentation to send mail with hooks diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 925d5ea9c..000b1cb3c 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -186,6 +186,8 @@ * Mikrotik * [RouterOS](/lib/oxidized/model/routeros.rb) * [SwOS and SwOS Lite](/lib/oxidized/model/swos.rb) +* Mimosa + * [Mimosa (B11)](/lib/oxidized/model/mimosab11.rb) * Motorola * [RFS](/lib/oxidized/model/mtrlrfs.rb) * MRV diff --git a/lib/oxidized/model/mimosab11.rb b/lib/oxidized/model/mimosab11.rb new file mode 100644 index 000000000..b7ac07143 --- /dev/null +++ b/lib/oxidized/model/mimosab11.rb @@ -0,0 +1,34 @@ +begin + # Mechanize has to be intialized here as the login needs a POST request + require "mechanize" +rescue LoadError + # Oxidized requires mechanize + raise Oxidized::OxidizedError, "mechanize not found: sudo gem install mechanize" +end + +class Mimosab11 < Oxidized::Model + using Refinements + # Callback cfg_cb function to login(POST) then get(GET) the configuration + cfg_cb = lambda do + @e = Mechanize.new + # Set login query endpoint(lqe) and login POST data(lqp) + lqe = "https://#{@node.ip}/?q=index.login&mimosa_ajax=1" + lgp = { "username" => "configure", "password" => @password } + # Set get request endpoint(gc) for config + gc = "https://#{@node.ip}/?q=preferences.configure&mimosa_action=download" + # Not to verify self signed + @e.verify_mode = 0 + @e.post(lqe, lgp) + cfg = @e.get(gc) + cfg.body + end + + cmd cfg_cb do |cfg| + cfg + end + + cfg :http do + @username = @node.auth[:username] + @password = @node.auth[:password] + end +end From f9aa9556e8b1d35e352baba8a5a48771d40029d3 Mon Sep 17 00:00:00 2001 From: Dave Date: Thu, 14 Sep 2023 02:43:50 -0400 Subject: [PATCH 09/11] Bug Fix: source http (#2923) * [Bug Fix] source http fixes: #2897 * Update CHANGELOG.md * remove uri variable from read_http function * remove logging lines --- CHANGELOG.md | 1 + lib/oxidized/source/http.rb | 63 +++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5ef8580e..31e16ead4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - Gitcrypt output refinements (@electrocret) - Remove constantly updating dates from backup of Adtran config (@davesbell) - fixed prompt for Cumulus to allow usernames with dots and dashes (@ktims) +- fixed source http when source is librenms (@davama) ## [0.29.1 - 2023-04-24] diff --git a/lib/oxidized/source/http.rb b/lib/oxidized/source/http.rb index 32dbeb161..dd7986fee 100644 --- a/lib/oxidized/source/http.rb +++ b/lib/oxidized/source/http.rb @@ -6,6 +6,7 @@ def initialize end def setup + Oxidized.setup_logger return unless @cfg.url.empty? raise NoConfig, 'no source http url config, edit ~/.config/oxidized/config' @@ -18,8 +19,17 @@ def setup def load(node_want = nil) nodes = [] - data = read_http(node_want) - data.each do |node| + node_data = [] + uri = URI.parse(@cfg.url) + data = JSON.parse(read_http(uri, node_want)) + node_data = data + node_data = string_navigate(data, @cfg.hosts_location) if @cfg.hosts_location? + if @cfg.pagination? + node_data = pagination(data, node_want) + end + + # at this point we have all the nodes; pagination or not + node_data.each do |node| next if node.empty? # map node parameters @@ -44,14 +54,6 @@ def load(node_want = nil) private - def set_request(l_uri, l_headers, l_node_want) - req_uri = l_uri.request_uri - req_uri = "#{req_uri}/#{l_node_want}" if l_node_want - request = Net::HTTP::Get.new(req_uri, l_headers) - request.basic_auth(@cfg.user, @cfg.pass) if @cfg.user? && @cfg.pass? - request - end - def string_navigate(object, wants) wants = wants.split(".").map do |want| head, match, _tail = want.partition(/\[\d+\]/) @@ -63,31 +65,23 @@ def string_navigate(object, wants) object end - def check_pagination(response, http, headers, node_want) + def pagination(data, node_want) node_data = [] - if @cfg.pagination? - raise Oxidized::OxidizedError, "if using pagination, 'pagination_key_name' setting must be set" unless @cfg.pagination_key_name? - - next_key = @cfg.pagination_key_name - loop do - data = JSON.parse(response.body) - node_data += string_navigate(data, @cfg.hosts_location) if @cfg.hosts_location? - break if data[next_key].nil? - - new_uri = URI.parse(data[next_key]) if data.has_key?(next_key) - request = set_request(new_uri, headers, node_want) - response = http.request(request) - end - # since new feature; dont break curent configs - else - data = JSON.parse(response.body) - node_data += string_navigate(data, @cfg.hosts_location) if @cfg.hosts_location? + raise Oxidized::OxidizedError, "if using pagination, 'pagination_key_name' setting must be set" unless @cfg.pagination_key_name? + + next_key = @cfg.pagination_key_name + loop do + node_data += string_navigate(data, @cfg.hosts_location) if @cfg.hosts_location? + break if data[next_key].nil? + + new_uri = URI.parse(data[next_key]) if data.has_key?(next_key) + data = JSON.parse(read_http(new_uri, node_want)) + node_data += string_navigate(data, @cfg.hosts_location) if @cfg.hosts_location? end node_data end - def read_http(node_want) - uri = URI.parse(@cfg.url) + def read_http(uri, node_want) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if uri.scheme == 'https' http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless @cfg.secure @@ -101,10 +95,11 @@ def read_http(node_want) headers[header] = value end - request = set_request(uri, headers, node_want) - response = http.request(request) - - check_pagination(response, http, headers, node_want) + req_uri = uri.request_uri + req_uri = "#{req_uri}/#{node_want}" if node_want + request = Net::HTTP::Get.new(req_uri, headers) + request.basic_auth(@cfg.user, @cfg.pass) if @cfg.user? && @cfg.pass? + http.request(request).body end end end From 05e0e67c2c50254fba95a350283a70c286d9bb9a Mon Sep 17 00:00:00 2001 From: Justin Lentz Date: Thu, 14 Sep 2023 01:44:52 -0500 Subject: [PATCH 10/11] Tweak iosxr model (#2939) * Update iosxr.rb * Update CHANGELOG.md --- CHANGELOG.md | 1 + lib/oxidized/model/iosxr.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e16ead4..0abb52fac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - dlink: fixed prompt for other dlink switches, added additional uptime removal expressions (@mirackle-spb) - Collect VC info for juniper ex3400 (@ermuller) - adva: fix config content for recovery process, collect config delta instead of current (@MichiMeyer) +- iosxr: include last config changed by in model (@electrocret) ## Fixed diff --git a/lib/oxidized/model/iosxr.rb b/lib/oxidized/model/iosxr.rb index 5e94c249f..74db58436 100644 --- a/lib/oxidized/model/iosxr.rb +++ b/lib/oxidized/model/iosxr.rb @@ -25,7 +25,7 @@ class IOSXR < Oxidized::Model end cmd 'show running-config' do |cfg| - cfg = cfg.each_line.to_a[3..-1].join + cfg = cfg.each_line.to_a[1..-1].join cfg end From 4f2349ffce7ac95a0b81412ca74cc75f77ef74cd Mon Sep 17 00:00:00 2001 From: Boris Bliznioukov Date: Thu, 14 Sep 2023 09:59:37 +0300 Subject: [PATCH 11/11] fix for Aruba remove extra info (#2933) * remove command timestamp output for VRP on huawei USG remove IP managemt counters on Aruba CX switches * typo * fix other commands --- lib/oxidized/model/aoscx.rb | 2 +- lib/oxidized/model/vrp.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/oxidized/model/aoscx.rb b/lib/oxidized/model/aoscx.rb index 07ef3a89e..e7a5620eb 100644 --- a/lib/oxidized/model/aoscx.rb +++ b/lib/oxidized/model/aoscx.rb @@ -70,7 +70,7 @@ class Aoscx < Oxidized::Model comment cfg end - cmd 'show system | exclude "Up Time" | exclude "CPU" | exclude "Memory"' do |cfg| + cmd 'show system | exclude "Up Time|CPU|Memory|Pkts .x|Lowest|Missed"' do |cfg| comment cfg end diff --git a/lib/oxidized/model/vrp.rb b/lib/oxidized/model/vrp.rb index 71de54c82..06ca4dfad 100644 --- a/lib/oxidized/model/vrp.rb +++ b/lib/oxidized/model/vrp.rb @@ -27,15 +27,17 @@ class VRP < Oxidized::Model end cmd 'display version' do |cfg| - cfg = cfg.each_line.reject { |l| l.match /uptime/ }.join + cfg = cfg.each_line.reject { |l| l.match /uptime|^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d\d\d)? ?(\+\d\d:\d\d)?$/ }.join comment cfg end cmd 'display device' do |cfg| + cfg = cfg.each_line.reject { |l| l.match /^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d\d\d)? ?(\+\d\d:\d\d)?$/ }.join comment cfg end cmd 'display current-configuration all' do |cfg| + cfg = cfg.each_line.reject { |l| l.match /^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d(\.\d\d\d)? ?(\+\d\d:\d\d)?$/ }.join cfg end end