From f061f2752539da60ae894ba42ed567df7155314b Mon Sep 17 00:00:00 2001 From: Harm van Tilborg Date: Tue, 27 Oct 2015 09:52:10 +0100 Subject: Typo in Brocade NOS model --- lib/oxidized/model/nos.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/nos.rb b/lib/oxidized/model/nos.rb index c2f4319..18ca6a2 100644 --- a/lib/oxidized/model/nos.rb +++ b/lib/oxidized/model/nos.rb @@ -26,7 +26,7 @@ class NOS < Oxidized::Model end cfg 'show system' do |cfg| - commen cfg.each_line.reject { |line| line.match /Time/ or line.match /speed/ } + comment cfg.each_line.reject { |line| line.match /Time/ or line.match /speed/ } end cmd 'show running-config' -- cgit v1.2.1 From cb9f02548bbef0bdeb28a595031b700972bc7d1c Mon Sep 17 00:00:00 2001 From: Jeff Groom Date: Mon, 23 Nov 2015 18:12:14 +1300 Subject: added support for Ciena SOAS 6.x device type --- lib/oxidized/model/saos.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/oxidized/model/saos.rb (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/saos.rb b/lib/oxidized/model/saos.rb new file mode 100644 index 0000000..cada35b --- /dev/null +++ b/lib/oxidized/model/saos.rb @@ -0,0 +1,24 @@ +class SAOS < Oxidized::Model + + # Ciena SAOS switch + # used for 6.x devices + + comment '! ' + + cmd :all do |cfg| + cfg.each_line.to_a[1..-2].join + end + + cmd 'configuration show' do |cfg| + cfg + end + + cfg :telnet do + username /login:/ + password /assword:/ + end + cfg :telnet do + post_login 'system shell session set more off' + pre_logout 'exit' + end +end \ No newline at end of file -- cgit v1.2.1 From 9d2ca3d1cb51cdddef45f584aa6c98e8e600f3b6 Mon Sep 17 00:00:00 2001 From: MrRJ45 Date: Thu, 17 Dec 2015 16:06:43 +0000 Subject: Identify Stackable Switches Change how we identify stackable switches using the word "Unit" to identify this. This is more reliable than identifying the Model number. --- lib/oxidized/model/powerconnect.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb index ec15402..cd04766 100644 --- a/lib/oxidized/model/powerconnect.rb +++ b/lib/oxidized/model/powerconnect.rb @@ -14,6 +14,9 @@ class PowerConnect < Oxidized::Model end cmd 'show version' do |cfg| + if (@stackable.nil?) + @stackable = true if cfg.match /(U|u)nit\s/ + end cfg = cfg.split("\n").select { |line| not line[/Up\sTime/] } comment cfg.join("\n") + "\n" end @@ -47,15 +50,17 @@ class PowerConnect < Oxidized::Model def clean cfg out = [] - skip_block = false + skip_blocks = 0 cfg.each_line do |line| - if line.match /Up\sTime|Temperature|Power Supplies/i - # For 34xx, 35xx, 54xx, 55xx, 62xx and 8024F we should skip this block (terminated by a blank line) - skip_block = true if @model =~ /^(34|35)(24|48)$|^(54|55)(24|48)$|^(62)(24|48)$|^8024$/ + # If this is a stackable switch we should skip this block of information + if (line.match /Up\sTime|Temperature|Power Suppl(ies|y)|Fans/i and @stackable == true) + skip_blocks = 1 + # Some switches have another empty line. This is identified by this line having a colon + skip_blocks = 2 if line.match /:/ end # If we have lines to skip do this until we reach and empty line - if skip_block - skip_block = false if /\S/ !~ line + if skip_blocks > 0 + skip_blocks -= 1 if /\S/ !~ line next end out << line.strip -- cgit v1.2.1 From 8e6d2d15dfcbfd01547ac33ba78f7e88ba3ef292 Mon Sep 17 00:00:00 2001 From: asynet Date: Mon, 21 Dec 2015 21:39:29 +0000 Subject: Update fortios.rb Changing the regex makes possible to backup devices with FortiOS 4.x and long names --- lib/oxidized/model/fortios.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb index 2c796cb..a9d219c 100644 --- a/lib/oxidized/model/fortios.rb +++ b/lib/oxidized/model/fortios.rb @@ -2,7 +2,7 @@ class FortiOS < Oxidized::Model comment '# ' - prompt /^([-\w\.]+(\s[\(\w\-\.\)]+)?\s?[#>]\s?)$/ + prompt /^([-\w\.]+(\s[\(\w\-\.\)]+)?\~?\s?[#>]\s?)$/ cmd :all do |cfg, cmdstring| new_cfg = comment "COMMAND: #{cmdstring}\n" -- cgit v1.2.1