summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r--lib/oxidized/model/panos.rb26
-rw-r--r--lib/oxidized/model/screenos.rb9
2 files changed, 33 insertions, 2 deletions
diff --git a/lib/oxidized/model/panos.rb b/lib/oxidized/model/panos.rb
new file mode 100644
index 0000000..35624b7
--- /dev/null
+++ b/lib/oxidized/model/panos.rb
@@ -0,0 +1,26 @@
+class PanOS < Oxidized::Model
+
+ # PaloAlto PAN-OS model #
+
+ comment '! '
+
+ prompt /^[\w.\@:\(\)-]+>\s?$/
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[2..-3].join
+ end
+
+ cmd 'show system info' do |cfg|
+ cfg.gsub! /^(up)?time:\ .*\n/, ''
+ comment cfg
+ end
+
+ cmd 'show config running' do |cfg|
+ cfg
+ end
+
+ cfg :ssh do
+ post_login 'set cli pager off'
+ pre_logout 'exit'
+ end
+end
diff --git a/lib/oxidized/model/screenos.rb b/lib/oxidized/model/screenos.rb
index 922f401..7ee9d9f 100644
--- a/lib/oxidized/model/screenos.rb
+++ b/lib/oxidized/model/screenos.rb
@@ -4,7 +4,7 @@ class ScreenOS < Oxidized::Model
comment '! '
- prompt '/^([\w.-\(\)]+->\s?)$/'
+ prompt /^[\w.:\(\)-]+->\s?$/
cmd :all do |cfg|
cfg.each_line.to_a[2..-2].join
@@ -18,6 +18,8 @@ class ScreenOS < Oxidized::Model
end
cmd 'get system' do |cfg|
+ cfg.gsub! /^Date\ .*\n/, ''
+ cfg.gsub! /^Up\ .*\n/, ''
comment cfg
end
@@ -33,7 +35,10 @@ class ScreenOS < Oxidized::Model
cfg :telnet, :ssh do
post_login 'set console page 0'
- pre_logout 'exit'
+ pre_logout do
+ send "exit\n"
+ send "n"
+ end
end
end