summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/ironware.rb
diff options
context:
space:
mode:
authorWild Kat <wk@users.noreply.github.com>2018-05-26 23:49:29 +0200
committerGitHub <noreply@github.com>2018-05-26 23:49:29 +0200
commit39dbb74c527c054007e26ad34c8921d4be6cb638 (patch)
treed55745153153450fb40e1f591eb861495a6068d9 /lib/oxidized/model/ironware.rb
parentdefdc69f92b3bcf62b1fd3b5ceac63a7a4e637ae (diff)
parent42bf10b7bce34ff577c469f6c2f659f3913cbf4a (diff)
Merge branch 'master' into FortiOS-Push
Diffstat (limited to 'lib/oxidized/model/ironware.rb')
-rw-r--r--lib/oxidized/model/ironware.rb27
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb
index 386d585..32dbf47 100644
--- a/lib/oxidized/model/ironware.rb
+++ b/lib/oxidized/model/ironware.rb
@@ -1,19 +1,17 @@
class IronWare < Oxidized::Model
-
prompt /^.*(telnet|ssh)\@.+[>#]\s?$/i
comment '! '
- #to handle pager without enable
- #expect /^((.*)--More--(.*))$/ do |data, re|
+ # to handle pager without enable
+ # expect /^((.*)--More--(.*))$/ do |data, re|
# send ' '
# data.sub re, ''
- #end
-
+ # end
- #to remove backspace (if handle pager without enable)
- #expect /^((.*)[\b](.*))$/ do |data, re|
+ # to remove backspace (if handle pager without enable)
+ # expect /^((.*)[\b](.*))$/ do |data, re|
# data.sub re, ''
- #end
+ # end
cmd :all do |cfg|
# sometimes ironware inserts arbitrary whitespace after commands are
@@ -22,17 +20,17 @@ class IronWare < Oxidized::Model
end
cmd 'show version' do |cfg|
- cfg.gsub! /(^((.*)[Ss]ystem uptime(.*))$)/, '' #remove unwanted line system uptime
+ cfg.gsub! /(^((.*)[Ss]ystem uptime(.*))$)/, '' # remove unwanted line system uptime
cfg.gsub! /(^((.*)[Tt]he system started at(.*))$)/, ''
- cfg.gsub! /[Uu]p\s?[Tt]ime is .*/,''
+ cfg.gsub! /[Uu]p\s?[Tt]ime is .*/, ''
comment cfg
end
cmd 'show chassis' do |cfg|
- cfg.encode!("UTF-8", :invalid => :replace, :undef => :replace) #sometimes ironware returns broken encoding
- cfg.gsub! /(^((.*)Current temp(.*))$)/, '' #remove unwanted lines current temperature
- cfg.gsub! /Speed = [A-Z-]{2,6} \(\d{2,3}\%\)/, '' #remove unwanted lines Speed Fans
+ cfg.encode!("UTF-8", :invalid => :replace, :undef => :replace) # sometimes ironware returns broken encoding
+ cfg.gsub! /(^((.*)Current temp(.*))$)/, '' # remove unwanted lines current temperature
+ cfg.gsub! /Speed = [A-Z-]{2,6} \(\d{2,3}\%\)/, '' # remove unwanted lines Speed Fans
cfg.gsub! /current speed is [A-Z]{2,6} \(\d{2,3}\%\)/, ''
cfg.gsub! /Fan \d* - STATUS: OK \D*\d*./, '' # Fix for ADX Fan speed reporting
cfg.gsub! /\d* deg C/, '' # Fix for ADX temperature reporting
@@ -73,7 +71,7 @@ class IronWare < Oxidized::Model
password /^(Please Enter Password ?|Password):/
end
- #handle pager with enable
+ # handle pager with enable
cfg :telnet, :ssh do
if vars :enable
post_login do
@@ -86,5 +84,4 @@ class IronWare < Oxidized::Model
post_login 'terminal length 0'
pre_logout "logout\nexit\nexit\n"
end
-
end