diff options
author | Elvin Efendi <elvin.efendiyev@gmail.com> | 2015-12-02 15:42:29 -0500 |
---|---|---|
committer | Elvin Efendi <elvin.efendiyev@gmail.com> | 2015-12-02 15:42:29 -0500 |
commit | c6614b7a343fe1bd7eabd5e0a8ae404440087bc7 (patch) | |
tree | fbefa5c7624cacb2bbccdc5a84728e9a0408d6f4 /lib | |
parent | 937b1f6806caf8f4e0b4397398770ac4e339cdb4 (diff) | |
parent | 6b47e7122ea9e8f470c30335d4bcb588ed279a18 (diff) |
Merge pull request #3 from Shopify/more-device-info
More device info
Diffstat (limited to 'lib')
-rw-r--r-- | lib/oxidized/model/junos.rb | 30 | ||||
-rw-r--r-- | lib/oxidized/model/model.rb | 2 |
2 files changed, 29 insertions, 3 deletions
diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb index da3af72..a02d588 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' do |cfg| + cmd 'show version detail' do |cfg| @model = $1 if cfg.match(/^Model: (\S+)/) comment cfg end @@ -30,13 +30,39 @@ 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 hardware' do |cfg| + cmd('show chassis environment') do |cfg| + cfg.gsub!(/\d+ degrees.* F/, '<measurement stripped>') + cfg.gsub!(/Spinning at \S+/, '<measurement stripped>') comment cfg end + cmd('show chassis firmware') { |cfg| comment cfg } + cmd('show chassis fpc detail') do |cfg| + cfg.gsub!(/(Temperature\s+)(\d+)(.+)/, '\1<stripped>\3') + cfg.gsub!(/(\s+\d+ days,)(.+seconds)/, '\1 <stripped>\3') + comment cfg + end + cmd('show chassis hardware detail') { |cfg| comment cfg } + cmd('show chassis routing-engine') do |cfg| + cfg.gsub!(/(\S+\s+)(\d+)( percent)/, '\1<stripped>\3') + cfg.gsub!(/(\s+\d+ days,)(.+seconds)/, '\1 <stripped>\3') + cfg.gsub!(/(\s+)(\d+\.\d+)(\s+)(\d+\.\d+)(\s+)(\d+\.\d+)/, '\1<stripped>\3<stripped>\5<stripped>') + 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 } cfg :telnet do username(/^login:/) diff --git a/lib/oxidized/model/model.rb b/lib/oxidized/model/model.rb index c95cc67..ca851e3 100644 --- a/lib/oxidized/model/model.rb +++ b/lib/oxidized/model/model.rb @@ -79,7 +79,7 @@ module Oxidized attr_accessor :input, :node def cmd string, &block - out = @input.cmd string + out = "====================== #{string} ======================\n" + @input.cmd(string) return false unless out self.class.cmds[:all].each do |all_block| out = instance_exec Oxidized::String.new(out), string, &all_block |