diff options
Diffstat (limited to 'lib/oxidized')
-rw-r--r-- | lib/oxidized/model/aricentiss.rb | 45 | ||||
-rw-r--r-- | lib/oxidized/model/edgecos.rb (renamed from lib/oxidized/model/supermicro.rb) | 6 |
2 files changed, 49 insertions, 2 deletions
diff --git a/lib/oxidized/model/aricentiss.rb b/lib/oxidized/model/aricentiss.rb new file mode 100644 index 0000000..8675263 --- /dev/null +++ b/lib/oxidized/model/aricentiss.rb @@ -0,0 +1,45 @@ +class AricentISS < Oxidized::Model + + prompt (/^(\e\[27m)?[ \r]*\w+# ?$/) + + cfg :ssh do + post_login 'no cli pagignation' + pre_logout 'exit' + end + + cmd :all do |cfg| + # * Drop first line that contains the command, and the last line that + # contains a prompt + # * Strip carriage returns + cfg.delete("\r").each_line.to_a[1..-2].join + end + + cmd :secret do |cfg| + cfg.gsub(/^(snmp community) .*/, '\1 <hidden>') + end + + cmd 'show system information' do |cfg| + cfg.sub! /^Device Up Time.*\n/, '' + cfg.delete! "\r" + comment(cfg).gsub(/ +$/, '') + end + + cmd 'show running-config' do |cfg| + comment_next = 0 + cfg.each_line.map { |l| + next '' if l.match /^Building configuration/ + + if l.match /^Switch ID.*Hardware Version.*Firmware Version/ then + comment_next = 2 + end + + if comment_next > 0 then + comment_next -= 1 + next comment(l) + end + + l + }.join.gsub(/ +$/, '') + end + +end diff --git a/lib/oxidized/model/supermicro.rb b/lib/oxidized/model/edgecos.rb index 361244c..bc205f5 100644 --- a/lib/oxidized/model/supermicro.rb +++ b/lib/oxidized/model/edgecos.rb @@ -1,4 +1,5 @@ -class Supermicro < Oxidized::Model +class EdgeCOS < Oxidized::Model + comment '! ' cmd :secret do |cfg| @@ -42,4 +43,5 @@ class Supermicro < Oxidized::Model post_login 'terminal length 0' pre_logout 'exit' end -end
\ No newline at end of file + +end |