oxidized 0.24.0 → 0.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +4 -0
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +26 -2
- data/Dockerfile +8 -32
- data/README.md +17 -5
- data/bin/oxidized +1 -1
- data/docs/Configuration.md +41 -3
- data/docs/Hooks.md +26 -0
- data/docs/Model-Notes/AireOS.md +1 -2
- data/docs/Model-Notes/ArbOS.md +1 -2
- data/docs/Model-Notes/Comware.md +1 -2
- data/docs/Model-Notes/EOS.md +1 -2
- data/docs/Model-Notes/JunOS.md +1 -2
- data/docs/Model-Notes/Netgear.md +5 -6
- data/docs/Model-Notes/Nokia.md +9 -0
- data/docs/Model-Notes/README.md +3 -2
- data/docs/Model-Notes/VRP-Huawei.md +1 -2
- data/docs/Model-Notes/Viptela.md +12 -0
- data/docs/Model-Notes/XGS4600-Zyxel.md +1 -2
- data/docs/Ruby-API.md +54 -2
- data/docs/Supported-OS-Types.md +12 -0
- data/extra/oxidized.service +7 -0
- data/lib/oxidized/cli.rb +7 -0
- data/lib/oxidized/config.rb +3 -0
- data/lib/oxidized/core.rb +1 -0
- data/lib/oxidized/hook/ciscosparkdiff.rb +11 -17
- data/lib/oxidized/hook/slackdiff.rb +5 -11
- data/lib/oxidized/hook/xmppdiff.rb +1 -0
- data/lib/oxidized/input/ssh.rb +43 -27
- data/lib/oxidized/input/telnet.rb +1 -0
- data/lib/oxidized/model/acos.rb +2 -2
- data/lib/oxidized/model/acsw.rb +6 -6
- data/lib/oxidized/model/adtran.rb +22 -0
- data/lib/oxidized/model/aen.rb +2 -2
- data/lib/oxidized/model/aireos.rb +3 -2
- data/lib/oxidized/model/alteonos.rb +2 -2
- data/lib/oxidized/model/aos.rb +1 -1
- data/lib/oxidized/model/aos7.rb +1 -1
- data/lib/oxidized/model/aosw.rb +5 -3
- data/lib/oxidized/model/apc_aos.rb +1 -1
- data/lib/oxidized/model/arbos.rb +2 -2
- data/lib/oxidized/model/asa.rb +8 -2
- data/lib/oxidized/model/awplus.rb +1 -1
- data/lib/oxidized/model/axos.rb +16 -0
- data/lib/oxidized/model/c4cmts.rb +3 -5
- data/lib/oxidized/model/casa.rb +1 -1
- data/lib/oxidized/model/catos.rb +1 -1
- data/lib/oxidized/model/ciscosma.rb +1 -1
- data/lib/oxidized/model/ciscosmb.rb +10 -4
- data/lib/oxidized/model/comtrol.rb +41 -0
- data/lib/oxidized/model/comware.rb +1 -1
- data/lib/oxidized/model/coriantgroove.rb +4 -6
- data/lib/oxidized/model/cumulus.rb +14 -1
- data/lib/oxidized/model/datacom.rb +1 -2
- data/lib/oxidized/model/dcnos.rb +1 -1
- data/lib/oxidized/model/dellx.rb +76 -0
- data/lib/oxidized/model/dlink.rb +2 -2
- data/lib/oxidized/model/dnos.rb +3 -1
- data/lib/oxidized/model/eciapollo.rb +34 -0
- data/lib/oxidized/model/edgecos.rb +1 -0
- data/lib/oxidized/model/edgeos.rb +6 -1
- data/lib/oxidized/model/eos.rb +3 -2
- data/lib/oxidized/model/fiberdriver.rb +1 -1
- data/lib/oxidized/model/firebrick.rb +31 -0
- data/lib/oxidized/model/firewareos.rb +1 -1
- data/lib/oxidized/model/fortios.rb +5 -4
- data/lib/oxidized/model/ftos.rb +4 -1
- data/lib/oxidized/model/fujitsupy.rb +3 -3
- data/lib/oxidized/model/gaiaos.rb +1 -1
- data/lib/oxidized/model/gcombnps.rb +3 -1
- data/lib/oxidized/model/hatteras.rb +1 -1
- data/lib/oxidized/model/hirschmann.rb +2 -2
- data/lib/oxidized/model/hpebladesystem.rb +1 -1
- data/lib/oxidized/model/ios.rb +21 -13
- data/lib/oxidized/model/ipos.rb +3 -3
- data/lib/oxidized/model/ironware.rb +3 -3
- data/lib/oxidized/model/isam.rb +1 -1
- data/lib/oxidized/model/junos.rb +1 -1
- data/lib/oxidized/model/masteros.rb +2 -3
- data/lib/oxidized/model/mlnxos.rb +5 -5
- data/lib/oxidized/model/model.rb +3 -0
- data/lib/oxidized/model/ndms.rb +1 -2
- data/lib/oxidized/model/netgear.rb +7 -9
- data/lib/oxidized/model/netonix.rb +1 -1
- data/lib/oxidized/model/netscaler.rb +6 -1
- data/lib/oxidized/model/nos.rb +2 -2
- data/lib/oxidized/model/oneos.rb +1 -1
- data/lib/oxidized/model/openbsd.rb +8 -22
- data/lib/oxidized/model/openwrt.rb +1 -0
- data/lib/oxidized/model/opnsense.rb +1 -1
- data/lib/oxidized/model/panos.rb +9 -9
- data/lib/oxidized/model/pfsense.rb +2 -1
- data/lib/oxidized/model/planet.rb +1 -1
- data/lib/oxidized/model/powerconnect.rb +7 -4
- data/lib/oxidized/model/procurve.rb +7 -5
- data/lib/oxidized/model/routeros.rb +1 -1
- data/lib/oxidized/model/saos.rb +1 -1
- data/lib/oxidized/model/screenos.rb +3 -3
- data/lib/oxidized/model/sros.rb +2 -2
- data/lib/oxidized/model/stoneos.rb +1 -1
- data/lib/oxidized/model/tmos.rb +2 -0
- data/lib/oxidized/model/tplink.rb +4 -0
- data/lib/oxidized/model/viptela.rb +29 -0
- data/lib/oxidized/model/voltaire.rb +5 -5
- data/lib/oxidized/model/voss.rb +4 -4
- data/lib/oxidized/model/vrp.rb +1 -1
- data/lib/oxidized/model/vyatta.rb +1 -1
- data/lib/oxidized/model/weos.rb +1 -1
- data/lib/oxidized/model/xos.rb +9 -2
- data/lib/oxidized/node.rb +20 -31
- data/lib/oxidized/nodes.rb +3 -0
- data/lib/oxidized/output/git.rb +17 -20
- data/lib/oxidized/output/gitcrypt.rb +2 -1
- data/lib/oxidized/output/http.rb +19 -12
- data/lib/oxidized/source/csv.rb +15 -8
- data/lib/oxidized/source/http.rb +26 -22
- data/lib/oxidized/string.rb +9 -4
- data/lib/oxidized/version.rb +2 -2
- data/lib/oxidized/worker.rb +44 -36
- data/oxidized.gemspec +1 -4
- metadata +26 -16
data/lib/oxidized/model/dlink.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Dlink < Oxidized::Model
|
2
2
|
# D-LINK Switches
|
3
3
|
|
4
|
-
prompt /^(\r*[\w.@()
|
4
|
+
prompt /^(\r*[\w.@()\/:-]+[#>]\s?)$/
|
5
5
|
comment '# '
|
6
6
|
|
7
7
|
cmd :secret do |cfg|
|
@@ -15,7 +15,7 @@ class Dlink < Oxidized::Model
|
|
15
15
|
end
|
16
16
|
|
17
17
|
cmd 'show switch' do |cfg|
|
18
|
-
cfg.gsub! /^System
|
18
|
+
cfg.gsub! /^System Uptime\s.+/, '' # Omit constantly changing uptime info
|
19
19
|
comment cfg
|
20
20
|
end
|
21
21
|
|
data/lib/oxidized/model/dnos.rb
CHANGED
@@ -5,13 +5,15 @@ class DNOS < Oxidized::Model
|
|
5
5
|
|
6
6
|
cmd :all do |cfg|
|
7
7
|
cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
|
8
|
-
cfg.gsub!
|
8
|
+
cfg.gsub! /(uptime is)(\s.+)/, '\\1 <removed>' # Omit changing uptime info
|
9
9
|
cfg.each_line.to_a[2..-2].join
|
10
10
|
end
|
11
11
|
|
12
12
|
cmd :secret do |cfg|
|
13
13
|
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
|
14
14
|
cfg.gsub! /secret (\d+) (\S+).*/, '<secret hidden>'
|
15
|
+
cfg.gsub! /password (\d+) (\S+).*/, '<secret hidden>'
|
16
|
+
cfg.gsub! /^(tacacs-server key \d+) (\S+).*/, '\\1 <secret hidden>'
|
15
17
|
cfg
|
16
18
|
end
|
17
19
|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# ECI Telecom Apollo
|
2
|
+
# Tested on OPT9608 systems via SSH and telnet
|
3
|
+
|
4
|
+
class ECIapollo < Oxidized::Model
|
5
|
+
prompt /^([\w.@()-]+[#>]\s?)$/
|
6
|
+
comment '# '
|
7
|
+
|
8
|
+
cmd :all do |cfg|
|
9
|
+
cfg.each_line.to_a[1..-2].join
|
10
|
+
end
|
11
|
+
|
12
|
+
cmd :secret do |cfg|
|
13
|
+
cfg.gsub!(/community (\S+) {/, 'community <hidden> {')
|
14
|
+
cfg.gsub!(/ "\$\d\$\S+; ## SECRET-DATA/, ' <secret removed>;')
|
15
|
+
cfg
|
16
|
+
end
|
17
|
+
|
18
|
+
cfg :telnet do
|
19
|
+
username(/^login:/)
|
20
|
+
password(/^Password:/)
|
21
|
+
end
|
22
|
+
|
23
|
+
cfg :telnet, :ssh do
|
24
|
+
post_login 'set cli screen-length 0'
|
25
|
+
post_login 'set cli screen-width 0'
|
26
|
+
pre_logout 'exit'
|
27
|
+
end
|
28
|
+
|
29
|
+
cmd('show version') { |cfg| comment cfg }
|
30
|
+
cmd('show system licenses') { |cfg| comment cfg }
|
31
|
+
cmd('show configuration') { |cfg| comment cfg }
|
32
|
+
cmd('show configuration | display-set') { |cfg| cfg }
|
33
|
+
cmd('show chassis inventory') { |cfg| comment cfg }
|
34
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Edgeos < Oxidized::Model
|
2
2
|
# EdgeOS #
|
3
3
|
|
4
|
-
prompt
|
4
|
+
prompt /@.*?:~\$\s/
|
5
5
|
|
6
6
|
cmd :all do |cfg|
|
7
7
|
cfg = cfg.lines.to_a[1..-2].join
|
@@ -16,6 +16,11 @@ class Edgeos < Oxidized::Model
|
|
16
16
|
cfg
|
17
17
|
end
|
18
18
|
|
19
|
+
cmd 'show version | no-more' do |cfg|
|
20
|
+
cfg.gsub! /^Uptime:\s.+/, ''
|
21
|
+
comment cfg
|
22
|
+
end
|
23
|
+
|
19
24
|
cmd 'show configuration commands | no-more'
|
20
25
|
|
21
26
|
cfg :telnet do
|
data/lib/oxidized/model/eos.rb
CHANGED
@@ -6,12 +6,13 @@ class EOS < Oxidized::Model
|
|
6
6
|
comment '! '
|
7
7
|
|
8
8
|
cmd :all do |cfg|
|
9
|
-
cfg.
|
9
|
+
cfg.cut_both
|
10
10
|
end
|
11
11
|
|
12
12
|
cmd :secret do |cfg|
|
13
13
|
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
|
14
|
-
cfg.gsub! /
|
14
|
+
cfg.gsub! /(secret \w+) (\S+).*/, '\\1 <secret hidden>'
|
15
|
+
cfg.gsub! /(password \d+) (\S+).*/, '\\1 <secret hidden>'
|
15
16
|
cfg.gsub! /^(enable secret).*/, '\\1 <configuration removed>'
|
16
17
|
cfg.gsub! /^(tacacs-server key \d+).*/, '\\1 <configuration removed>'
|
17
18
|
cfg
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class Firebrick < Oxidized::Model
|
2
|
+
# Firebrick #
|
3
|
+
prompt /\x0a\x1b\x5b\x32\x4b\x0d.*>\s/
|
4
|
+
|
5
|
+
cmd :all do |cfg|
|
6
|
+
# remove arbitrary whitespace after commands.
|
7
|
+
cfg.each_line.to_a[1..-2].drop_while { |e| e.match /^\s+$/ }.join
|
8
|
+
end
|
9
|
+
|
10
|
+
cmd 'show status' do |cfg|
|
11
|
+
cfg.gsub! /Status/, ''
|
12
|
+
cfg.gsub! /------/, ''
|
13
|
+
cfg.gsub! /Uptime.*/, ''
|
14
|
+
cfg.gsub! /Current time.*/, ''
|
15
|
+
cfg.gsub! /RAM.*/, ''
|
16
|
+
cfg.gsub! /Warranty.*/, ''
|
17
|
+
|
18
|
+
comment cfg
|
19
|
+
end
|
20
|
+
|
21
|
+
cmd 'show configuration'
|
22
|
+
|
23
|
+
cfg :telnet do
|
24
|
+
username /Username:\s?/
|
25
|
+
password /Password:\s?/
|
26
|
+
end
|
27
|
+
|
28
|
+
cfg :telnet, :ssh do
|
29
|
+
pre_logout 'exit'
|
30
|
+
end
|
31
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class FortiOS < Oxidized::Model
|
2
2
|
comment '# '
|
3
3
|
|
4
|
-
prompt /^([-\w
|
4
|
+
prompt /^([-\w.~]+(\s[(\w\-.)]+)?~?\s?[#>$]\s?)$/
|
5
5
|
|
6
6
|
expect /^--More--\s$/ do |data, re|
|
7
7
|
send ' '
|
@@ -19,9 +19,10 @@ class FortiOS < Oxidized::Model
|
|
19
19
|
cfg.gsub! /(set .*secret) .+/, '\\1 <configuration removed>'
|
20
20
|
# A number of other statements also contains sensitive strings
|
21
21
|
cfg.gsub! /(set (?:passwd|password|key|group-password|auth-password-l1|auth-password-l2|rsso|history0|history1)) .+/, '\\1 <configuration removed>'
|
22
|
-
cfg.gsub! /(set
|
23
|
-
cfg.gsub! /(set
|
24
|
-
cfg.gsub! /(set
|
22
|
+
cfg.gsub! /(set md5-key [0-9]+) .+/, '\\1 <configuration removed>'
|
23
|
+
cfg.gsub! /(set private-key ).*?-+END (ENCRYPTED|RSA) PRIVATE KEY-*"$/m, '\\1<configuration removed>'
|
24
|
+
cfg.gsub! /(set ca ).*?-+END CERTIFICATE-*"$/m, '\\1<configuration removed>'
|
25
|
+
cfg.gsub! /(set csr ).*?-+END CERTIFICATE REQUEST-*"$/m, '\\1<configuration removed>'
|
25
26
|
cfg.gsub! /(Cluster uptime:).*/, '\\1 <stripped>'
|
26
27
|
cfg
|
27
28
|
end
|
data/lib/oxidized/model/ftos.rb
CHANGED
@@ -9,7 +9,10 @@ class FTOS < Oxidized::Model
|
|
9
9
|
|
10
10
|
cmd :secret do |cfg|
|
11
11
|
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
|
12
|
-
cfg.gsub! /secret
|
12
|
+
cfg.gsub! /(secret \d* {0,1})\S+(.*)/, '\\1<secret hidden>\\2'
|
13
|
+
cfg.gsub! /(password \d+) \S+(.*)/, '\\1 <hash hidden>\\2'
|
14
|
+
cfg.gsub! /(^snmp-server.*version \S+) \S+(.*)/, '\\1 <community removed>\\2'
|
15
|
+
cfg.gsub! /(^radius-server.*key \d )\S+/, '\\1<hash hidden>\\2'
|
13
16
|
cfg
|
14
17
|
end
|
15
18
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class FujitsuPY < Oxidized::Model
|
2
|
-
prompt /^(\([\w.-]*\)\s#|^\S
|
2
|
+
prompt /^(\([\w.-]*\)\s#|^\S+#\s)$/
|
3
3
|
comment '! '
|
4
4
|
|
5
5
|
cmd :all do |cfg|
|
6
|
-
cfg.
|
6
|
+
cfg.cut_both
|
7
7
|
end
|
8
8
|
|
9
9
|
# 1Gbe switch
|
@@ -16,7 +16,7 @@ class FujitsuPY < Oxidized::Model
|
|
16
16
|
cmd 'show system information' do |cfg|
|
17
17
|
cfg.gsub! /^Current-time : [\w\s:]*$/, ''
|
18
18
|
cfg.gsub! /^(\s{33}\^)$/, ''
|
19
|
-
cfg.gsub! /^(
|
19
|
+
cfg.gsub! /^(% Invalid input detected at '\^' marker.)$/, ''
|
20
20
|
comment cfg
|
21
21
|
end
|
22
22
|
|
@@ -22,7 +22,7 @@ class GcomBNPS < Oxidized::Model
|
|
22
22
|
|
23
23
|
cmd :all do |cfg|
|
24
24
|
cfg = cfg.gsub " \e[73D\e[K", '' # remove garbage remaining from the pager
|
25
|
-
cfg.
|
25
|
+
cfg.cut_both
|
26
26
|
end
|
27
27
|
|
28
28
|
cmd :secret do |cfg|
|
@@ -42,6 +42,7 @@ class GcomBNPS < Oxidized::Model
|
|
42
42
|
next if line.match /^ Bias Current\(mA\)/
|
43
43
|
next if line.match /^ RX Power\(dBM\)/
|
44
44
|
next if line.match /^ TX Power\(dBM\)/
|
45
|
+
|
45
46
|
out << line
|
46
47
|
end
|
47
48
|
|
@@ -57,6 +58,7 @@ class GcomBNPS < Oxidized::Model
|
|
57
58
|
cfg.each_line do |line|
|
58
59
|
next if line.match /^system run time :/
|
59
60
|
next if line.match /^switch temperature :/
|
61
|
+
|
60
62
|
out << line
|
61
63
|
end
|
62
64
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class Hirschmann < Oxidized::Model
|
2
|
-
prompt /^[
|
2
|
+
prompt /^[(\w\s)]+\s[>|#]+?$/
|
3
3
|
|
4
4
|
comment '## '
|
5
5
|
|
@@ -10,7 +10,7 @@ class Hirschmann < Oxidized::Model
|
|
10
10
|
end
|
11
11
|
|
12
12
|
cmd :all do |cfg|
|
13
|
-
cfg.
|
13
|
+
cfg.cut_both
|
14
14
|
end
|
15
15
|
|
16
16
|
cmd 'show sysinfo' do |cfg|
|
data/lib/oxidized/model/ios.rb
CHANGED
@@ -20,21 +20,27 @@ class IOS < Oxidized::Model
|
|
20
20
|
# cfg.gsub! /\cH+/, '' # example how to handle pager
|
21
21
|
# get rid of errors for commands that don't work on some devices
|
22
22
|
cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
|
23
|
-
cfg.
|
23
|
+
cfg.cut_both
|
24
24
|
end
|
25
25
|
|
26
26
|
cmd :secret do |cfg|
|
27
27
|
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
|
28
28
|
cfg.gsub! /^(snmp-server host \S+( vrf \S+)?( version (1|2c|3))?)\s+\S+((\s+\S*)*)\s*/, '\\1 <secret hidden> \\5'
|
29
|
-
cfg.gsub! /^(username
|
30
|
-
cfg.gsub! /^(
|
31
|
-
cfg.gsub! /^(username \S+ secret \d) (\S+)/, '\\1 <secret hidden>'
|
32
|
-
cfg.gsub! /^(enable (password|secret) \d) (\S+)/, '\\1 <secret hidden>'
|
29
|
+
cfg.gsub! /^(username .+ (password|secret) \d) .+/, '\\1 <secret hidden>'
|
30
|
+
cfg.gsub! /^(enable (password|secret)( level \d+)? \d) .+/, '\\1 <secret hidden>'
|
33
31
|
cfg.gsub! /^(\s+(?:password|secret)) (?:\d )?\S+/, '\\1 <secret hidden>'
|
34
32
|
cfg.gsub! /^(.*wpa-psk ascii \d) (\S+)/, '\\1 <secret hidden>'
|
35
33
|
cfg.gsub! /^(.*key 7) (\d.+)/, '\\1 <secret hidden>'
|
36
|
-
cfg.gsub! /^(tacacs-server
|
34
|
+
cfg.gsub! /^(tacacs-server (.+ )?key) .+/, '\\1 <secret hidden>'
|
37
35
|
cfg.gsub! /^(crypto isakmp key) (\S+) (.*)/, '\\1 <secret hidden> \\3'
|
36
|
+
cfg.gsub! /^(\s+ip ospf message-digest-key \d+ md5) .+/, '\\1 <secret hidden>'
|
37
|
+
cfg.gsub! /^(\s+ip ospf authentication-key) .+/, '\\1 <secret hidden>'
|
38
|
+
cfg.gsub! /^(\s+neighbor \S+ password) .+/, '\\1 <secret hidden>'
|
39
|
+
cfg.gsub! /^(\s+vrrp \d+ authentication text) .+/, '\\1 <secret hidden>'
|
40
|
+
cfg.gsub! /^(\s+standby \d+ authentication) .{1,8}$/, '\\1 <secret hidden>'
|
41
|
+
cfg.gsub! /^(\s+standby \d+ authentication md5 key-string) .+?( timeout \d+)?$/, '\\1 <secret hidden> \\2'
|
42
|
+
cfg.gsub! /^(\s+key-string) .+/, '\\1 <secret hidden>'
|
43
|
+
cfg.gsub! /^((tacacs|radius) server [^\n]+\n(\s+[^\n]+\n)*\s+key) [^\n]+$/m, '\1 <secret hidden>'
|
38
44
|
cfg
|
39
45
|
end
|
40
46
|
|
@@ -97,7 +103,7 @@ class IOS < Oxidized::Model
|
|
97
103
|
comments << "CPU:#{slave} #{cpu}#{cpuxtra}#{slaveslot}";
|
98
104
|
end
|
99
105
|
|
100
|
-
if line.match /^System image file is "([
|
106
|
+
if line.match /^System image file is "([^"]*)"$/
|
101
107
|
comments << "Image: #{$1}"
|
102
108
|
end
|
103
109
|
end
|
@@ -119,9 +125,9 @@ class IOS < Oxidized::Model
|
|
119
125
|
cfg = cfg.each_line.to_a[3..-1]
|
120
126
|
cfg = cfg.reject { |line| line.match /^ntp clock-period / }.join
|
121
127
|
cfg.gsub! /^Current configuration : [^\n]*\n/, ''
|
122
|
-
cfg.gsub!
|
123
|
-
(
|
124
|
-
tunnel
|
128
|
+
cfg.gsub! /^ tunnel mpls traffic-eng bandwidth[^\n]*\n*(
|
129
|
+
(?: [^\n]*\n*)*
|
130
|
+
tunnel mpls traffic-eng auto-bw)/mx, '\1'
|
125
131
|
cfg
|
126
132
|
end
|
127
133
|
|
@@ -132,9 +138,11 @@ class IOS < Oxidized::Model
|
|
132
138
|
|
133
139
|
cfg :telnet, :ssh do
|
134
140
|
# preferred way to handle additional passwords
|
135
|
-
|
136
|
-
|
137
|
-
|
141
|
+
post_login do
|
142
|
+
if vars(:enable) == true
|
143
|
+
cmd "enable"
|
144
|
+
elsif vars(:enable)
|
145
|
+
cmd "enable", /^[pP]assword:/
|
138
146
|
cmd vars(:enable)
|
139
147
|
end
|
140
148
|
end
|
data/lib/oxidized/model/ipos.rb
CHANGED
@@ -6,15 +6,15 @@ class IPOS < Oxidized::Model
|
|
6
6
|
comment '! '
|
7
7
|
|
8
8
|
cmd 'show chassis' do |cfg|
|
9
|
-
comment cfg.
|
9
|
+
comment cfg.cut_tail
|
10
10
|
end
|
11
11
|
|
12
12
|
cmd 'show hardware' do |cfg|
|
13
|
-
comment cfg.
|
13
|
+
comment cfg.cut_tail
|
14
14
|
end
|
15
15
|
|
16
16
|
cmd 'show release' do |cfg|
|
17
|
-
comment cfg.
|
17
|
+
comment cfg.cut_tail
|
18
18
|
end
|
19
19
|
|
20
20
|
cmd 'show configuration' do |cfg|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class IronWare < Oxidized::Model
|
2
|
-
prompt /^.*(telnet|ssh)
|
2
|
+
prompt /^.*(telnet|ssh)@.+[>#]\s?$/i
|
3
3
|
comment '! '
|
4
4
|
|
5
5
|
# to handle pager without enable
|
@@ -30,8 +30,8 @@ class IronWare < Oxidized::Model
|
|
30
30
|
cmd 'show chassis' do |cfg|
|
31
31
|
cfg.encode!("UTF-8", :invalid => :replace, :undef => :replace) # sometimes ironware returns broken encoding
|
32
32
|
cfg.gsub! /(^((.*)Current temp(.*))$)/, '' # remove unwanted lines current temperature
|
33
|
-
cfg.gsub! /Speed = [A-Z-]{2,6} \(\d{2,3}
|
34
|
-
cfg.gsub! /current speed is [A-Z]{2,6} \(\d{2,3}
|
33
|
+
cfg.gsub! /Speed = [A-Z-]{2,6} \(\d{2,3}%\)/, '' # remove unwanted lines Speed Fans
|
34
|
+
cfg.gsub! /current speed is [A-Z]{2,6} \(\d{2,3}%\)/, ''
|
35
35
|
cfg.gsub! /Fan \d* - STATUS: OK \D*\d*./, '' # Fix for ADX Fan speed reporting
|
36
36
|
cfg.gsub! /\d* deg C/, '' # Fix for ADX temperature reporting
|
37
37
|
cfg.gsub! /([\[]*)1([\]]*)<->([\[]*)2([\]]*)(<->([\[]*)3([\]]*))*/, ''
|
data/lib/oxidized/model/isam.rb
CHANGED
data/lib/oxidized/model/junos.rb
CHANGED
@@ -6,7 +6,7 @@ class JunOS < Oxidized::Model
|
|
6
6
|
end
|
7
7
|
|
8
8
|
cmd :all do |cfg|
|
9
|
-
cfg = cfg.
|
9
|
+
cfg = cfg.cut_both if screenscrape
|
10
10
|
cfg.gsub!(/ scale-subscriber (\s+)(\d+)/, ' scale-subscriber <count>')
|
11
11
|
cfg.lines.map { |line| line.rstrip }.join("\n") + "\n"
|
12
12
|
end
|
@@ -10,13 +10,12 @@ class MasterOS < Oxidized::Model
|
|
10
10
|
end
|
11
11
|
|
12
12
|
cmd :all do |cfg|
|
13
|
-
cfg.
|
13
|
+
cfg.cut_both
|
14
14
|
cfg.gsub /^(! Configuration ).*/, '!'
|
15
15
|
end
|
16
16
|
|
17
17
|
cmd 'show inventory' do |cfg|
|
18
|
-
|
19
|
-
comment cfg
|
18
|
+
comment cfg.cut_tail
|
20
19
|
end
|
21
20
|
|
22
21
|
cmd 'show plugins' do |cfg|
|
@@ -3,7 +3,7 @@ class MLNXOS < Oxidized::Model
|
|
3
3
|
comment '## '
|
4
4
|
|
5
5
|
# Pager Handling
|
6
|
-
expect /.+lines\s\d
|
6
|
+
expect /.+lines\s\d+-\d+([\s]|\/\d+\s\(END\)\s).+$/ do |data, re|
|
7
7
|
send ' '
|
8
8
|
data.sub re, ''
|
9
9
|
end
|
@@ -12,10 +12,10 @@ class MLNXOS < Oxidized::Model
|
|
12
12
|
cfg.gsub! /\[\?1h=\r/, '' # Pager Handling
|
13
13
|
cfg.gsub! /\r\[K/, '' # Pager Handling
|
14
14
|
cfg.gsub! /\s/, '' # Linebreak Handling
|
15
|
-
cfg.gsub! /^CPU
|
16
|
-
cfg.gsub! /^System
|
17
|
-
cfg.gsub! /^Uptime
|
18
|
-
cfg.gsub! /.+Generated
|
15
|
+
cfg.gsub! /^CPU load averages:\s.+/, '' # Omit constantly changing CPU info
|
16
|
+
cfg.gsub! /^System memory:\s.+/, '' # Omit constantly changing memory info
|
17
|
+
cfg.gsub! /^Uptime:\s.+/, '' # Omit constantly changing uptime info
|
18
|
+
cfg.gsub! /.+Generated at\s\d+.+/, '' # Omit constantly changing generation time info
|
19
19
|
cfg = cfg.lines.to_a[2..-3].join
|
20
20
|
end
|
21
21
|
|