oxidized 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +5 -5
  2. data/.github/no-response.yml +13 -0
  3. data/.gitignore +3 -0
  4. data/.rubocop.yml +37 -0
  5. data/.rubocop_todo.yml +714 -0
  6. data/.travis.yml +7 -1
  7. data/CHANGELOG.md +341 -243
  8. data/Dockerfile +44 -16
  9. data/LICENSE +201 -0
  10. data/README.md +114 -82
  11. data/Rakefile +19 -0
  12. data/TODO.md +29 -23
  13. data/bin/oxidized +1 -2
  14. data/docs/Configuration.md +71 -31
  15. data/docs/Creating-Models.md +78 -0
  16. data/docs/Hooks.md +145 -41
  17. data/docs/Model-Notes/AireOS.md +12 -0
  18. data/docs/Model-Notes/ArbOS.md +12 -0
  19. data/docs/Model-Notes/Comware.md +14 -0
  20. data/docs/Model-Notes/EOS.md +9 -0
  21. data/docs/Model-Notes/JunOS.md +34 -0
  22. data/docs/Model-Notes/Netgear.md +68 -0
  23. data/docs/Model-Notes/README.md +19 -0
  24. data/docs/{VRP-Huawei.md → Model-Notes/VRP-Huawei.md} +10 -2
  25. data/docs/Model-Notes/XGS4600-Zyxel.md +39 -0
  26. data/docs/Outputs.md +27 -28
  27. data/docs/Ruby-API.md +38 -18
  28. data/docs/Sources.md +78 -16
  29. data/docs/Supported-OS-Types.md +171 -148
  30. data/extra/oxidized.logrotate +7 -0
  31. data/extra/oxidized.service +1 -1
  32. data/extra/rest_client.rb +4 -5
  33. data/extra/syslog.rb +16 -16
  34. data/lib/oxidized/cli.rb +3 -3
  35. data/lib/oxidized/config.rb +7 -4
  36. data/lib/oxidized/core.rb +3 -3
  37. data/lib/oxidized/hook.rb +64 -65
  38. data/lib/oxidized/hook/awssns.rb +2 -3
  39. data/lib/oxidized/hook/ciscosparkdiff.rb +49 -0
  40. data/lib/oxidized/hook/exec.rb +5 -5
  41. data/lib/oxidized/hook/githubrepo.rb +20 -14
  42. data/lib/oxidized/hook/slackdiff.rb +38 -19
  43. data/lib/oxidized/hook/xmppdiff.rb +58 -0
  44. data/lib/oxidized/input/cli.rb +5 -6
  45. data/lib/oxidized/input/ftp.rb +8 -7
  46. data/lib/oxidized/input/http.rb +39 -0
  47. data/lib/oxidized/input/ssh.rb +24 -22
  48. data/lib/oxidized/input/telnet.rb +38 -32
  49. data/lib/oxidized/jobs.rb +3 -4
  50. data/lib/oxidized/manager.rb +9 -4
  51. data/lib/oxidized/model/acos.rb +15 -16
  52. data/lib/oxidized/model/acsw.rb +3 -8
  53. data/lib/oxidized/model/aen.rb +1 -2
  54. data/lib/oxidized/model/aireos.rb +3 -5
  55. data/lib/oxidized/model/alteonos.rb +16 -18
  56. data/lib/oxidized/model/alvarion.rb +0 -4
  57. data/lib/oxidized/model/aos.rb +2 -4
  58. data/lib/oxidized/model/aos7.rb +2 -3
  59. data/lib/oxidized/model/aosw.rb +13 -15
  60. data/lib/oxidized/model/apc_aos.rb +0 -3
  61. data/lib/oxidized/model/arbos.rb +26 -0
  62. data/lib/oxidized/model/aricentiss.rb +51 -0
  63. data/lib/oxidized/model/asa.rb +33 -35
  64. data/lib/oxidized/model/asyncos.rb +41 -44
  65. data/lib/oxidized/model/audiocodes.rb +4 -8
  66. data/lib/oxidized/model/awplus.rb +84 -0
  67. data/lib/oxidized/model/boss.rb +6 -5
  68. data/lib/oxidized/model/br6910.rb +43 -45
  69. data/lib/oxidized/model/c4cmts.rb +3 -5
  70. data/lib/oxidized/model/cambium.rb +22 -0
  71. data/lib/oxidized/model/catos.rb +0 -2
  72. data/lib/oxidized/model/cisconga.rb +1 -3
  73. data/lib/oxidized/model/ciscosma.rb +37 -40
  74. data/lib/oxidized/model/ciscosmb.rb +7 -4
  75. data/lib/oxidized/model/comnetms.rb +43 -0
  76. data/lib/oxidized/model/comware.rb +9 -9
  77. data/lib/oxidized/model/coriant8600.rb +3 -5
  78. data/lib/oxidized/model/coriantgroove.rb +3 -5
  79. data/lib/oxidized/model/corianttmos.rb +1 -3
  80. data/lib/oxidized/model/cumulus.rb +26 -32
  81. data/lib/oxidized/model/datacom.rb +0 -2
  82. data/lib/oxidized/model/dcnos.rb +46 -0
  83. data/lib/oxidized/model/dlink.rb +1 -1
  84. data/lib/oxidized/model/dnos.rb +9 -5
  85. data/lib/oxidized/model/edgecos.rb +45 -0
  86. data/lib/oxidized/model/edgeos.rb +5 -3
  87. data/lib/oxidized/model/edgeswitch.rb +1 -3
  88. data/lib/oxidized/model/enterasys.rb +1 -3
  89. data/lib/oxidized/model/eos.rb +6 -8
  90. data/lib/oxidized/model/fabricos.rb +3 -5
  91. data/lib/oxidized/model/firewareos.rb +2 -5
  92. data/lib/oxidized/model/fortios.rb +21 -17
  93. data/lib/oxidized/model/ftos.rb +2 -4
  94. data/lib/oxidized/model/fujitsupy.rb +2 -4
  95. data/lib/oxidized/model/gaiaos.rb +6 -10
  96. data/lib/oxidized/model/gcombnps.rb +82 -0
  97. data/lib/oxidized/model/hatteras.rb +8 -5
  98. data/lib/oxidized/model/hirschmann.rb +8 -10
  99. data/lib/oxidized/model/hpebladesystem.rb +19 -17
  100. data/lib/oxidized/model/hpemsa.rb +0 -3
  101. data/lib/oxidized/model/ios.rb +54 -55
  102. data/lib/oxidized/model/iosxe.rb +5 -0
  103. data/lib/oxidized/model/iosxr.rb +1 -3
  104. data/lib/oxidized/model/ipos.rb +1 -3
  105. data/lib/oxidized/model/ironware.rb +12 -15
  106. data/lib/oxidized/model/isam.rb +4 -5
  107. data/lib/oxidized/model/junos.rb +8 -7
  108. data/lib/oxidized/model/masteros.rb +1 -3
  109. data/lib/oxidized/model/mlnxos.rb +3 -4
  110. data/lib/oxidized/model/model.rb +15 -7
  111. data/lib/oxidized/model/mtrlrfs.rb +1 -4
  112. data/lib/oxidized/model/ndms.rb +24 -0
  113. data/lib/oxidized/model/netgear.rb +3 -4
  114. data/lib/oxidized/model/netscaler.rb +0 -2
  115. data/lib/oxidized/model/nos.rb +1 -3
  116. data/lib/oxidized/model/nxos.rb +13 -3
  117. data/lib/oxidized/model/oneos.rb +6 -8
  118. data/lib/oxidized/model/openbsd.rb +76 -0
  119. data/lib/oxidized/model/opengear.rb +3 -5
  120. data/lib/oxidized/model/openwrt.rb +77 -0
  121. data/lib/oxidized/model/opnsense.rb +19 -0
  122. data/lib/oxidized/model/outputs.rb +1 -3
  123. data/lib/oxidized/model/panos.rb +1 -2
  124. data/lib/oxidized/model/pfsense.rb +9 -5
  125. data/lib/oxidized/model/planet.rb +8 -12
  126. data/lib/oxidized/model/powerconnect.rb +6 -9
  127. data/lib/oxidized/model/procurve.rb +18 -4
  128. data/lib/oxidized/model/quantaos.rb +3 -5
  129. data/lib/oxidized/model/routeros.rb +3 -2
  130. data/lib/oxidized/model/saos.rb +0 -1
  131. data/lib/oxidized/model/screenos.rb +3 -5
  132. data/lib/oxidized/model/sgos.rb +2 -3
  133. data/lib/oxidized/model/siklu.rb +0 -2
  134. data/lib/oxidized/model/slxos.rb +59 -0
  135. data/lib/oxidized/model/sros.rb +117 -0
  136. data/lib/oxidized/model/stoneos.rb +32 -0
  137. data/lib/oxidized/model/supermicro.rb +6 -41
  138. data/lib/oxidized/model/timos.rb +6 -114
  139. data/lib/oxidized/model/tmos.rb +1 -3
  140. data/lib/oxidized/model/tplink.rb +7 -11
  141. data/lib/oxidized/model/trango.rb +6 -7
  142. data/lib/oxidized/model/ucs.rb +0 -1
  143. data/lib/oxidized/model/voltaire.rb +3 -6
  144. data/lib/oxidized/model/voss.rb +1 -2
  145. data/lib/oxidized/model/vrp.rb +4 -5
  146. data/lib/oxidized/model/vyatta.rb +6 -4
  147. data/lib/oxidized/model/weos.rb +1 -3
  148. data/lib/oxidized/model/xos.rb +6 -5
  149. data/lib/oxidized/model/zhoneolt.rb +2 -2
  150. data/lib/oxidized/model/zynos.rb +1 -3
  151. data/lib/oxidized/model/zynoscli.rb +36 -0
  152. data/lib/oxidized/node.rb +11 -11
  153. data/lib/oxidized/node/stats.rb +15 -2
  154. data/lib/oxidized/nodes.rb +8 -8
  155. data/lib/oxidized/output/file.rb +41 -42
  156. data/lib/oxidized/output/git.rb +113 -115
  157. data/lib/oxidized/output/gitcrypt.rb +241 -242
  158. data/lib/oxidized/output/http.rb +23 -27
  159. data/lib/oxidized/output/output.rb +1 -2
  160. data/lib/oxidized/source/csv.rb +44 -45
  161. data/lib/oxidized/source/http.rb +52 -49
  162. data/lib/oxidized/source/source.rb +6 -7
  163. data/lib/oxidized/source/sql.rb +55 -51
  164. data/lib/oxidized/string.rb +3 -4
  165. data/lib/oxidized/version.rb +17 -1
  166. data/lib/oxidized/worker.rb +12 -3
  167. data/oxidized.gemspec +19 -13
  168. metadata +139 -51
  169. data/.ruby-version +0 -1
  170. 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
@@ -1,5 +1,4 @@
1
1
  class Catos < Oxidized::Model
2
-
3
2
  prompt /^[\w.@-]+>\s?(\(enable\) )?$/
4
3
  comment '# '
5
4
 
@@ -39,5 +38,4 @@ class Catos < Oxidized::Model
39
38
  end
40
39
  pre_logout 'exit'
41
40
  end
42
-
43
41
  end
@@ -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
- # SMA prompt "mail.example.com> "
4
- prompt /^\r*([-\w. ]+\.[-\w. ]+\.[-\w. ]+[#>]\s+)$/
5
- comment '! '
6
-
7
- # Select passphrase display option
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
- cmd 'showconfig' do |cfg|
24
- #Delete hour and date which change each run
25
- #cfg.gsub! /\sCurrent Time: \S+\s\S+\s+\S+\s\S+\s\S+/, ' Current Time:'
26
- # Delete select passphrase display option
27
- cfg.gsub! /Do you want to mask the password\? Files with masked passwords cannot be loaded/, ''
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
- end
40
-
41
- cfg :ssh do
42
- pre_logout "exit"
43
- end
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.select {|l| not l.match /uptime/i }.join
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