oxidized 0.21.0 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/no-response.yml +13 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +37 -0
- data/.rubocop_todo.yml +714 -0
- data/.travis.yml +7 -1
- data/CHANGELOG.md +341 -243
- data/Dockerfile +44 -16
- data/LICENSE +201 -0
- data/README.md +114 -82
- data/Rakefile +19 -0
- data/TODO.md +29 -23
- data/bin/oxidized +1 -2
- data/docs/Configuration.md +71 -31
- data/docs/Creating-Models.md +78 -0
- data/docs/Hooks.md +145 -41
- data/docs/Model-Notes/AireOS.md +12 -0
- data/docs/Model-Notes/ArbOS.md +12 -0
- data/docs/Model-Notes/Comware.md +14 -0
- data/docs/Model-Notes/EOS.md +9 -0
- data/docs/Model-Notes/JunOS.md +34 -0
- data/docs/Model-Notes/Netgear.md +68 -0
- data/docs/Model-Notes/README.md +19 -0
- data/docs/{VRP-Huawei.md → Model-Notes/VRP-Huawei.md} +10 -2
- data/docs/Model-Notes/XGS4600-Zyxel.md +39 -0
- data/docs/Outputs.md +27 -28
- data/docs/Ruby-API.md +38 -18
- data/docs/Sources.md +78 -16
- data/docs/Supported-OS-Types.md +171 -148
- data/extra/oxidized.logrotate +7 -0
- data/extra/oxidized.service +1 -1
- data/extra/rest_client.rb +4 -5
- data/extra/syslog.rb +16 -16
- data/lib/oxidized/cli.rb +3 -3
- data/lib/oxidized/config.rb +7 -4
- data/lib/oxidized/core.rb +3 -3
- data/lib/oxidized/hook.rb +64 -65
- data/lib/oxidized/hook/awssns.rb +2 -3
- data/lib/oxidized/hook/ciscosparkdiff.rb +49 -0
- data/lib/oxidized/hook/exec.rb +5 -5
- data/lib/oxidized/hook/githubrepo.rb +20 -14
- data/lib/oxidized/hook/slackdiff.rb +38 -19
- data/lib/oxidized/hook/xmppdiff.rb +58 -0
- data/lib/oxidized/input/cli.rb +5 -6
- data/lib/oxidized/input/ftp.rb +8 -7
- data/lib/oxidized/input/http.rb +39 -0
- data/lib/oxidized/input/ssh.rb +24 -22
- data/lib/oxidized/input/telnet.rb +38 -32
- data/lib/oxidized/jobs.rb +3 -4
- data/lib/oxidized/manager.rb +9 -4
- data/lib/oxidized/model/acos.rb +15 -16
- data/lib/oxidized/model/acsw.rb +3 -8
- data/lib/oxidized/model/aen.rb +1 -2
- data/lib/oxidized/model/aireos.rb +3 -5
- data/lib/oxidized/model/alteonos.rb +16 -18
- data/lib/oxidized/model/alvarion.rb +0 -4
- data/lib/oxidized/model/aos.rb +2 -4
- data/lib/oxidized/model/aos7.rb +2 -3
- data/lib/oxidized/model/aosw.rb +13 -15
- data/lib/oxidized/model/apc_aos.rb +0 -3
- data/lib/oxidized/model/arbos.rb +26 -0
- data/lib/oxidized/model/aricentiss.rb +51 -0
- data/lib/oxidized/model/asa.rb +33 -35
- data/lib/oxidized/model/asyncos.rb +41 -44
- data/lib/oxidized/model/audiocodes.rb +4 -8
- data/lib/oxidized/model/awplus.rb +84 -0
- data/lib/oxidized/model/boss.rb +6 -5
- data/lib/oxidized/model/br6910.rb +43 -45
- data/lib/oxidized/model/c4cmts.rb +3 -5
- data/lib/oxidized/model/cambium.rb +22 -0
- data/lib/oxidized/model/catos.rb +0 -2
- data/lib/oxidized/model/cisconga.rb +1 -3
- data/lib/oxidized/model/ciscosma.rb +37 -40
- data/lib/oxidized/model/ciscosmb.rb +7 -4
- data/lib/oxidized/model/comnetms.rb +43 -0
- data/lib/oxidized/model/comware.rb +9 -9
- data/lib/oxidized/model/coriant8600.rb +3 -5
- data/lib/oxidized/model/coriantgroove.rb +3 -5
- data/lib/oxidized/model/corianttmos.rb +1 -3
- data/lib/oxidized/model/cumulus.rb +26 -32
- data/lib/oxidized/model/datacom.rb +0 -2
- data/lib/oxidized/model/dcnos.rb +46 -0
- data/lib/oxidized/model/dlink.rb +1 -1
- data/lib/oxidized/model/dnos.rb +9 -5
- data/lib/oxidized/model/edgecos.rb +45 -0
- data/lib/oxidized/model/edgeos.rb +5 -3
- data/lib/oxidized/model/edgeswitch.rb +1 -3
- data/lib/oxidized/model/enterasys.rb +1 -3
- data/lib/oxidized/model/eos.rb +6 -8
- data/lib/oxidized/model/fabricos.rb +3 -5
- data/lib/oxidized/model/firewareos.rb +2 -5
- data/lib/oxidized/model/fortios.rb +21 -17
- data/lib/oxidized/model/ftos.rb +2 -4
- data/lib/oxidized/model/fujitsupy.rb +2 -4
- data/lib/oxidized/model/gaiaos.rb +6 -10
- data/lib/oxidized/model/gcombnps.rb +82 -0
- data/lib/oxidized/model/hatteras.rb +8 -5
- data/lib/oxidized/model/hirschmann.rb +8 -10
- data/lib/oxidized/model/hpebladesystem.rb +19 -17
- data/lib/oxidized/model/hpemsa.rb +0 -3
- data/lib/oxidized/model/ios.rb +54 -55
- data/lib/oxidized/model/iosxe.rb +5 -0
- data/lib/oxidized/model/iosxr.rb +1 -3
- data/lib/oxidized/model/ipos.rb +1 -3
- data/lib/oxidized/model/ironware.rb +12 -15
- data/lib/oxidized/model/isam.rb +4 -5
- data/lib/oxidized/model/junos.rb +8 -7
- data/lib/oxidized/model/masteros.rb +1 -3
- data/lib/oxidized/model/mlnxos.rb +3 -4
- data/lib/oxidized/model/model.rb +15 -7
- data/lib/oxidized/model/mtrlrfs.rb +1 -4
- data/lib/oxidized/model/ndms.rb +24 -0
- data/lib/oxidized/model/netgear.rb +3 -4
- data/lib/oxidized/model/netscaler.rb +0 -2
- data/lib/oxidized/model/nos.rb +1 -3
- data/lib/oxidized/model/nxos.rb +13 -3
- data/lib/oxidized/model/oneos.rb +6 -8
- data/lib/oxidized/model/openbsd.rb +76 -0
- data/lib/oxidized/model/opengear.rb +3 -5
- data/lib/oxidized/model/openwrt.rb +77 -0
- data/lib/oxidized/model/opnsense.rb +19 -0
- data/lib/oxidized/model/outputs.rb +1 -3
- data/lib/oxidized/model/panos.rb +1 -2
- data/lib/oxidized/model/pfsense.rb +9 -5
- data/lib/oxidized/model/planet.rb +8 -12
- data/lib/oxidized/model/powerconnect.rb +6 -9
- data/lib/oxidized/model/procurve.rb +18 -4
- data/lib/oxidized/model/quantaos.rb +3 -5
- data/lib/oxidized/model/routeros.rb +3 -2
- data/lib/oxidized/model/saos.rb +0 -1
- data/lib/oxidized/model/screenos.rb +3 -5
- data/lib/oxidized/model/sgos.rb +2 -3
- data/lib/oxidized/model/siklu.rb +0 -2
- data/lib/oxidized/model/slxos.rb +59 -0
- data/lib/oxidized/model/sros.rb +117 -0
- data/lib/oxidized/model/stoneos.rb +32 -0
- data/lib/oxidized/model/supermicro.rb +6 -41
- data/lib/oxidized/model/timos.rb +6 -114
- data/lib/oxidized/model/tmos.rb +1 -3
- data/lib/oxidized/model/tplink.rb +7 -11
- data/lib/oxidized/model/trango.rb +6 -7
- data/lib/oxidized/model/ucs.rb +0 -1
- data/lib/oxidized/model/voltaire.rb +3 -6
- data/lib/oxidized/model/voss.rb +1 -2
- data/lib/oxidized/model/vrp.rb +4 -5
- data/lib/oxidized/model/vyatta.rb +6 -4
- data/lib/oxidized/model/weos.rb +1 -3
- data/lib/oxidized/model/xos.rb +6 -5
- data/lib/oxidized/model/zhoneolt.rb +2 -2
- data/lib/oxidized/model/zynos.rb +1 -3
- data/lib/oxidized/model/zynoscli.rb +36 -0
- data/lib/oxidized/node.rb +11 -11
- data/lib/oxidized/node/stats.rb +15 -2
- data/lib/oxidized/nodes.rb +8 -8
- data/lib/oxidized/output/file.rb +41 -42
- data/lib/oxidized/output/git.rb +113 -115
- data/lib/oxidized/output/gitcrypt.rb +241 -242
- data/lib/oxidized/output/http.rb +23 -27
- data/lib/oxidized/output/output.rb +1 -2
- data/lib/oxidized/source/csv.rb +44 -45
- data/lib/oxidized/source/http.rb +52 -49
- data/lib/oxidized/source/source.rb +6 -7
- data/lib/oxidized/source/sql.rb +55 -51
- data/lib/oxidized/string.rb +3 -4
- data/lib/oxidized/version.rb +17 -1
- data/lib/oxidized/worker.rb +12 -3
- data/oxidized.gemspec +19 -13
- metadata +139 -51
- data/.ruby-version +0 -1
- data/Gemfile.lock +0 -44
@@ -1,15 +1,14 @@
|
|
1
1
|
class C4CMTS < Oxidized::Model
|
2
|
-
|
3
2
|
# Arris C4 CMTS
|
4
3
|
|
5
4
|
prompt /^([\w.@:\/-]+[#>]\s?)$/
|
6
5
|
comment '! '
|
7
6
|
|
8
7
|
cmd :all do |cfg|
|
9
|
-
cfg.each_line.to_a[1..-2].map{|line|line.delete("\r").rstrip}.join("\n") + "\n"
|
8
|
+
cfg.each_line.to_a[1..-2].map { |line| line.delete("\r").rstrip }.join("\n") + "\n"
|
10
9
|
end
|
11
10
|
|
12
|
-
cmd :secret do |cfg|
|
11
|
+
cmd :secret do |cfg|
|
13
12
|
cfg.gsub! /(.+)\s+encrypted-password\s+\w+\s+(.*)/, '\\1 <secret hidden> \\2'
|
14
13
|
cfg.gsub! /(snmp-server community)\s+".*"\s+(.*)/, '\\1 <secret hidden> \\2'
|
15
14
|
cfg.gsub! /(tacacs.*\s+key)\s+".*"\s+(.*)/, '\\1 <secret hidden> \\2'
|
@@ -25,7 +24,7 @@ class C4CMTS < Oxidized::Model
|
|
25
24
|
|
26
25
|
cmd 'show version' do |cfg|
|
27
26
|
# remove uptime readings at char 55 and beyond
|
28
|
-
cfg = cfg.each_line.map{|line|line.rstrip.slice(0..54)}.join("\n") + "\n"
|
27
|
+
cfg = cfg.each_line.map { |line| line.rstrip.slice(0..54) }.join("\n") + "\n"
|
29
28
|
comment cfg
|
30
29
|
end
|
31
30
|
|
@@ -48,5 +47,4 @@ class C4CMTS < Oxidized::Model
|
|
48
47
|
end
|
49
48
|
pre_logout 'exit'
|
50
49
|
end
|
51
|
-
|
52
50
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Cambium < Oxidized::Model
|
2
|
+
cfg_cb = lambda do
|
3
|
+
c_page = @m.click @m_page.link_with(text: "Configuration")
|
4
|
+
u_page = @m.click c_page.link_with(text: "Unit Settings")
|
5
|
+
cfg = @m.click u_page.link_with(text: /\.cfg$/)
|
6
|
+
cfg.body
|
7
|
+
end
|
8
|
+
|
9
|
+
cmd cfg_cb do |cfg|
|
10
|
+
cfg
|
11
|
+
end
|
12
|
+
|
13
|
+
cfg :http do
|
14
|
+
@main_page = "/main.cgi"
|
15
|
+
define_singleton_method :login do
|
16
|
+
@m_page = @m_page.form_with(action: "login.cgi") do |form|
|
17
|
+
form.CanopyUsername = @node.auth[:username]
|
18
|
+
form.CanopyPassword = @node.auth[:password]
|
19
|
+
end.submit
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/oxidized/model/catos.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
class CiscoNGA < Oxidized::Model
|
2
|
-
|
3
2
|
comment '# '
|
4
3
|
prompt /([\w.@-]+[#>]\s?)$/
|
5
4
|
|
@@ -10,10 +9,9 @@ class CiscoNGA < Oxidized::Model
|
|
10
9
|
cmd 'show configuration' do |cfg|
|
11
10
|
cfg
|
12
11
|
end
|
13
|
-
|
12
|
+
|
14
13
|
cfg :ssh do
|
15
14
|
post_login 'terminal length 0'
|
16
15
|
pre_logout 'exit'
|
17
16
|
end
|
18
|
-
|
19
17
|
end
|
@@ -1,45 +1,42 @@
|
|
1
1
|
class CiscoSMA < Oxidized::Model
|
2
|
+
# SMA prompt "mail.example.com> "
|
3
|
+
prompt /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/
|
4
|
+
comment '! '
|
2
5
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
expect /using loadconfig command\. \[Y\]\>/ do |data, re|
|
9
|
-
send "y\n"
|
10
|
-
data.sub re, ''
|
11
|
-
end
|
12
|
-
|
13
|
-
# handle paging
|
14
|
-
expect /-Press Any Key For More-+.*$/ do |data, re|
|
15
|
-
send " "
|
16
|
-
data.sub re, ''
|
17
|
-
end
|
18
|
-
|
19
|
-
cmd 'version' do |cfg|
|
20
|
-
comment cfg
|
21
|
-
end
|
6
|
+
# Select passphrase display option
|
7
|
+
expect /using loadconfig command\. \[Y\]\>/ do |data, re|
|
8
|
+
send "y\n"
|
9
|
+
data.sub re, ''
|
10
|
+
end
|
22
11
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
cfg.gsub! /^\s+y/, ''
|
29
|
-
# Delete space
|
30
|
-
cfg.gsub! /\n\s{25}/, ''
|
31
|
-
# Delete after line
|
32
|
-
cfg.gsub! /([\/\-,.\w><@]+)(\s{27})/,"\\1"
|
33
|
-
# Add a carriage return
|
34
|
-
cfg.gsub! /([\/\-,.\w><@]+)(\s{6,8})([\/\-,.\w><@]+)/,"\\1\n\\2\\3"
|
35
|
-
# Delete prompt
|
36
|
-
cfg.gsub! /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/, ''
|
37
|
-
cfg
|
12
|
+
# handle paging
|
13
|
+
expect /-Press Any Key For More-+.*$/ do |data, re|
|
14
|
+
send " "
|
15
|
+
data.sub re, ''
|
16
|
+
end
|
38
17
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
18
|
+
cmd 'version' do |cfg|
|
19
|
+
comment cfg
|
20
|
+
end
|
21
|
+
|
22
|
+
cmd 'showconfig' do |cfg|
|
23
|
+
# Delete hour and date which change each run
|
24
|
+
# cfg.gsub! /\sCurrent Time: \S+\s\S+\s+\S+\s\S+\s\S+/, ' Current Time:'
|
25
|
+
# Delete select passphrase display option
|
26
|
+
cfg.gsub! /Do you want to mask the password\? Files with masked passwords cannot be loaded/, ''
|
27
|
+
cfg.gsub! /^\s+y/, ''
|
28
|
+
# Delete space
|
29
|
+
cfg.gsub! /\n\s{25}/, ''
|
30
|
+
# Delete after line
|
31
|
+
cfg.gsub! /([\/\-,.\w><@]+)(\s{27})/, "\\1"
|
32
|
+
# Add a carriage return
|
33
|
+
cfg.gsub! /([\/\-,.\w><@]+)(\s{6,8})([\/\-,.\w><@]+)/, "\\1\n\\2\\3"
|
34
|
+
# Delete prompt
|
35
|
+
cfg.gsub! /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/, ''
|
36
|
+
cfg
|
37
|
+
end
|
38
|
+
|
39
|
+
cfg :ssh do
|
40
|
+
pre_logout "exit"
|
41
|
+
end
|
45
42
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
class CiscoSMB < Oxidized::Model
|
2
|
-
|
3
2
|
# Cisco Small Business 300, 500, and ESW2 series switches
|
4
3
|
# http://www.cisco.com/c/en/us/support/switches/small-business-300-series-managed-switches/products-release-notes-list.html
|
5
4
|
|
@@ -17,13 +16,18 @@ class CiscoSMB < Oxidized::Model
|
|
17
16
|
cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
|
18
17
|
cfg.gsub! /username (\S+) privilege (\d+) (\S+).*/, '<secret hidden>'
|
19
18
|
cfg.gsub! /^(encrypted radius-server key).*/, '\\1 <configuration removed>'
|
19
|
+
cfg.gsub! /System Up Time.*/, ''
|
20
20
|
cfg
|
21
21
|
end
|
22
22
|
|
23
23
|
cmd 'show version' do |cfg|
|
24
24
|
comment cfg
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
|
+
cmd 'show system' do |cfg|
|
28
|
+
comment cfg
|
29
|
+
end
|
30
|
+
|
27
31
|
cmd 'show bootvar' do |cfg|
|
28
32
|
comment cfg
|
29
33
|
end
|
@@ -44,8 +48,7 @@ class CiscoSMB < Oxidized::Model
|
|
44
48
|
post_login 'terminal datadump' # Disable pager
|
45
49
|
post_login 'terminal width 0'
|
46
50
|
post_login 'terminal len 0'
|
47
|
-
pre_logout 'exit' #exit returns to previous priv level, no way to quit from exec(#)
|
51
|
+
pre_logout 'exit' # exit returns to previous priv level, no way to quit from exec(#)
|
48
52
|
pre_logout 'exit'
|
49
53
|
end
|
50
|
-
|
51
54
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
class ComnetMS < Oxidized::Model
|
2
|
+
# Comnet Microsemi Switch
|
3
|
+
prompt /^\r?([\w.@()-]+[#>]\s?)$/
|
4
|
+
comment '! '
|
5
|
+
|
6
|
+
cmd :all do |cfg|
|
7
|
+
cfg.each_line.to_a[1..-2].join
|
8
|
+
end
|
9
|
+
|
10
|
+
cmd 'show running-config' do |cfg|
|
11
|
+
cfg.gsub! "\n\r", "\n"
|
12
|
+
cfg.gsub! /^[\r\n\s]*Building configuration\.\.\.\n/, ''
|
13
|
+
cfg.gsub! /^end\n/, ''
|
14
|
+
cfg
|
15
|
+
end
|
16
|
+
|
17
|
+
cmd 'show version' do |cfg|
|
18
|
+
cfg.gsub! "\n\r", "\n"
|
19
|
+
cfg.gsub! /^MEMORY\s*:.*\n/, ''
|
20
|
+
cfg.gsub! /^FLASH\s*:.*\n/, ''
|
21
|
+
cfg.gsub! /^Previous Restart\s*:.*\n/, ''
|
22
|
+
cfg.gsub! /^System Time\s*:.*\n/, ''
|
23
|
+
cfg.gsub! /^System Uptime\s*:.*\n/, ''
|
24
|
+
comment cfg
|
25
|
+
end
|
26
|
+
|
27
|
+
cfg :telnet do
|
28
|
+
username /^Username:/i
|
29
|
+
password /^Password:/i
|
30
|
+
end
|
31
|
+
|
32
|
+
cfg :telnet, :ssh do
|
33
|
+
if vars :enable
|
34
|
+
post_login do
|
35
|
+
send "enable\n"
|
36
|
+
cmd vars(:enable)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
post_login 'terminal length 0'
|
40
|
+
post_login 'terminal width 0'
|
41
|
+
pre_logout 'exit'
|
42
|
+
end
|
43
|
+
end
|
@@ -1,23 +1,23 @@
|
|
1
1
|
class Comware < Oxidized::Model
|
2
2
|
# HP (A-series)/H3C/3Com Comware
|
3
|
-
|
4
|
-
# sometimes the prompt might have a leading nul
|
5
|
-
prompt /^\0*(<[\w.-]+>)
|
3
|
+
|
4
|
+
# sometimes the prompt might have a leading nul or trailing ASCII Bell (^G)
|
5
|
+
prompt /^\0*(<[\w.-]+>).?$/
|
6
6
|
comment '# '
|
7
7
|
|
8
8
|
# example how to handle pager
|
9
|
-
#expect /^\s*---- More ----$/ do |data, re|
|
9
|
+
# expect /^\s*---- More ----$/ do |data, re|
|
10
10
|
# send ' '
|
11
11
|
# data.sub re, ''
|
12
|
-
#end
|
12
|
+
# end
|
13
13
|
|
14
14
|
cmd :all do |cfg|
|
15
|
-
#cfg.gsub! /^.*\e\[42D/, '' # example how to handle pager
|
16
|
-
#skip rogue ^M
|
15
|
+
# cfg.gsub! /^.*\e\[42D/, '' # example how to handle pager
|
16
|
+
# skip rogue ^M
|
17
17
|
cfg = cfg.gsub /\r/, ''
|
18
18
|
cfg.each_line.to_a[1..-2].join
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
cmd :secret do |cfg|
|
22
22
|
cfg.gsub! /^( snmp-agent community).*/, '\\1 <configuration removed>'
|
23
23
|
cfg.gsub! /^( password hash).*/, '\\1 <configuration removed>'
|
@@ -47,7 +47,7 @@ class Comware < Oxidized::Model
|
|
47
47
|
end
|
48
48
|
|
49
49
|
cmd 'display version' do |cfg|
|
50
|
-
cfg = cfg.each_line.
|
50
|
+
cfg = cfg.each_line.reject { |l| l.match /uptime/i }.join
|
51
51
|
comment cfg
|
52
52
|
end
|
53
53
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class Coriant8600 < Oxidized::Model
|
2
|
-
|
3
2
|
comment '# '
|
4
|
-
|
3
|
+
|
5
4
|
prompt /^[^\s#>]+[#>]$/
|
6
5
|
|
7
6
|
cmd 'show hw-inventory' do |cfg|
|
@@ -11,7 +10,7 @@ class Coriant8600 < Oxidized::Model
|
|
11
10
|
cmd 'show flash' do |cfg|
|
12
11
|
comment cfg
|
13
12
|
end
|
14
|
-
|
13
|
+
|
15
14
|
cmd 'show run' do |cfg|
|
16
15
|
cfg
|
17
16
|
end
|
@@ -20,11 +19,10 @@ class Coriant8600 < Oxidized::Model
|
|
20
19
|
username /^user name:$/
|
21
20
|
password /^password:$/
|
22
21
|
end
|
23
|
-
|
22
|
+
|
24
23
|
cfg :telnet, :ssh do
|
25
24
|
pre_logout 'exit'
|
26
25
|
post_login 'enable'
|
27
26
|
post_login 'terminal more off'
|
28
27
|
end
|
29
|
-
|
30
28
|
end
|
@@ -1,11 +1,10 @@
|
|
1
1
|
class CoriantGroove < Oxidized::Model
|
2
|
-
|
3
2
|
comment '# '
|
4
|
-
|
3
|
+
|
5
4
|
prompt /^(\w+@.*>\s*)$/
|
6
5
|
|
7
6
|
cmd :all do |cfg|
|
8
|
-
cfg.each_line.to_a[1..-3].map{|line|line.delete("\r").rstrip}.join("\n") + "\n"
|
7
|
+
cfg.each_line.to_a[1..-3].map { |line| line.delete("\r").rstrip }.join("\n") + "\n"
|
9
8
|
end
|
10
9
|
|
11
10
|
cmd 'show inventory' do |cfg|
|
@@ -17,7 +16,7 @@ class CoriantGroove < Oxidized::Model
|
|
17
16
|
cfg = cfg.each_line.to_a[0..-2].join
|
18
17
|
comment cfg
|
19
18
|
end
|
20
|
-
|
19
|
+
|
21
20
|
cmd 'show config | display commands' do |cfg|
|
22
21
|
cfg.each_line.to_a[1..-1].join
|
23
22
|
end
|
@@ -26,5 +25,4 @@ class CoriantGroove < Oxidized::Model
|
|
26
25
|
post_login 'set -f cli-config cli-columns 65535'
|
27
26
|
pre_logout 'quit -f'
|
28
27
|
end
|
29
|
-
|
30
28
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class CoriantTmos < Oxidized::Model
|
2
|
-
|
3
2
|
comment '# '
|
4
|
-
|
3
|
+
|
5
4
|
prompt /^[^\s#]+#\s$/
|
6
5
|
|
7
6
|
cmd 'show node extensive' do |cfg|
|
@@ -21,5 +20,4 @@ class CoriantTmos < Oxidized::Model
|
|
21
20
|
pre_logout 'exit'
|
22
21
|
post_login 'enable config terminal length 0'
|
23
22
|
end
|
24
|
-
|
25
23
|
end
|
@@ -1,85 +1,81 @@
|
|
1
1
|
class Cumulus < Oxidized::Model
|
2
|
-
|
3
2
|
prompt /^((\w*)@(.*)):/
|
4
|
-
comment
|
5
|
-
|
6
|
-
|
7
|
-
#add a comment in the final conf
|
3
|
+
comment '# '
|
4
|
+
|
5
|
+
# add a comment in the final conf
|
8
6
|
def add_comment comment
|
9
|
-
"\n###### #{comment} ######\n"
|
7
|
+
"\n###### #{comment} ######\n"
|
10
8
|
end
|
11
9
|
|
12
10
|
cmd :all do |cfg|
|
13
11
|
cfg.each_line.to_a[1..-2].join
|
14
12
|
end
|
15
|
-
|
16
|
-
#show the persistent configuration
|
13
|
+
|
14
|
+
# show the persistent configuration
|
17
15
|
pre do
|
18
16
|
cfg = add_comment 'THE HOSTNAME'
|
19
17
|
cfg += cmd 'cat /etc/hostname'
|
20
|
-
|
18
|
+
|
21
19
|
cfg += add_comment 'THE HOSTS'
|
22
20
|
cfg += cmd 'cat /etc/hosts'
|
23
|
-
|
21
|
+
|
24
22
|
cfg += add_comment 'THE INTERFACES'
|
25
23
|
cfg += cmd 'grep -r "" /etc/network/interface* | cut -d "/" -f 4-'
|
26
|
-
|
24
|
+
|
27
25
|
cfg += add_comment 'RESOLV.CONF'
|
28
26
|
cfg += cmd 'cat /etc/resolv.conf'
|
29
|
-
|
27
|
+
|
30
28
|
cfg += add_comment 'NTP.CONF'
|
31
29
|
cfg += cmd 'cat /etc/ntp.conf'
|
32
|
-
|
30
|
+
|
33
31
|
cfg += add_comment 'IP Routes'
|
34
32
|
cfg += cmd 'netstat -rn'
|
35
|
-
|
33
|
+
|
36
34
|
cfg += add_comment 'SNMP settings'
|
37
35
|
cfg += cmd 'cat /etc/snmp/snmpd.conf'
|
38
|
-
|
36
|
+
|
39
37
|
cfg += add_comment 'QUAGGA DAEMONS'
|
40
38
|
cfg += cmd 'cat /etc/quagga/daemons'
|
41
|
-
|
39
|
+
|
42
40
|
cfg += add_comment 'QUAGGA ZEBRA'
|
43
41
|
cfg += cmd 'cat /etc/quagga/zebra.conf'
|
44
|
-
|
42
|
+
|
45
43
|
cfg += add_comment 'QUAGGA BGP'
|
46
44
|
cfg += cmd 'cat /etc/quagga/bgpd.conf'
|
47
|
-
|
45
|
+
|
48
46
|
cfg += add_comment 'QUAGGA OSPF'
|
49
47
|
cfg += cmd 'cat /etc/quagga/ospfd.conf'
|
50
|
-
|
48
|
+
|
51
49
|
cfg += add_comment 'QUAGGA OSPF6'
|
52
50
|
cfg += cmd 'cat /etc/quagga/ospf6d.conf'
|
53
|
-
|
51
|
+
|
54
52
|
cfg += add_comment 'QUAGGA CONF'
|
55
53
|
cfg += cmd 'cat /etc/quagga/Quagga.conf'
|
56
|
-
|
54
|
+
|
57
55
|
cfg += add_comment 'MOTD'
|
58
56
|
cfg += cmd 'cat /etc/motd'
|
59
|
-
|
57
|
+
|
60
58
|
cfg += add_comment 'PASSWD'
|
61
59
|
cfg += cmd 'cat /etc/passwd'
|
62
|
-
|
60
|
+
|
63
61
|
cfg += add_comment 'SWITCHD'
|
64
62
|
cfg += cmd 'cat /etc/cumulus/switchd.conf'
|
65
|
-
|
63
|
+
|
66
64
|
cfg += add_comment 'PORTS'
|
67
65
|
cfg += cmd 'cat /etc/cumulus/ports.conf'
|
68
|
-
|
66
|
+
|
69
67
|
cfg += add_comment 'TRAFFIC'
|
70
68
|
cfg += cmd 'cat /etc/cumulus/datapath/traffic.conf'
|
71
|
-
|
69
|
+
|
72
70
|
cfg += add_comment 'ACL'
|
73
71
|
cfg += cmd 'iptables -L -n'
|
74
|
-
|
72
|
+
|
75
73
|
cfg += add_comment 'VERSION'
|
76
74
|
cfg += cmd 'cat /etc/cumulus/etc.replace/os-release'
|
77
|
-
|
75
|
+
|
78
76
|
cfg += add_comment 'License'
|
79
77
|
cfg += cmd 'cl-license'
|
80
|
-
|
81
78
|
end
|
82
|
-
|
83
79
|
|
84
80
|
cfg :telnet do
|
85
81
|
username /^Username:/
|
@@ -89,6 +85,4 @@ class Cumulus < Oxidized::Model
|
|
89
85
|
cfg :telnet, :ssh do
|
90
86
|
pre_logout 'exit'
|
91
87
|
end
|
92
|
-
|
93
|
-
|
94
88
|
end
|