From f79e596b571b8b5913c2b4a9dc79968a712dab7b Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Wed, 9 Dec 2015 22:34:47 -0500 Subject: keep the config output clean --- lib/oxidized/model/junos.rb | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'lib') diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb index 1b641ca..bb56481 100644 --- a/lib/oxidized/model/junos.rb +++ b/lib/oxidized/model/junos.rb @@ -20,7 +20,7 @@ class JunOS < Oxidized::Model cmd 'show configuration | display omit' - cmd 'show version detail' do |cfg| + cmd 'show version' do |cfg| @model = $1 if cfg.match(/^Model: (\S+)/) comment cfg end @@ -30,40 +30,11 @@ class JunOS < Oxidized::Model case @model when 'mx960' out << cmd('show chassis fabric reachability') { |cfg| comment cfg } - when 'mx480' - out << cmd('show chassis scb') { |cfg| comment cfg } - out << cmd('show chassis sfm detail') { |cfg| comment cfg } - out << cmd('show chassis ssb') { |cfg| comment cfg } - out << cmd('show chassis feb detail') { |cfg| comment cfg } - out << cmd('show chassis feb') { |cfg| comment cfg } - out << cmd('show chassis cfeb') { |cfg| comment cfg } end out end - cmd('show chassis environment') do |cfg| - cfg.gsub!(/\d+ degrees.* F/, '') - cfg.gsub!(/Spinning at \S+/, '') - comment cfg - end - cmd('show chassis firmware') { |cfg| comment cfg } - cmd('show chassis fpc detail') do |cfg| - cfg.gsub!(/(Temperature\s+)(\d+)(.+)/, '\1\3') - cfg.gsub!(/(\s+\d+ days,)(.+seconds)/, '\1 \3') - comment cfg - end - cmd('show chassis hardware detail') { |cfg| comment cfg } - cmd('show chassis routing-engine') do |cfg| - cfg.gsub!(/(\S+\s+)(\d{2})( percent)/, '\1\3') - cfg.gsub!(/(\S+\s+)(\s\d{1})( percent)/, '\1\3') - cfg.gsub!(/(\s+\d+ days,)(.+seconds)/, '\1 \3') - cfg.gsub!(/(\s+)(\d+\.\d+)(\s+)(\d+\.\d+)(\s+)(\d+\.\d+)/, '\1\3\5') - comment cfg - end - cmd('show chassis alarms') { |cfg| comment cfg } - cmd('show system license') { |cfg| comment cfg } - cmd('show system boot-messages') { |cfg| comment cfg } - cmd('show system core-dumps') { |cfg| comment cfg } + cmd('show chassis hardware') { |cfg| comment cfg } cfg :telnet do username(/^login:/) -- cgit v1.2.1