summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r--lib/oxidized/model/airos.rb2
-rw-r--r--lib/oxidized/model/fortios.rb5
-rw-r--r--lib/oxidized/model/ipos.rb37
-rw-r--r--lib/oxidized/model/junos.rb2
-rw-r--r--lib/oxidized/model/mtrlrfs.rb37
-rw-r--r--lib/oxidized/model/xos.rb6
6 files changed, 86 insertions, 3 deletions
diff --git a/lib/oxidized/model/airos.rb b/lib/oxidized/model/airos.rb
index 316c4f0..775005f 100644
--- a/lib/oxidized/model/airos.rb
+++ b/lib/oxidized/model/airos.rb
@@ -7,7 +7,7 @@ class Airos < Oxidized::Model
cfg.split("\n").map { |line| "# #{line}" }.join("\n") + "\n"
end
- cmd 'cat /tmp/system.cfg'
+ cmd 'sort /tmp/system.cfg'
cmd :secret do |cfg|
cfg.gsub! /^(users\.\d+\.password|snmp\.community)=.+/, "# \\1=<hidden>"
diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb
index 3515b46..92add0e 100644
--- a/lib/oxidized/model/fortios.rb
+++ b/lib/oxidized/model/fortios.rb
@@ -4,6 +4,11 @@ class FortiOS < Oxidized::Model
prompt /^([-\w\.]+(\s[\(\w\-\.\)]+)?\~?\s?[#>]\s?)$/
+ expect /^--More--\s$/ do |data, re|
+ send ' '
+ data.sub re, ''
+ end
+
cmd :all do |cfg, cmdstring|
new_cfg = comment "COMMAND: #{cmdstring}\n"
new_cfg << cfg.each_line.to_a[1..-2].map { |line| line.gsub(/(conf_file_ver=)(.*)/, '\1<stripped>\3') }.join
diff --git a/lib/oxidized/model/ipos.rb b/lib/oxidized/model/ipos.rb
new file mode 100644
index 0000000..1a77807
--- /dev/null
+++ b/lib/oxidized/model/ipos.rb
@@ -0,0 +1,37 @@
+class IPOS < Oxidized::Model
+
+ # Ericsson SSR (IPOS)
+ # Redback SE (SEOS)
+
+ prompt /^([\[\]\w.@-]+[#>]\s?)$/
+ comment '! '
+
+ cmd 'show chassis' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show hardware detail' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show release' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show config'
+
+ cfg :telnet do
+ username /^login:/
+ password /^\r*password:/
+ end
+
+ cfg :telnet, :ssh do
+ post_login 'terminal length 0'
+ pre_logout do
+ send "exit\n"
+ send "n\n"
+ end
+ end
+
+end
+
diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb
index bb56481..bdd9bed 100644
--- a/lib/oxidized/model/junos.rb
+++ b/lib/oxidized/model/junos.rb
@@ -30,6 +30,8 @@ class JunOS < Oxidized::Model
case @model
when 'mx960'
out << cmd('show chassis fabric reachability') { |cfg| comment cfg }
+ when /^(ex22|ex33|ex4|ex8|qfx)/
+ out << cmd('show virtual-chassis') { |cfg| comment cfg }
end
out
end
diff --git a/lib/oxidized/model/mtrlrfs.rb b/lib/oxidized/model/mtrlrfs.rb
new file mode 100644
index 0000000..84bcfe1
--- /dev/null
+++ b/lib/oxidized/model/mtrlrfs.rb
@@ -0,0 +1,37 @@
+class mtrlrfs < Oxidized::Model
+
+ # Motorola RFS/Extreme WM
+
+ comment '# '
+
+ cmd :all do |cfg|
+ # xos inserts leading \r characters and other trailing white space.
+ # this deletes extraneous \r and trailing white space.
+ cfg.each_line.to_a[1..-2].map{|line|line.delete("\r").rstrip}.join("\n") + "\n"
+ end
+
+ cmd 'show version' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show licenses' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show running-config'
+
+ cfg :telnet do
+ username /^login:/
+ password /^\r*password:/
+ end
+
+ cfg :telnet, :ssh do
+ post_login 'terminal length 0'
+ pre_logout do
+ send "exit\n"
+ send "n\n"
+ end
+ end
+
+end
+
diff --git a/lib/oxidized/model/xos.rb b/lib/oxidized/model/xos.rb
index de8ec39..6f1323f 100644
--- a/lib/oxidized/model/xos.rb
+++ b/lib/oxidized/model/xos.rb
@@ -36,8 +36,10 @@ class XOS < Oxidized::Model
cfg :telnet, :ssh do
post_login 'disable clipaging'
- pre_logout 'exit'
- pre_logout 'n'
+ pre_logout do
+ send "exit\n"
+ send "n\n"
+ end
end
end