oxidized 0.28.0 → 0.29.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +31 -0
- data/.github/workflows/codeql.yml +76 -0
- data/.github/workflows/publishdocker.yml +11 -2
- data/.github/workflows/ruby.yml +42 -0
- data/.github/workflows/stale.yml +16 -0
- data/.rubocop.yml +30 -10
- data/.rubocop_todo.yml +97 -43
- data/CHANGELOG.md +149 -2
- data/Dockerfile +15 -9
- data/README.md +63 -32
- data/Rakefile +2 -0
- data/docs/Configuration.md +49 -7
- data/docs/Creating-Models.md +24 -19
- data/docs/Hooks.md +35 -6
- data/docs/Model-Notes/ADVA.md +12 -0
- data/docs/Model-Notes/Cumulus.md +7 -1
- data/docs/Model-Notes/IOS.md +36 -0
- data/docs/Model-Notes/JunOS.md +3 -3
- data/docs/Model-Notes/LenovoNOS.md +29 -0
- data/docs/Model-Notes/LinksysSRW.md +15 -0
- data/docs/Model-Notes/Nokia.md +3 -0
- data/docs/Model-Notes/OS10.md +33 -0
- data/docs/Model-Notes/PanOS_API.md +28 -0
- data/docs/Model-Notes/README.md +2 -0
- data/docs/Ruby-API.md +12 -8
- data/docs/Sources.md +18 -0
- data/docs/Supported-OS-Types.md +51 -6
- data/docs/Troubleshooting.md +1 -1
- data/extra/gitdiff-msteams.sh +91 -0
- data/extra/nagios_check_failing_nodes.rb +6 -9
- data/extra/oxidized-report-git-commits +71 -14
- data/extra/oxidized.init +2 -5
- data/extra/oxidized.logrotate +1 -0
- data/extra/oxidized.runit +4 -1
- data/extra/oxidized.service +5 -8
- data/extra/rest_client.rb +1 -1
- data/extra/syslog.rb +2 -2
- data/lib/oxidized/cli.rb +1 -1
- data/lib/oxidized/config/vars.rb +5 -2
- data/lib/oxidized/config.rb +6 -3
- data/lib/oxidized/core.rb +1 -1
- data/lib/oxidized/hook/exec.rb +6 -6
- data/lib/oxidized/hook/githubrepo.rb +42 -11
- data/lib/oxidized/hook/slackdiff.rb +2 -2
- data/lib/oxidized/hook/xmppdiff.rb +45 -25
- data/lib/oxidized/hook.rb +4 -8
- data/lib/oxidized/input/exec.rb +1 -1
- data/lib/oxidized/input/input.rb +1 -0
- data/lib/oxidized/input/ssh.rb +23 -20
- data/lib/oxidized/input/telnet.rb +52 -44
- data/lib/oxidized/job.rb +1 -0
- data/lib/oxidized/jobs.rb +11 -6
- data/lib/oxidized/manager.rb +1 -0
- data/lib/oxidized/model/acmepacket.rb +40 -0
- data/lib/oxidized/model/acos.rb +3 -1
- data/lib/oxidized/model/acsw.rb +2 -0
- data/lib/oxidized/model/adtran.rb +7 -3
- data/lib/oxidized/model/adva.rb +68 -0
- data/lib/oxidized/model/aen.rb +2 -0
- data/lib/oxidized/model/aireos.rb +2 -0
- data/lib/oxidized/model/airfiber.rb +3 -1
- data/lib/oxidized/model/airos.rb +2 -0
- data/lib/oxidized/model/alteonos.rb +2 -0
- data/lib/oxidized/model/alvarion.rb +2 -0
- data/lib/oxidized/model/aos.rb +2 -0
- data/lib/oxidized/model/aos7.rb +2 -0
- data/lib/oxidized/model/aoscx.rb +98 -0
- data/lib/oxidized/model/aosw.rb +4 -2
- data/lib/oxidized/model/apc_aos.rb +2 -0
- data/lib/oxidized/model/arbos.rb +2 -0
- data/lib/oxidized/model/aricentiss.rb +2 -0
- data/lib/oxidized/model/asa.rb +4 -0
- data/lib/oxidized/model/asyncos.rb +2 -0
- data/lib/oxidized/model/audiocodes.rb +2 -0
- data/lib/oxidized/model/audiocodesmp.rb +2 -0
- data/lib/oxidized/model/awplus.rb +3 -1
- data/lib/oxidized/model/axos.rb +2 -0
- data/lib/oxidized/model/bdcom.rb +51 -0
- data/lib/oxidized/model/boss.rb +3 -1
- data/lib/oxidized/model/br6910.rb +2 -0
- data/lib/oxidized/model/c4cmts.rb +2 -0
- data/lib/oxidized/model/cambium.rb +2 -0
- data/lib/oxidized/model/cambiumepmp.rb +19 -0
- data/lib/oxidized/model/casa.rb +6 -1
- data/lib/oxidized/model/catos.rb +2 -0
- data/lib/oxidized/model/ciscoce.rb +14 -0
- data/lib/oxidized/model/cisconga.rb +2 -0
- data/lib/oxidized/model/ciscosma.rb +2 -0
- data/lib/oxidized/model/ciscosmb.rb +4 -0
- data/lib/oxidized/model/ciscovpn3k.rb +2 -0
- data/lib/oxidized/model/cnos.rb +2 -0
- data/lib/oxidized/model/comnetms.rb +2 -0
- data/lib/oxidized/model/comtrol.rb +2 -0
- data/lib/oxidized/model/comware.rb +17 -1
- data/lib/oxidized/model/coriant8600.rb +2 -0
- data/lib/oxidized/model/coriantgroove.rb +2 -0
- data/lib/oxidized/model/corianttmos.rb +2 -0
- data/lib/oxidized/model/cumulus.rb +60 -44
- data/lib/oxidized/model/datacom.rb +2 -0
- data/lib/oxidized/model/dcnos.rb +2 -0
- data/lib/oxidized/model/dellx.rb +3 -3
- data/lib/oxidized/model/dlink.rb +4 -1
- data/lib/oxidized/model/dnos.rb +2 -0
- data/lib/oxidized/model/eciapollo.rb +2 -0
- data/lib/oxidized/model/edgecos.rb +24 -2
- data/lib/oxidized/model/edgeos.rb +2 -0
- data/lib/oxidized/model/edgeswitch.rb +6 -4
- data/lib/oxidized/model/eltex.rb +50 -0
- data/lib/oxidized/model/enterasys.rb +20 -3
- data/lib/oxidized/model/enterasys800.rb +31 -0
- data/lib/oxidized/model/eos.rb +4 -1
- data/lib/oxidized/model/fabricos.rb +3 -1
- data/lib/oxidized/model/fastiron.rb +5 -2
- data/lib/oxidized/model/fiberdriver.rb +2 -0
- data/lib/oxidized/model/firebrick.rb +2 -0
- data/lib/oxidized/model/firelinuxos.rb +2 -0
- data/lib/oxidized/model/firewareos.rb +2 -0
- data/lib/oxidized/model/fortios.rb +26 -11
- data/lib/oxidized/model/fortiwlc.rb +26 -0
- data/lib/oxidized/model/ftos.rb +2 -0
- data/lib/oxidized/model/fujitsupy.rb +2 -0
- data/lib/oxidized/model/gaiaos.rb +42 -3
- data/lib/oxidized/model/gcombnps.rb +2 -0
- data/lib/oxidized/model/grandstream.rb +2 -0
- data/lib/oxidized/model/h3c.rb +42 -0
- data/lib/oxidized/model/hatteras.rb +4 -2
- data/lib/oxidized/model/hios.rb +40 -0
- data/lib/oxidized/model/hirschmann.rb +2 -0
- data/lib/oxidized/model/hpebladesystem.rb +3 -1
- data/lib/oxidized/model/hpemsa.rb +2 -0
- data/lib/oxidized/model/hpmsm.rb +2 -0
- data/lib/oxidized/model/ibos.rb +2 -0
- data/lib/oxidized/model/icotera.rb +2 -0
- data/lib/oxidized/model/ios.rb +15 -10
- data/lib/oxidized/model/iosxe.rb +1 -1
- data/lib/oxidized/model/iosxr.rb +2 -0
- data/lib/oxidized/model/ipos.rb +2 -0
- data/lib/oxidized/model/ironware.rb +10 -4
- data/lib/oxidized/model/isam.rb +2 -0
- data/lib/oxidized/model/junos.rb +7 -1
- data/lib/oxidized/model/lancom.rb +25 -0
- data/lib/oxidized/model/lenovonos.rb +84 -0
- data/lib/oxidized/model/linksyssrw.rb +73 -0
- data/lib/oxidized/model/linuxgeneric.rb +2 -0
- data/lib/oxidized/model/masteros.rb +2 -0
- data/lib/oxidized/model/mlnxos.rb +4 -0
- data/lib/oxidized/model/model.rb +35 -8
- data/lib/oxidized/model/mtrlrfs.rb +2 -0
- data/lib/oxidized/model/ndms.rb +3 -1
- data/lib/oxidized/model/necix.rb +32 -0
- data/lib/oxidized/model/netgear.rb +7 -2
- data/lib/oxidized/model/netonix.rb +2 -0
- data/lib/oxidized/model/netscaler.rb +40 -1
- data/lib/oxidized/model/nodegrid.rb +25 -0
- data/lib/oxidized/model/nos.rb +2 -0
- data/lib/oxidized/model/nsxconfig.rb +2 -0
- data/lib/oxidized/model/nsxfirewall.rb +2 -0
- data/lib/oxidized/model/nxos.rb +5 -2
- data/lib/oxidized/model/oneos.rb +2 -0
- data/lib/oxidized/model/openbsd.rb +11 -0
- data/lib/oxidized/model/opengear.rb +3 -1
- data/lib/oxidized/model/openwrt.rb +2 -0
- data/lib/oxidized/model/opnsense.rb +14 -4
- data/lib/oxidized/model/os10.rb +2 -0
- data/lib/oxidized/model/outputs.rb +2 -0
- data/lib/oxidized/model/panos.rb +2 -0
- data/lib/oxidized/model/panos_api.rb +73 -0
- data/lib/oxidized/model/pfsense.rb +14 -7
- data/lib/oxidized/model/planet.rb +2 -0
- data/lib/oxidized/model/powerconnect.rb +3 -3
- data/lib/oxidized/model/procurve.rb +4 -2
- data/lib/oxidized/model/purityos.rb +10 -1
- data/lib/oxidized/model/qtech.rb +2 -0
- data/lib/oxidized/model/quantaos.rb +3 -5
- data/lib/oxidized/model/raisecom.rb +2 -0
- data/lib/oxidized/model/routeros.rb +17 -2
- data/lib/oxidized/model/saos.rb +2 -0
- data/lib/oxidized/model/screenos.rb +2 -0
- data/lib/oxidized/model/sgos.rb +2 -0
- data/lib/oxidized/model/siklu.rb +2 -0
- data/lib/oxidized/model/slxos.rb +3 -0
- data/lib/oxidized/model/smartax.rb +2 -0
- data/lib/oxidized/model/smartcs.rb +42 -0
- data/lib/oxidized/model/sonicos.rb +11 -1
- data/lib/oxidized/model/speedtouch.rb +2 -0
- data/lib/oxidized/model/sros.rb +3 -1
- data/lib/oxidized/model/srosmd.rb +99 -0
- data/lib/oxidized/model/stoneos.rb +8 -2
- data/lib/oxidized/model/supermicro.rb +1 -1
- data/lib/oxidized/model/swos.rb +11 -0
- data/lib/oxidized/model/tdre.rb +2 -0
- data/lib/oxidized/model/telco.rb +2 -0
- data/lib/oxidized/model/timos.rb +1 -1
- data/lib/oxidized/model/tmos.rb +5 -2
- data/lib/oxidized/model/tplink.rb +4 -0
- data/lib/oxidized/model/trango.rb +13 -11
- data/lib/oxidized/model/truenas.rb +22 -0
- data/lib/oxidized/model/ucs.rb +2 -0
- data/lib/oxidized/model/viptela.rb +2 -0
- data/lib/oxidized/model/voltaire.rb +2 -0
- data/lib/oxidized/model/voss.rb +2 -0
- data/lib/oxidized/model/vrp.rb +3 -1
- data/lib/oxidized/model/vyatta.rb +2 -0
- data/lib/oxidized/model/weos.rb +2 -0
- data/lib/oxidized/model/xos.rb +6 -3
- data/lib/oxidized/model/yamaha.rb +59 -0
- data/lib/oxidized/model/zhoneolt.rb +2 -0
- data/lib/oxidized/model/zteolt.rb +54 -0
- data/lib/oxidized/model/zy1308.rb +13 -0
- data/lib/oxidized/model/zynos.rb +2 -0
- data/lib/oxidized/model/zynoscli.rb +2 -0
- data/lib/oxidized/model/zynosgs.rb +2 -0
- data/lib/oxidized/node/stats.rb +1 -0
- data/lib/oxidized/node.rb +16 -11
- data/lib/oxidized/nodes.rb +7 -6
- data/lib/oxidized/output/file.rb +2 -1
- data/lib/oxidized/output/git.rb +5 -3
- data/lib/oxidized/output/gitcrypt.rb +5 -8
- data/lib/oxidized/output/http.rb +2 -0
- data/lib/oxidized/source/csv.rb +1 -0
- data/lib/oxidized/source/http.rb +4 -0
- data/lib/oxidized/source/source.rb +7 -2
- data/lib/oxidized/source/sql.rb +15 -5
- data/lib/oxidized/version.rb +2 -2
- data/lib/oxidized/worker.rb +5 -5
- data/lib/oxidized.rb +1 -1
- data/lib/refinements.rb +43 -0
- data/oxidized.gemspec +22 -16
- metadata +120 -31
- data/.github/no-response.yml +0 -13
- data/.travis.yml +0 -10
- data/lib/oxidized/string.rb +0 -36
@@ -0,0 +1,68 @@
|
|
1
|
+
# Oxidized model for ADVA devices
|
2
|
+
#
|
3
|
+
# IMPORTANT: To get this working, cli-paging must be disabled
|
4
|
+
# for the user that is used to fetch the configuration.
|
5
|
+
|
6
|
+
class ADVA < Oxidized::Model
|
7
|
+
using Refinements
|
8
|
+
|
9
|
+
prompt /\w+\-+[#>]\s?$/
|
10
|
+
comment '# '
|
11
|
+
|
12
|
+
cmd :secret do |cfg|
|
13
|
+
cfg.gsub! /community "[^"]+"/, 'community "<hidden>"'
|
14
|
+
cfg
|
15
|
+
end
|
16
|
+
|
17
|
+
cmd :all do |cfg|
|
18
|
+
cfg.cut_both
|
19
|
+
end
|
20
|
+
|
21
|
+
cmd 'show running-config current' do |cfg|
|
22
|
+
cfg.each_line.reject { |line| line.match /^Preparing configuration file.*/ }.join
|
23
|
+
end
|
24
|
+
|
25
|
+
cmd 'show system' do |cfg|
|
26
|
+
cfg = cfg.each_line.reject { |line| line.match /(up time|local time)/i }.join
|
27
|
+
|
28
|
+
cfg = "COMMAND: show system\n\n" + cfg
|
29
|
+
cfg = comment cfg
|
30
|
+
"\n\n" + cfg
|
31
|
+
end
|
32
|
+
|
33
|
+
cmd 'network-element ne-1'
|
34
|
+
|
35
|
+
cmd 'show shelf-info' do |cfg|
|
36
|
+
cfg = "COMMAND: show shelf-info\n\n" + cfg
|
37
|
+
cfg = comment cfg
|
38
|
+
"\n\n" + cfg
|
39
|
+
end
|
40
|
+
|
41
|
+
post do
|
42
|
+
ports = []
|
43
|
+
ports_output = ''
|
44
|
+
|
45
|
+
cmd 'show ports' do |cfg|
|
46
|
+
cfg.each_line do |line|
|
47
|
+
port = line.match(/\|((access|network)[^\|]+)\|/)
|
48
|
+
ports << port if port
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
ports.each do |port|
|
53
|
+
port_command = 'show ' + port[2] + '-port ' + port[1]
|
54
|
+
|
55
|
+
ports_output << cmd(port_command) do |cfg|
|
56
|
+
cfg = "COMMAND: " + port_command + "\n\n" + cfg
|
57
|
+
cfg = comment cfg
|
58
|
+
"\n\n" + cfg
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
ports_output
|
63
|
+
end
|
64
|
+
|
65
|
+
cfg :ssh do
|
66
|
+
pre_logout 'logout'
|
67
|
+
end
|
68
|
+
end
|
data/lib/oxidized/model/aen.rb
CHANGED
data/lib/oxidized/model/airos.rb
CHANGED
data/lib/oxidized/model/aos.rb
CHANGED
data/lib/oxidized/model/aos7.rb
CHANGED
@@ -0,0 +1,98 @@
|
|
1
|
+
class Aoscx < Oxidized::Model
|
2
|
+
using Refinements
|
3
|
+
|
4
|
+
# previous command is repeated followed by "\eE", which sometimes ends up on last line
|
5
|
+
# ssh switches prompt may start with \r, followed by the prompt itself, regex ([\w\s.-]+[#>] ), which ends the line
|
6
|
+
# telnet switchs may start with various vt100 control characters, regex (\e\[24;[0-9][hH]), follwed by the prompt, followed
|
7
|
+
# by at least 3 other vt100 characters
|
8
|
+
prompt /(^\r|\e\[24;[0-9][hH])?([\w\s.-]+[#>] )($|(\e\[24;[0-9][0-9]?[hH]){3})/
|
9
|
+
|
10
|
+
comment '! '
|
11
|
+
|
12
|
+
# replace next line control sequence with a new line
|
13
|
+
expect /(\e\[1M\e\[\??\d+(;\d+)*[A-Za-z]\e\[1L)|(\eE)/ do |data, re|
|
14
|
+
data.gsub re, "\n"
|
15
|
+
end
|
16
|
+
|
17
|
+
# replace all used vt100 control sequences
|
18
|
+
expect /\e\[\??\d+(;\d+)*[A-Za-z]/ do |data, re|
|
19
|
+
data.gsub re, ''
|
20
|
+
end
|
21
|
+
|
22
|
+
expect /Press any key to continue(\e\[\??\d+(;\d+)*[A-Za-z])*$/ do
|
23
|
+
send ' '
|
24
|
+
""
|
25
|
+
end
|
26
|
+
|
27
|
+
expect /Enter switch number/ do
|
28
|
+
send "\n"
|
29
|
+
""
|
30
|
+
end
|
31
|
+
|
32
|
+
cmd :all do |cfg|
|
33
|
+
cfg = cfg.cut_both
|
34
|
+
cfg = cfg.gsub /^\r/, ''
|
35
|
+
# Additional filtering for elder switches sending vt100 control chars via telnet
|
36
|
+
cfg.gsub! /\e\[\??\d+(;\d+)*[A-Za-z]/, ''
|
37
|
+
# Additional filtering for power usage reporting which obviously changes over time
|
38
|
+
cfg.gsub! /^(.*AC [0-9]{3}V\/?([0-9]{3}V)?) *([0-9]{1,3}) (.*)/, '\\1 <removed> \\4'
|
39
|
+
cfg
|
40
|
+
end
|
41
|
+
|
42
|
+
cmd :secret do |cfg|
|
43
|
+
cfg.gsub! /^(snmp-server community) \S+(.*)/, '\\1 <secret hidden> \\2'
|
44
|
+
cfg.gsub! /^(snmp-server host \S+) \S+(.*)/, '\\1 <secret hidden> \\2'
|
45
|
+
cfg.gsub! /^(radius-server host \S+ key) \S+(.*)/, '\\1 <secret hidden> \\2'
|
46
|
+
cfg.gsub! /^(radius-server key).*/, '\\1 <configuration removed>'
|
47
|
+
cfg.gsub! /^(tacacs-server host \S+ key) \S+(.*)/, '\\1 <secret hidden> \\2'
|
48
|
+
cfg.gsub! /^(tacacs-server key).*/, '\\1 <secret hidden>'
|
49
|
+
cfg
|
50
|
+
end
|
51
|
+
|
52
|
+
cmd 'show version' do |cfg|
|
53
|
+
comment cfg
|
54
|
+
end
|
55
|
+
|
56
|
+
cmd 'show environment' do |cfg|
|
57
|
+
cfg.gsub! /^(LC.*\s+)\d+\s+$/, '\\1<hidden>'
|
58
|
+
cfg.gsub! /^(\d\/\d\/\d.*\s+)\d+\s+$/, '\\1<hidden>'
|
59
|
+
cfg.gsub! /^(\d+\/\S+\s+\S+\s+)\d+\.\d+\s+C(.*)/, '\\1<hidden>\\2'
|
60
|
+
cfg.gsub! /^(LC.*\s+)\d+\.\d+\s+(C.*)$/, '\\1 <hidden> \\2'
|
61
|
+
comment cfg
|
62
|
+
end
|
63
|
+
|
64
|
+
cmd 'show module' do |cfg|
|
65
|
+
comment cfg
|
66
|
+
end
|
67
|
+
|
68
|
+
cmd 'show interface transceiver' do |cfg|
|
69
|
+
comment cfg
|
70
|
+
end
|
71
|
+
|
72
|
+
cmd 'show system | exclude "Up Time" | exclude "CPU" | exclude "Memory"' do |cfg|
|
73
|
+
comment cfg
|
74
|
+
end
|
75
|
+
|
76
|
+
cmd 'show running-config'
|
77
|
+
|
78
|
+
cfg :telnet do
|
79
|
+
username /Username:/
|
80
|
+
password /Password:/
|
81
|
+
end
|
82
|
+
|
83
|
+
cfg :telnet, :ssh do
|
84
|
+
# preferred way to handle additional passwords
|
85
|
+
if vars :enable
|
86
|
+
post_login do
|
87
|
+
send "enable\n"
|
88
|
+
cmd vars(:enable)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
post_login 'no page'
|
92
|
+
pre_logout "exit"
|
93
|
+
end
|
94
|
+
|
95
|
+
cfg :ssh do
|
96
|
+
pty_options(chars_wide: 1000)
|
97
|
+
end
|
98
|
+
end
|
data/lib/oxidized/model/aosw.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
class AOSW < Oxidized::Model
|
2
|
+
using Refinements
|
3
|
+
|
2
4
|
# AOSW Aruba Wireless, IAP, Instant Controller and Mobility Access Switches
|
3
5
|
# Used in Alcatel OAW-4750 WLAN controller
|
4
6
|
# Also Dell controllers
|
@@ -9,7 +11,7 @@ class AOSW < Oxidized::Model
|
|
9
11
|
# Support for Mobility Access Switches tested with S2500-48P & S2500-24P running 7.4.1.4_54199 and S2500-24P running 7.4.1.7_57823
|
10
12
|
# All IAPs connected to a Instant Controller will have the same config output. Only the controller needs to be monitored.
|
11
13
|
|
12
|
-
comment
|
14
|
+
comment '# '
|
13
15
|
prompt /^([\w\(:.@-]+(\)?\s?)[#>]\s?)$/
|
14
16
|
|
15
17
|
cmd :all do |cfg|
|
@@ -39,7 +41,7 @@ class AOSW < Oxidized::Model
|
|
39
41
|
end
|
40
42
|
|
41
43
|
cmd 'show version' do |cfg|
|
42
|
-
cfg = cfg.each_line.reject { |line| line.match
|
44
|
+
cfg = cfg.each_line.reject { |line| line.match(/(Switch|AP) uptime/i) || line.match(/Reboot Time and Cause/i) }
|
43
45
|
rstrip_cfg comment cfg.join
|
44
46
|
end
|
45
47
|
|
data/lib/oxidized/model/arbos.rb
CHANGED
data/lib/oxidized/model/asa.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
class ASA < Oxidized::Model
|
2
|
+
using Refinements
|
3
|
+
|
2
4
|
# Cisco ASA model #
|
3
5
|
# Only SSH supported for the sake of security
|
4
6
|
|
@@ -34,6 +36,8 @@ class ASA < Oxidized::Model
|
|
34
36
|
# avoid commits due to uptime / ixo-router01 up 2 mins 28 secs / ixo-router01 up 1 days 2 hours
|
35
37
|
cfg = cfg.each_line.reject { |line| line.match /(\s+up\s+\d+\s+)|(.*days.*)/ }
|
36
38
|
cfg = cfg.join
|
39
|
+
cfg.gsub! /^Configuration has not been modified since last system restart.*\n/, ''
|
40
|
+
cfg.gsub! /^Configuration last modified by.*\n/, ''
|
37
41
|
comment cfg
|
38
42
|
end
|
39
43
|
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class AWPlus < Oxidized::Model
|
2
|
+
using Refinements
|
3
|
+
|
2
4
|
# Allied Telesis Alliedware Plus Model#
|
3
5
|
# https://www.alliedtelesis.com/products/software/AlliedWare-Plus
|
4
6
|
|
@@ -51,7 +53,7 @@ class AWPlus < Oxidized::Model
|
|
51
53
|
line.match(/Current software\s*:.*/) ||
|
52
54
|
line.match(/Software version\s*:.*/) ||
|
53
55
|
line.match(/Build date\s*:.*/)
|
54
|
-
}
|
56
|
+
}.join
|
55
57
|
end
|
56
58
|
|
57
59
|
# Actually get the devices running config#
|
data/lib/oxidized/model/axos.rb
CHANGED
@@ -0,0 +1,51 @@
|
|
1
|
+
class BDCOM < Oxidized::Model
|
2
|
+
using Refinements
|
3
|
+
|
4
|
+
comment '! '
|
5
|
+
|
6
|
+
cmd :secret do |cfg|
|
7
|
+
cfg.gsub!(/password \d+ (\S+).*/, '<secret removed>')
|
8
|
+
cfg.gsub!(/community (\S+)/, 'community <hidden>')
|
9
|
+
cfg
|
10
|
+
end
|
11
|
+
|
12
|
+
cmd :all do |cfg|
|
13
|
+
cfg.each_line.to_a[0..-2].join
|
14
|
+
end
|
15
|
+
|
16
|
+
cmd 'show running-config'
|
17
|
+
|
18
|
+
cmd 'show version' do |cfg|
|
19
|
+
cfg.gsub! /(\s*uptime is\s*)[0-9:]+/, '\1 <removed>'
|
20
|
+
cfg.gsub! /(\s*current time:\s*)[0-9-]+\s+[0-9:]+/, '\1 <removed>'
|
21
|
+
cfg.gsub! /(\s*at)\s+[0-9-]+\s+[0-9:]+(,\s*uptime\s+[0-9:]+)?/, '\1 <removed>'
|
22
|
+
comment cfg
|
23
|
+
end
|
24
|
+
|
25
|
+
cmd 'show power-status' do |cfg|
|
26
|
+
comment cfg
|
27
|
+
end
|
28
|
+
|
29
|
+
cmd 'show fan-status' do |cfg|
|
30
|
+
comment cfg
|
31
|
+
end
|
32
|
+
|
33
|
+
cfg :telnet do
|
34
|
+
username /^Username:/
|
35
|
+
password /^Password:/
|
36
|
+
end
|
37
|
+
|
38
|
+
cfg :telnet, :ssh do
|
39
|
+
post_login do
|
40
|
+
if vars(:enable) == true
|
41
|
+
cmd "enable"
|
42
|
+
elsif vars(:enable)
|
43
|
+
cmd "enable", /^[pP]assword:/
|
44
|
+
cmd vars(:enable)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
post_login 'terminal length 0'
|
49
|
+
pre_logout 'exit'
|
50
|
+
end
|
51
|
+
end
|
data/lib/oxidized/model/boss.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
class Boss < Oxidized::Model
|
2
|
+
using Refinements
|
3
|
+
|
2
4
|
# Extreme Baystack Operating System Software(BOSS)
|
3
5
|
# Created by danielcoxman@gmail.com
|
4
6
|
# May 15, 2017
|
5
7
|
# This was tested on ers3510, ers5530, ers4850, ers5952
|
6
8
|
# ssh and telnet were tested with banner and without
|
7
9
|
|
8
|
-
comment
|
10
|
+
comment '! '
|
9
11
|
|
10
12
|
prompt /^[^\s#>]+[#>]$/
|
11
13
|
|
data/lib/oxidized/model/casa.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
class Casa < Oxidized::Model
|
2
|
+
using Refinements
|
3
|
+
|
2
4
|
# Casa Systems CMTS
|
3
5
|
|
4
6
|
prompt /^([\w.@()-]+[#>]\s?)$/
|
@@ -10,6 +12,7 @@ class Casa < Oxidized::Model
|
|
10
12
|
cfg.gsub! /^(console-password encrypted) \S+/, '\\1 <secret hidden>'
|
11
13
|
cfg.gsub! /^(password encrypted) \S+/, '\\1 <secret hidden>'
|
12
14
|
cfg.gsub! /^(tacacs-server key) \S+/, '\\1 <secret hidden>'
|
15
|
+
cfg.gsub! /^( ip rip authentication secret) \S+/, '\\1 <secret hidden>'
|
13
16
|
cfg
|
14
17
|
end
|
15
18
|
|
@@ -18,7 +21,9 @@ class Casa < Oxidized::Model
|
|
18
21
|
end
|
19
22
|
|
20
23
|
cmd 'show system' do |cfg|
|
21
|
-
|
24
|
+
cfg.gsub! /Uptime:.*/, 'Uptime: <removed>'
|
25
|
+
cfg.gsub! /Time:.*/, 'Time: <removed>'
|
26
|
+
comment cfg
|
22
27
|
end
|
23
28
|
|
24
29
|
cmd 'show version' do |cfg|
|
data/lib/oxidized/model/catos.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Supporting Cisco Catalyst Express Switches and IOS using the basic web interface
|
2
|
+
class CiscoCE < Oxidized::Model
|
3
|
+
using Refinements
|
4
|
+
|
5
|
+
cmd "/level/15/exec/-/show/startup-config" do |cfg|
|
6
|
+
output = cfg.gsub(/\A.+<DL>(.+)<\/DL>.+\z/m, '\1') # Strip configuration file from within HTML response.
|
7
|
+
output
|
8
|
+
end
|
9
|
+
|
10
|
+
cfg :http do
|
11
|
+
@username = @node.auth[:username]
|
12
|
+
@password = @node.auth[:password]
|
13
|
+
end
|
14
|
+
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class CiscoSMB < Oxidized::Model
|
2
|
+
using Refinements
|
3
|
+
|
2
4
|
# Cisco Small Business 300, 500, and ESW2 series switches
|
3
5
|
# http://www.cisco.com/c/en/us/support/switches/small-business-300-series-managed-switches/products-release-notes-list.html
|
4
6
|
|
@@ -26,6 +28,8 @@ class CiscoSMB < Oxidized::Model
|
|
26
28
|
end
|
27
29
|
|
28
30
|
cmd 'show version' do |cfg|
|
31
|
+
cfg.gsub! /.*Uptime for this control.*/, ''
|
32
|
+
cfg.gsub! /.*System restarted.*/, ''
|
29
33
|
cfg.gsub! /uptime is\ .+/, '<uptime removed>'
|
30
34
|
comment cfg
|
31
35
|
end
|
data/lib/oxidized/model/cnos.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
class Comware < Oxidized::Model
|
2
2
|
# HP (A-series)/H3C/3Com Comware
|
3
|
+
using Refinements
|
3
4
|
|
4
5
|
# sometimes the prompt might have a leading nul or trailing ASCII Bell (^G)
|
5
6
|
prompt /^\0*(<[\w.-]+>).?$/
|
@@ -31,6 +32,15 @@ class Comware < Oxidized::Model
|
|
31
32
|
end
|
32
33
|
|
33
34
|
cfg :telnet, :ssh do
|
35
|
+
# handle enable passwords
|
36
|
+
post_login do
|
37
|
+
if vars(:enable) == true
|
38
|
+
cmd "super"
|
39
|
+
elsif vars(:enable)
|
40
|
+
cmd "super", /^ [pP]assword:/
|
41
|
+
cmd vars(:enable)
|
42
|
+
end
|
43
|
+
end
|
34
44
|
# enable command-line mode on SMB comware switches (HP V1910, V1920)
|
35
45
|
# autodetection is hard, because the 'summary' command is paged, and
|
36
46
|
# the pager cannot be disabled before _cmdline-mode on.
|
@@ -41,10 +51,16 @@ class Comware < Oxidized::Model
|
|
41
51
|
cmd 'y', /(#{@node.prompt}|input password)/
|
42
52
|
cmd vars(:comware_cmdline)
|
43
53
|
|
44
|
-
# HP V1950
|
54
|
+
# HP V1950 r2432P06
|
45
55
|
cmd 'xtd-cli-mode on', /(#{@node.prompt}|Continue)/
|
46
56
|
cmd 'y', /(#{@node.prompt}|input password)/
|
47
57
|
cmd vars(:comware_cmdline)
|
58
|
+
|
59
|
+
# HP V1950 OS r3208 (v7.1)
|
60
|
+
# HPE Office Connect 1950
|
61
|
+
cmd 'xtd-cli-mode', /(#{@node.prompt}|Continue|Switch)/
|
62
|
+
cmd 'y', /(#{@node.prompt}|input password|Password:)/
|
63
|
+
cmd vars(:comware_cmdline)
|
48
64
|
end
|
49
65
|
end
|
50
66
|
|