summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/junos.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model/junos.rb')
-rw-r--r--lib/oxidized/model/junos.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb
index caa6536..d1f4de6 100644
--- a/lib/oxidized/model/junos.rb
+++ b/lib/oxidized/model/junos.rb
@@ -6,13 +6,14 @@ class JunOS < Oxidized::Model
@input.class.to_s.match /Telnet/
end
- cmd 'show configuration' do |cfg|
- # example how to handle different output from different methods. Other option would be to
- # pass string to helper method, which checks if top/bottom has prompts and removes
+ cmd :all do |cfg|
+ # we don't need screen-scraping in ssh due to exec
cfg = cfg.lines[1..-2].join if telnet
cfg
end
+ cmd 'show configuration'
+
cmd 'show version' do |cfg|
chassis = model $1 if cfg.match /^Model: (\S+)/
comment cfg << chassis.to_s