oxidized 0.25.1 → 0.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +30 -9
- data/.rubocop_todo.yml +16 -637
- data/.travis.yml +2 -3
- data/CHANGELOG.md +14 -0
- data/Dockerfile +7 -5
- data/README.md +18 -14
- data/Rakefile +2 -2
- data/bin/console +1 -1
- data/bin/oxidized +2 -2
- data/docs/Configuration.md +6 -0
- data/docs/Model-Notes/README.md +1 -0
- data/docs/Model-Notes/SmartAX-Huawei.md +35 -0
- data/docs/Supported-OS-Types.md +12 -0
- data/extra/nagios_check_failing_nodes.rb +1 -1
- data/extra/rest_client.rb +6 -8
- data/extra/syslog.rb +33 -33
- data/lib/oxidized/cli.rb +25 -26
- data/lib/oxidized/config.rb +9 -9
- data/lib/oxidized/config/vars.rb +3 -7
- data/lib/oxidized/core.rb +4 -7
- data/lib/oxidized/hook.rb +16 -17
- data/lib/oxidized/hook/awssns.rb +4 -4
- data/lib/oxidized/hook/exec.rb +16 -20
- data/lib/oxidized/hook/githubrepo.rb +8 -14
- data/lib/oxidized/hook/noophook.rb +1 -1
- data/lib/oxidized/hook/xmppdiff.rb +1 -1
- data/lib/oxidized/input/cli.rb +12 -12
- data/lib/oxidized/input/ftp.rb +8 -8
- data/lib/oxidized/input/http.rb +37 -14
- data/lib/oxidized/input/input.rb +6 -6
- data/lib/oxidized/input/ssh.rb +31 -31
- data/lib/oxidized/input/telnet.rb +24 -24
- data/lib/oxidized/input/tftp.rb +9 -10
- data/lib/oxidized/jobs.rb +7 -7
- data/lib/oxidized/manager.rb +13 -13
- data/lib/oxidized/model/acos.rb +2 -2
- data/lib/oxidized/model/aireos.rb +3 -3
- data/lib/oxidized/model/aos7.rb +1 -1
- data/lib/oxidized/model/aosw.rb +12 -14
- data/lib/oxidized/model/apc_aos.rb +1 -1
- data/lib/oxidized/model/aricentiss.rb +6 -8
- data/lib/oxidized/model/asa.rb +1 -1
- data/lib/oxidized/model/audiocodesmp.rb +28 -0
- data/lib/oxidized/model/awplus.rb +9 -9
- data/lib/oxidized/model/boss.rb +1 -1
- data/lib/oxidized/model/ciscosmb.rb +1 -1
- data/lib/oxidized/model/ciscovpn3k.rb +11 -0
- data/lib/oxidized/model/comware.rb +1 -1
- data/lib/oxidized/model/cumulus.rb +3 -1
- data/lib/oxidized/model/dellx.rb +5 -5
- data/lib/oxidized/model/edgeos.rb +1 -1
- data/lib/oxidized/model/edgeswitch.rb +1 -1
- data/lib/oxidized/model/fabricos.rb +1 -1
- data/lib/oxidized/model/fortios.rb +5 -5
- data/lib/oxidized/model/ftos.rb +1 -1
- data/lib/oxidized/model/gcombnps.rb +7 -7
- data/lib/oxidized/model/grandstream.rb +9 -0
- data/lib/oxidized/model/hatteras.rb +8 -8
- data/lib/oxidized/model/ios.rb +22 -40
- data/lib/oxidized/model/ironware.rb +1 -1
- data/lib/oxidized/model/junos.rb +1 -1
- data/lib/oxidized/model/mlnxos.rb +1 -1
- data/lib/oxidized/model/model.rb +32 -38
- data/lib/oxidized/model/netgearxs716.rb +23 -0
- data/lib/oxidized/model/netonix.rb +1 -1
- data/lib/oxidized/model/netscaler.rb +1 -1
- data/lib/oxidized/model/nos.rb +2 -2
- data/lib/oxidized/model/nxos.rb +1 -1
- data/lib/oxidized/model/openbsd.rb +3 -2
- data/lib/oxidized/model/outputs.rb +4 -4
- data/lib/oxidized/model/planet.rb +4 -4
- data/lib/oxidized/model/powerconnect.rb +8 -8
- data/lib/oxidized/model/procurve.rb +2 -1
- data/lib/oxidized/model/quantaos.rb +3 -3
- data/lib/oxidized/model/raisecom.rb +19 -0
- data/lib/oxidized/model/siklu.rb +1 -1
- data/lib/oxidized/model/slxos.rb +1 -1
- data/lib/oxidized/model/smartax.rb +25 -0
- data/lib/oxidized/model/sros.rb +4 -4
- data/lib/oxidized/model/tdre.rb +30 -0
- data/lib/oxidized/model/tmos.rb +3 -0
- data/lib/oxidized/model/trango.rb +17 -37
- data/lib/oxidized/model/voltaire.rb +1 -1
- data/lib/oxidized/model/voss.rb +1 -1
- data/lib/oxidized/model/vyatta.rb +1 -1
- data/lib/oxidized/model/xos.rb +1 -1
- data/lib/oxidized/model/zhoneolt.rb +1 -1
- data/lib/oxidized/node.rb +42 -46
- data/lib/oxidized/node/stats.rb +6 -6
- data/lib/oxidized/nodes.rb +42 -42
- data/lib/oxidized/output/file.rb +16 -20
- data/lib/oxidized/output/git.rb +68 -78
- data/lib/oxidized/output/gitcrypt.rb +77 -91
- data/lib/oxidized/output/http.rb +17 -19
- data/lib/oxidized/output/output.rb +1 -1
- data/lib/oxidized/source/csv.rb +3 -3
- data/lib/oxidized/source/http.rb +11 -14
- data/lib/oxidized/source/source.rb +3 -3
- data/lib/oxidized/source/sql.rb +16 -18
- data/lib/oxidized/string.rb +10 -10
- data/lib/oxidized/version.rb +4 -4
- data/lib/oxidized/worker.rb +15 -15
- data/oxidized.gemspec +6 -9
- metadata +32 -25
data/lib/oxidized/manager.rb
CHANGED
@@ -5,13 +5,13 @@ module Oxidized
|
|
5
5
|
require 'oxidized/source/source'
|
6
6
|
class Manager
|
7
7
|
class << self
|
8
|
-
def load
|
8
|
+
def load(dir, file)
|
9
9
|
require File.join dir, file + '.rb'
|
10
10
|
klass = nil
|
11
11
|
[Oxidized, Object].each do |mod|
|
12
|
-
klass
|
13
|
-
klass
|
14
|
-
klass
|
12
|
+
klass = mod.constants.find { |const| const.to_s.casecmp(file).zero? }
|
13
|
+
klass ||= mod.constants.find { |const| const.to_s.downcase == 'oxidized' + file.downcase }
|
14
|
+
klass = mod.const_get klass if klass
|
15
15
|
break if klass
|
16
16
|
end
|
17
17
|
i = klass.new
|
@@ -31,33 +31,33 @@ module Oxidized
|
|
31
31
|
@hook = {}
|
32
32
|
end
|
33
33
|
|
34
|
-
def add_input
|
34
|
+
def add_input(name)
|
35
35
|
loader @input, Config::InputDir, "input", name
|
36
36
|
end
|
37
37
|
|
38
|
-
def add_output
|
38
|
+
def add_output(name)
|
39
39
|
loader @output, Config::OutputDir, "output", name
|
40
40
|
end
|
41
41
|
|
42
|
-
def add_source
|
42
|
+
def add_source(name)
|
43
43
|
loader @source, Config::SourceDir, "source", name
|
44
44
|
end
|
45
45
|
|
46
|
-
def add_model
|
46
|
+
def add_model(name)
|
47
47
|
loader @model, Config::ModelDir, "model", name
|
48
48
|
end
|
49
49
|
|
50
|
-
def add_hook
|
50
|
+
def add_hook(name)
|
51
51
|
loader @hook, Config::HookDir, "hook", name
|
52
52
|
end
|
53
53
|
|
54
54
|
private
|
55
55
|
|
56
56
|
# if local version of file exists, load it, else load global - return falsy value if nothing loaded
|
57
|
-
def loader
|
58
|
-
dir
|
59
|
-
map
|
60
|
-
map
|
57
|
+
def loader(hash, global_dir, local_dir, name)
|
58
|
+
dir = File.join(Config::Root, local_dir)
|
59
|
+
map = Manager.load(dir, name) if File.exist? File.join(dir, name + ".rb")
|
60
|
+
map ||= Manager.load(global_dir, name)
|
61
61
|
hash.merge!(map) if map
|
62
62
|
end
|
63
63
|
end
|
data/lib/oxidized/model/acos.rb
CHANGED
@@ -51,9 +51,9 @@ class ACOS < Oxidized::Model
|
|
51
51
|
|
52
52
|
cmd 'show aflex all-partitions' do |cfg|
|
53
53
|
@partitions_aflex = cfg.lines.each_with_object({}) do |l, h|
|
54
|
-
h[
|
54
|
+
h[Regexp.last_match(1)] = [] if l =~ /partition: (.+)/
|
55
55
|
# only consider scripts that have passed syntax check
|
56
|
-
h[h.keys.last] <<
|
56
|
+
h[h.keys.last] << Regexp.last_match(1) if l =~ /^([\w-]+) +Check/
|
57
57
|
end
|
58
58
|
''
|
59
59
|
end
|
@@ -39,11 +39,11 @@ class Aireos < Oxidized::Model
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
def clean
|
42
|
+
def clean(cfg)
|
43
43
|
out = []
|
44
44
|
cfg.each_line do |line|
|
45
|
-
next if line
|
46
|
-
next if line
|
45
|
+
next if line =~ /^\s*$/
|
46
|
+
next if line =~ /rogue (adhoc|client) (alert|Unknown) [\da-f]{2}:/
|
47
47
|
|
48
48
|
line = line[1..-1] if line[0] == "\r"
|
49
49
|
out << line.strip
|
data/lib/oxidized/model/aos7.rb
CHANGED
@@ -17,7 +17,7 @@ class AOS7 < Oxidized::Model
|
|
17
17
|
cmd 'show chassis' do |cfg|
|
18
18
|
# check for virtual chassis existence
|
19
19
|
@slave_vcids = cfg.scan(/Chassis ID (\d+) \(Slave\)/).flatten
|
20
|
-
@master_vcid =
|
20
|
+
@master_vcid = Regexp.last_match(1) if cfg =~ /Chassis ID (\d+) \(Master\)/
|
21
21
|
comment cfg
|
22
22
|
end
|
23
23
|
|
data/lib/oxidized/model/aosw.rb
CHANGED
@@ -44,25 +44,25 @@ class AOSW < Oxidized::Model
|
|
44
44
|
end
|
45
45
|
|
46
46
|
cmd 'show inventory' do |cfg|
|
47
|
-
cfg = "" if cfg
|
47
|
+
cfg = "" if cfg =~ /(Invalid input detected at '\^' marker|Parse error)/ # Don't show for unsupported devices (IAP and MAS)
|
48
48
|
rstrip_cfg clean cfg
|
49
49
|
end
|
50
50
|
|
51
51
|
cmd 'show slots' do |cfg|
|
52
|
-
cfg = "" if cfg
|
52
|
+
cfg = "" if cfg =~ /(Invalid input detected at '\^' marker|Parse error)/ # Don't show for unsupported devices (IAP and MAS)
|
53
53
|
rstrip_cfg comment cfg
|
54
54
|
end
|
55
55
|
|
56
56
|
cmd 'show license' do |cfg|
|
57
|
-
cfg = "" if cfg
|
57
|
+
cfg = "" if cfg =~ /(Invalid input detected at '\^' marker|Parse error)/ # Don't show for unsupported devices (IAP and MAS)
|
58
58
|
rstrip_cfg comment cfg
|
59
59
|
end
|
60
60
|
|
61
61
|
cmd 'show running-config' do |cfg|
|
62
62
|
out = []
|
63
63
|
cfg.each_line do |line|
|
64
|
-
next if line
|
65
|
-
next if line
|
64
|
+
next if line =~ /^controller config \d+$/
|
65
|
+
next if line =~ /^Building Configuration/
|
66
66
|
|
67
67
|
out << line.strip
|
68
68
|
end
|
@@ -84,13 +84,11 @@ class AOSW < Oxidized::Model
|
|
84
84
|
end
|
85
85
|
post_login 'no paging'
|
86
86
|
post_login 'encrypt disable'
|
87
|
-
if vars :enable
|
88
|
-
pre_logout 'exit'
|
89
|
-
end
|
87
|
+
pre_logout 'exit' if vars :enable
|
90
88
|
pre_logout 'exit'
|
91
89
|
end
|
92
90
|
|
93
|
-
def rstrip_cfg
|
91
|
+
def rstrip_cfg(cfg)
|
94
92
|
out = []
|
95
93
|
cfg.each_line do |line|
|
96
94
|
out << line.rstrip
|
@@ -99,14 +97,14 @@ class AOSW < Oxidized::Model
|
|
99
97
|
out << "\n"
|
100
98
|
end
|
101
99
|
|
102
|
-
def clean
|
100
|
+
def clean(cfg)
|
103
101
|
out = []
|
104
102
|
cfg.each_line do |line|
|
105
103
|
# drop the temperature, fan speed and voltage, which change each run
|
106
|
-
next if line
|
107
|
-
next if line
|
108
|
-
next if line
|
109
|
-
next if line
|
104
|
+
next if line =~ /Output \d Config/i
|
105
|
+
next if line =~ /(Tachometers|Temperatures|Voltages)/
|
106
|
+
next if line =~ /((Card|CPU) Temperature|Chassis Fan|VMON1[0-9])/
|
107
|
+
next if line =~ /[0-9]+\s+(RPMS?|m?V|C)/i
|
110
108
|
|
111
109
|
out << line.strip
|
112
110
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# 0 SSE-G48-TG4 (P2-01) 1.0.16-9
|
5
5
|
|
6
6
|
class AricentISS < Oxidized::Model
|
7
|
-
prompt
|
7
|
+
prompt /^(\e\[27m)?[ \r]*[\w-]+# ?$/
|
8
8
|
|
9
9
|
cfg :ssh do
|
10
10
|
# "pagination" was misspelled in some (earlier) versions (at least 1.0.16-9)
|
@@ -33,19 +33,17 @@ class AricentISS < Oxidized::Model
|
|
33
33
|
|
34
34
|
cmd 'show running-config' do |cfg|
|
35
35
|
comment_next = 0
|
36
|
-
cfg.each_line.map
|
37
|
-
next '' if l
|
36
|
+
cfg.each_line.map do |l|
|
37
|
+
next '' if l =~ /^Building configuration/
|
38
38
|
|
39
|
-
if l
|
40
|
-
comment_next = 2
|
41
|
-
end
|
39
|
+
comment_next = 2 if l =~ /^Switch ID.*Hardware Version.*Firmware Version/
|
42
40
|
|
43
|
-
if comment_next
|
41
|
+
if comment_next.positive?
|
44
42
|
comment_next -= 1
|
45
43
|
next comment(l)
|
46
44
|
end
|
47
45
|
|
48
46
|
l
|
49
|
-
|
47
|
+
end.join.gsub(/ +$/, '')
|
50
48
|
end
|
51
49
|
end
|
data/lib/oxidized/model/asa.rb
CHANGED
@@ -69,7 +69,7 @@ class ASA < Oxidized::Model
|
|
69
69
|
anyconnect_profiles = cfg.scan(Regexp.new('(\sdisk0:/.+\.xml)')).flatten
|
70
70
|
anyconnect_profiles.each do |profile|
|
71
71
|
cfg << (comment profile + "\n")
|
72
|
-
cmd
|
72
|
+
cmd("more" + profile) do |xml|
|
73
73
|
cfg << (comment xml)
|
74
74
|
end
|
75
75
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class AudioCodesMP < Oxidized::Model
|
2
|
+
# AudioCodes MediaPack MP1xx and Mediant 1000 devices (firmware v4.xx, v5.xx, v6.xx) by pedjajks@gmail.com
|
3
|
+
|
4
|
+
prompt /^\/\w*>/
|
5
|
+
|
6
|
+
comment ';'
|
7
|
+
|
8
|
+
cmd 'conf' do
|
9
|
+
end
|
10
|
+
|
11
|
+
cmd 'cf get' do |cfg|
|
12
|
+
lines = cfg.each_line.to_a[0..-1]
|
13
|
+
# remove any garbage before ';**************' and after '; End of INI file.'
|
14
|
+
lines[lines.index(";**************\r\n")..lines.index("; End of INI file.\n")].join
|
15
|
+
end
|
16
|
+
|
17
|
+
cfg :ssh do
|
18
|
+
username /^login as:\s$/
|
19
|
+
password /^.+password:\s$/
|
20
|
+
pre_logout 'exit'
|
21
|
+
end
|
22
|
+
|
23
|
+
cfg :telnet do
|
24
|
+
username /login:\s$/
|
25
|
+
password /password:\s$/
|
26
|
+
pre_logout 'exit'
|
27
|
+
end
|
28
|
+
end
|
@@ -15,7 +15,7 @@ class AWPlus < Oxidized::Model
|
|
15
15
|
cmd :all do |cfg|
|
16
16
|
cfg.gsub! /\e\[K/, '' # example how to handle pager - cleareol EL0
|
17
17
|
cfg.gsub! /\e\[7m\e\[m/, '' # example how to handle pager - Reverse SGR7
|
18
|
-
cfg.
|
18
|
+
cfg.delete! "\r" # Filters rogue ^M - see issue #415
|
19
19
|
cfg.cut_both
|
20
20
|
end
|
21
21
|
|
@@ -43,14 +43,14 @@ class AWPlus < Oxidized::Model
|
|
43
43
|
comment cfg << "\n--------------------------------------------------------------------------------! \n \n"
|
44
44
|
# Removes the following lines from "show system" in output file. This ensures oxidized diffs are meaningful.
|
45
45
|
comment cfg.each_line.reject { |line|
|
46
|
-
line.match
|
47
|
-
line.match
|
48
|
-
line.match
|
49
|
-
line.match
|
50
|
-
line.match
|
51
|
-
line.match
|
52
|
-
line.match
|
53
|
-
line.match
|
46
|
+
line.match(/^$\n/) || # Remove blank lines in "sh sys"
|
47
|
+
line.match(/System Status\s*.*/) ||
|
48
|
+
line.match(/RAM\s*:.*/) ||
|
49
|
+
line.match(/Uptime\s*:.*/) ||
|
50
|
+
line.match(/Flash\s*:.*/) ||
|
51
|
+
line.match(/Current software\s*:.*/) ||
|
52
|
+
line.match(/Software version\s*:.*/) ||
|
53
|
+
line.match(/Build date\s*:.*/)
|
54
54
|
} .join
|
55
55
|
end
|
56
56
|
|
data/lib/oxidized/model/boss.rb
CHANGED
@@ -37,7 +37,7 @@ class Boss < Oxidized::Model
|
|
37
37
|
|
38
38
|
# Do a sys-info and check and see if it supports stack
|
39
39
|
cmd 'show sys-info' do |cfg|
|
40
|
-
@stack = true if cfg
|
40
|
+
@stack = true if cfg =~ /Stack/
|
41
41
|
cfg.gsub! /(^((.*)sysUpTime(.*))$)/, 'removed sysUpTime'
|
42
42
|
cfg.gsub! /(^((.*)sysNtpTime(.*))$)/, 'removed sysNtpTime'
|
43
43
|
cfg.gsub! /(^((.*)sysRtcTime(.*))$)/, 'removed sysNtpTime'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CiscoVPN3k < Oxidized::Model
|
2
|
+
# Used in Cisco VPN3000 concentrators
|
3
|
+
# it have buggy code 227 reply with whitespace before trailing bracket
|
4
|
+
# "227 Passive mode OK (172,16,0,9,4,9 )"
|
5
|
+
# so use active ftp if you can. Or patch net/ftp
|
6
|
+
|
7
|
+
cmd 'CONFIG'
|
8
|
+
|
9
|
+
cfg :ftp do
|
10
|
+
end
|
11
|
+
end
|
@@ -3,7 +3,7 @@ class Cumulus < Oxidized::Model
|
|
3
3
|
comment '# '
|
4
4
|
|
5
5
|
# add a comment in the final conf
|
6
|
-
def add_comment
|
6
|
+
def add_comment(comment)
|
7
7
|
"\n###### #{comment} ######\n"
|
8
8
|
end
|
9
9
|
|
@@ -80,6 +80,8 @@ class Cumulus < Oxidized::Model
|
|
80
80
|
|
81
81
|
cfg += add_comment 'License'
|
82
82
|
cfg += cmd 'cl-license'
|
83
|
+
|
84
|
+
cfg
|
83
85
|
end
|
84
86
|
|
85
87
|
cfg :telnet do
|
data/lib/oxidized/model/dellx.rb
CHANGED
@@ -21,7 +21,7 @@ class DellX < Oxidized::Model
|
|
21
21
|
|
22
22
|
cmd 'show version' do |cfg|
|
23
23
|
if @stackable.nil?
|
24
|
-
@stackable = true if cfg
|
24
|
+
@stackable = true if cfg =~ /(U|u)nit\s/
|
25
25
|
end
|
26
26
|
cfg = cfg.split("\n").reject { |line| line[/Up\sTime/] }
|
27
27
|
comment cfg.join("\n") + "\n"
|
@@ -52,18 +52,18 @@ class DellX < Oxidized::Model
|
|
52
52
|
pre_logout "exit"
|
53
53
|
end
|
54
54
|
|
55
|
-
def clean
|
55
|
+
def clean(cfg)
|
56
56
|
out = []
|
57
57
|
skip_blocks = 0
|
58
58
|
cfg.each_line do |line|
|
59
59
|
# If this is a stackable switch we should skip this block of information
|
60
|
-
if line.match
|
60
|
+
if line.match(/Up\sTime|Temperature|Power Suppl(ies|y)|Fans/i) && (@stackable == true)
|
61
61
|
skip_blocks = 1
|
62
62
|
# Some switches have another empty line. This is identified by this line having a colon
|
63
|
-
skip_blocks = 2 if line
|
63
|
+
skip_blocks = 2 if line =~ /:/
|
64
64
|
end
|
65
65
|
# If we have lines to skip do this until we reach and empty line
|
66
|
-
if skip_blocks
|
66
|
+
if skip_blocks.positive?
|
67
67
|
skip_blocks -= 1 if /\S/ !~ line
|
68
68
|
next
|
69
69
|
end
|
@@ -6,7 +6,7 @@ class EdgeSwitch < Oxidized::Model
|
|
6
6
|
prompt /\(.*\)\s[#>]/
|
7
7
|
|
8
8
|
cmd 'show running-config' do |cfg|
|
9
|
-
cfg.each_line.to_a[2..-2].reject { |line| line.match
|
9
|
+
cfg.each_line.to_a[2..-2].reject { |line| line.match(/System Up Time.*/) || line.match(/Current SNTP Synchronized Time.*/) }.join
|
10
10
|
end
|
11
11
|
|
12
12
|
cfg :telnet do
|
@@ -6,7 +6,7 @@ class FabricOS < Oxidized::Model
|
|
6
6
|
comment '# '
|
7
7
|
|
8
8
|
cmd 'chassisShow' do |cfg|
|
9
|
-
comment cfg.each_line.reject { |line| line.match
|
9
|
+
comment cfg.each_line.reject { |line| line.match(/Time Awake:/) || line.match(/Power Usage \(Watts\):/) || line.match(/Time Alive:/) || line.match(/Update:/) }.join
|
10
10
|
end
|
11
11
|
|
12
12
|
cmd 'configShow -all' do |cfg|
|
@@ -38,16 +38,16 @@ class FortiOS < Oxidized::Model
|
|
38
38
|
cfg = []
|
39
39
|
cfg << cmd('config global') if @vdom_enabled
|
40
40
|
|
41
|
-
cfg << cmd('get hardware status') do |
|
42
|
-
comment
|
41
|
+
cfg << cmd('get hardware status') do |cfg_hw|
|
42
|
+
comment cfg_hw
|
43
43
|
end
|
44
44
|
|
45
45
|
# default behaviour: include autoupdate output (backwards compatibility)
|
46
46
|
# do not include if variable "show_autoupdate" is set to false
|
47
47
|
if defined?(vars(:fortios_autoupdate)).nil? || vars(:fortios_autoupdate)
|
48
|
-
cfg << cmd('diagnose autoupdate version') do |
|
49
|
-
|
50
|
-
comment
|
48
|
+
cfg << cmd('diagnose autoupdate version') do |cfg_auto|
|
49
|
+
cfg_auto.gsub! /(FDS Address\n---------\n).*/, '\\1IP Address removed'
|
50
|
+
comment cfg_auto.each_line.reject { |line| line.match /Last Update|Result/ }.join
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
data/lib/oxidized/model/ftos.rb
CHANGED
@@ -18,7 +18,7 @@ class FTOS < Oxidized::Model
|
|
18
18
|
|
19
19
|
cmd 'show inventory' do |cfg|
|
20
20
|
# Old versions of FTOS can occasionally return data that triggers encoding errors.
|
21
|
-
cfg.encode!("UTF-8", :
|
21
|
+
cfg.encode!("UTF-8", invalid: :replace, undef: :replace, replace: "")
|
22
22
|
comment cfg
|
23
23
|
end
|
24
24
|
|
@@ -37,11 +37,11 @@ class GcomBNPS < Oxidized::Model
|
|
37
37
|
cmd 'show interface sfp' do |cfg|
|
38
38
|
out = []
|
39
39
|
cfg.each_line do |line|
|
40
|
-
next if line
|
41
|
-
next if line
|
42
|
-
next if line
|
43
|
-
next if line
|
44
|
-
next if line
|
40
|
+
next if line =~ /^ Temperature/
|
41
|
+
next if line =~ /^ Voltage\(V\)/
|
42
|
+
next if line =~ /^ Bias Current\(mA\)/
|
43
|
+
next if line =~ /^ RX Power\(dBM\)/
|
44
|
+
next if line =~ /^ TX Power\(dBM\)/
|
45
45
|
|
46
46
|
out << line
|
47
47
|
end
|
@@ -56,8 +56,8 @@ class GcomBNPS < Oxidized::Model
|
|
56
56
|
cmd 'show system' do |cfg|
|
57
57
|
out = []
|
58
58
|
cfg.each_line do |line|
|
59
|
-
next if line
|
60
|
-
next if line
|
59
|
+
next if line =~ /^system run time :/
|
60
|
+
next if line =~ /^switch temperature :/
|
61
61
|
|
62
62
|
out << line
|
63
63
|
end
|