From 5e19bcca367a4445d1ef2e4e222cf5c7b28942b9 Mon Sep 17 00:00:00 2001 From: ghankins Date: Wed, 3 Aug 2016 14:01:10 -0400 Subject: Added Nokia. --- lib/oxidized/model/timos.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/oxidized/model/timos.rb b/lib/oxidized/model/timos.rb index dc28580..6bbdddf 100644 --- a/lib/oxidized/model/timos.rb +++ b/lib/oxidized/model/timos.rb @@ -1,7 +1,7 @@ class TiMOS < Oxidized::Model - # Alcatel-Lucent TiMOS (Timetra) - # used in SR/ESS/SAS routers + # Nokia SR OS (TiMOS) (formerly TiMetra, Alcatel, Alcatel-Lucent) + # used in 7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, and NSP comment '# ' -- cgit v1.2.1 From fcdb5df4cb9223c340efd891fab7ac7cdcd1ba7a Mon Sep 17 00:00:00 2001 From: ghankins Date: Wed, 3 Aug 2016 23:07:02 -0400 Subject: Updated SR OS commands. --- lib/oxidized/model/timos.rb | 79 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/oxidized/model/timos.rb b/lib/oxidized/model/timos.rb index 6bbdddf..eee63e0 100644 --- a/lib/oxidized/model/timos.rb +++ b/lib/oxidized/model/timos.rb @@ -1,8 +1,14 @@ class TiMOS < Oxidized::Model - # Nokia SR OS (TiMOS) (formerly TiMetra, Alcatel, Alcatel-Lucent) - # used in 7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, and NSP - + # + # Nokia SR OS (TiMOS) (formerly TiMetra, Alcatel, Alcatel-Lucent). + # Used in 7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, and NSP. + # + + # + # Define comment but don't actually use it. SR OS has a lot of output that + # is exactly 80 columns wide, and the comment make the output look funny. + # comment '# ' prompt /^([-\w\.:>\*]+\s?[#>]\s?)$/ @@ -12,26 +18,71 @@ class TiMOS < Oxidized::Model new_cfg << cfg.each_line.to_a[1..-2].join end - cmd 'show bof' do |cfg| - comment cfg - end + # + # Show the boot options file. + # + cmd 'show bof' + # + # Show the system information. + # cmd 'show system information' do |cfg| - # strip uptime + # + # Strip uptime. + # cfg.sub! /^System Up Time.*\n/, '' - comment cfg end - cmd 'show card state' do |cfg| - comment cfg + # + # Show the card state. + # + cmd 'show card state' + + # + # Show the boot log. + # + cmd 'file type bootlog.txt' do |cfg| + # + # Strip carriage returns and backspaces. + # + cfg.gsub! /\r/, '' + cfg.gsub! /[\b][\b][\b]/, "\n" end - cmd 'show boot-messages' do |cfg| - cfg.gsub! /\r/, "" - comment cfg + # + # Show the running debug configuration. + # + cmd 'show debug' + + # + # Show the saved debug configuration (admin debug-save). + # + cmd 'file type config.dbg' do |cfg| + # + # Strip carriage returns. + # + cfg.gsub! /\r/, '' end - cmd 'admin display-config' + # + # Show the running persistent indices. + # + cmd 'admin display-config index' do |cfg| + # + # Strip carriage returns. + # + cfg.gsub! /\r/, '' + end + + # + # Show the running configuration. + # + cmd 'admin display-config' do |cfg| + # + # Strip carriage returns. + # + cfg.gsub! /\r/, '' + end cfg :telnet do username /^Login: / -- cgit v1.2.1 From eb56404370bc8da6c999b3684d6c7654d09a60ab Mon Sep 17 00:00:00 2001 From: ghankins Date: Thu, 4 Aug 2016 09:47:17 -0400 Subject: Added comments. --- lib/oxidized/model/timos.rb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/oxidized/model/timos.rb b/lib/oxidized/model/timos.rb index eee63e0..d40e845 100644 --- a/lib/oxidized/model/timos.rb +++ b/lib/oxidized/model/timos.rb @@ -5,10 +5,6 @@ class TiMOS < Oxidized::Model # Used in 7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, and NSP. # - # - # Define comment but don't actually use it. SR OS has a lot of output that - # is exactly 80 columns wide, and the comment make the output look funny. - # comment '# ' prompt /^([-\w\.:>\*]+\s?[#>]\s?)$/ @@ -21,7 +17,9 @@ class TiMOS < Oxidized::Model # # Show the boot options file. # - cmd 'show bof' + cmd 'show bof' do |cfg| + comment cfg + end # # Show the system information. @@ -31,12 +29,15 @@ class TiMOS < Oxidized::Model # Strip uptime. # cfg.sub! /^System Up Time.*\n/, '' + comment cfg end # # Show the card state. # - cmd 'show card state' + cmd 'show card state' do |cfg| + comment cfg + end # # Show the boot log. @@ -47,12 +48,15 @@ class TiMOS < Oxidized::Model # cfg.gsub! /\r/, '' cfg.gsub! /[\b][\b][\b]/, "\n" + comment cfg end # # Show the running debug configuration. # - cmd 'show debug' + cmd 'show debug' do |cfg| + comment cfg + end # # Show the saved debug configuration (admin debug-save). @@ -62,6 +66,7 @@ class TiMOS < Oxidized::Model # Strip carriage returns. # cfg.gsub! /\r/, '' + comment cfg end # @@ -72,6 +77,7 @@ class TiMOS < Oxidized::Model # Strip carriage returns. # cfg.gsub! /\r/, '' + comment cfg end # -- cgit v1.2.1