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,5 +1,4 @@
1
1
  class DataCom < Oxidized::Model
2
-
3
2
  comment '! '
4
3
 
5
4
  expect /^--More--\s+$/ do |data, re|
@@ -34,5 +33,4 @@ class DataCom < Oxidized::Model
34
33
  password /^Password:\s$/
35
34
  pre_logout 'exit'
36
35
  end
37
-
38
36
  end
@@ -0,0 +1,46 @@
1
+ # DCNOS is a ZebOS derivative by DCN (http://www.dcnglobal.com/)
2
+ # In addition to products by DCN (now Yunke China), this OS type
3
+ # powers a number of re-branded OEM devices.
4
+
5
+ # Developed against SNR S2950-24G 7.0.3.5
6
+
7
+ class DCNOS < Oxidized::Model
8
+ comment '! '
9
+
10
+ cmd :all do |cfg|
11
+ cfg.each_line.to_a[1..-1].join
12
+ end
13
+
14
+ cmd 'show version' do |cfg|
15
+ cfg.gsub! /\s(Uptime is).*/, ''
16
+ comment cfg
17
+ end
18
+
19
+ cmd 'show boot-files' do |cfg|
20
+ comment cfg
21
+ end
22
+
23
+ cmd 'show flash' do |cfg|
24
+ comment cfg
25
+ end
26
+
27
+ cmd 'show running-config' do |cfg|
28
+ cfg
29
+ end
30
+
31
+ cfg :telnet do
32
+ username /^login:/i
33
+ password /^password:/i
34
+ end
35
+
36
+ cfg :telnet, :ssh do
37
+ if vars :enable
38
+ post_login do
39
+ send "enable\n"
40
+ cmd vars(:enable)
41
+ end
42
+ end
43
+ post_login 'terminal length 0'
44
+ pre_logout 'exit'
45
+ end
46
+ end
@@ -11,7 +11,7 @@ class Dlink < Oxidized::Model
11
11
  end
12
12
 
13
13
  cmd :all do |cfg|
14
- cfg.each_line.to_a[2..-2].map{|line|line.delete("\r").rstrip}.join("\n") + "\n"
14
+ cfg.each_line.to_a[2..-2].map { |line| line.delete("\r").rstrip }.join("\n") + "\n"
15
15
  end
16
16
 
17
17
  cmd 'show switch' do |cfg|
@@ -1,14 +1,15 @@
1
- class DNOS < Oxidized::Model
2
-
1
+ class DNOS < Oxidized::Model
3
2
  # Force10 DNOS model #
4
3
 
5
4
  comment '! '
6
5
 
7
6
  cmd :all do |cfg|
7
+ cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
8
+ cfg.gsub! /^Dell Networking OS uptime is\s.+/, '' # Omit constantly changing uptime info
8
9
  cfg.each_line.to_a[2..-2].join
9
10
  end
10
11
 
11
- cmd :secret do |cfg|
12
+ cmd :secret do |cfg|
12
13
  cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
13
14
  cfg.gsub! /secret (\d+) (\S+).*/, '<secret hidden>'
14
15
  cfg
@@ -22,6 +23,10 @@ class DNOS < Oxidized::Model
22
23
  comment cfg
23
24
  end
24
25
 
26
+ cmd 'show version' do |cfg|
27
+ comment cfg
28
+ end
29
+
25
30
  cmd 'show running-config' do |cfg|
26
31
  cfg = cfg.each_line.to_a[3..-1].join
27
32
  cfg
@@ -42,7 +47,6 @@ class DNOS < Oxidized::Model
42
47
  post_login 'terminal length 0'
43
48
  post_login 'terminal width 0'
44
49
  pre_logout 'exit'
45
- pre_logout 'exit'
50
+ pre_logout 'exit'
46
51
  end
47
-
48
52
  end
@@ -0,0 +1,45 @@
1
+ class EdgeCOS < Oxidized::Model
2
+ comment '! '
3
+
4
+ cmd :secret do |cfg|
5
+ cfg.gsub!(/password \d+ (\S+).*/, '<secret removed>')
6
+ cfg.gsub!(/community (\S+)/, 'community <hidden>')
7
+ cfg
8
+ end
9
+
10
+ cmd :all do |cfg|
11
+ cfg.each_line.to_a[2..-2].join
12
+ end
13
+
14
+ cmd 'show running-config'
15
+
16
+ cmd 'show access-list tcam-utilization' do |cfg|
17
+ comment cfg
18
+ end
19
+
20
+ cmd 'show memory' do |cfg|
21
+ comment cfg
22
+ end
23
+
24
+ cmd 'show system' do |cfg|
25
+ comment cfg
26
+ end
27
+
28
+ cmd 'show version' do |cfg|
29
+ comment cfg
30
+ end
31
+
32
+ cmd 'show watchdog' do |cfg|
33
+ comment cfg
34
+ end
35
+
36
+ cfg :telnet do
37
+ username /^Username:/
38
+ password /^Password:/
39
+ end
40
+
41
+ cfg :telnet, :ssh do
42
+ post_login 'terminal length 0'
43
+ pre_logout 'exit'
44
+ end
45
+ end
@@ -1,5 +1,4 @@
1
1
  class Edgeos < Oxidized::Model
2
-
3
2
  # EdgeOS #
4
3
 
5
4
  prompt /\@.*?\:~\$\s/
@@ -9,11 +8,15 @@ class Edgeos < Oxidized::Model
9
8
  end
10
9
 
11
10
  cmd :secret do |cfg|
11
+ cfg.gsub! /encrypted-password (\S+).*/, 'encrypted-password <secret removed>'
12
+ cfg.gsub! /plaintext-password (\S+).*/, 'plaintext-password <secret removed>'
13
+ cfg.gsub! /password (\S+).*/, 'password <secret removed>'
14
+ cfg.gsub! /pre-shared-secret (\S+).*/, 'pre-shared-secret <secret removed>'
12
15
  cfg.gsub! /community (\S+) {/, 'community <hidden> {'
13
16
  cfg
14
17
  end
15
18
 
16
- cmd 'show configuration | no-more'
19
+ cmd 'show configuration commands | no-more'
17
20
 
18
21
  cfg :telnet do
19
22
  username /login:\s/
@@ -23,5 +26,4 @@ class Edgeos < Oxidized::Model
23
26
  cfg :telnet, :ssh do
24
27
  pre_logout 'exit'
25
28
  end
26
-
27
29
  end
@@ -1,6 +1,5 @@
1
1
  class EdgeSwitch < Oxidized::Model
2
-
3
- # Ubiquiti EdgeSwitch #
2
+ # Ubiquiti EdgeSwitch #
4
3
 
5
4
  comment '!'
6
5
 
@@ -28,5 +27,4 @@ class EdgeSwitch < Oxidized::Model
28
27
  pre_logout 'quit'
29
28
  pre_logout 'n'
30
29
  end
31
-
32
30
  end
@@ -1,5 +1,4 @@
1
1
  class Enterasys < Oxidized::Model
2
-
3
2
  # Enterasys B3/C3 models #
4
3
 
5
4
  prompt /^.+\w\(su\)->\s?$/
@@ -7,7 +6,7 @@ class Enterasys < Oxidized::Model
7
6
  comment '!'
8
7
 
9
8
  cmd :all do |cfg|
10
- cfg.each_line.to_a[2..-3].map{|line|line.delete("\r").rstrip}.join("\n") + "\n"
9
+ cfg.each_line.to_a[2..-3].map { |line| line.delete("\r").rstrip }.join("\n") + "\n"
11
10
  end
12
11
 
13
12
  cmd 'show system hardware' do |cfg|
@@ -26,5 +25,4 @@ class Enterasys < Oxidized::Model
26
25
  cfg :ssh do
27
26
  pre_logout 'exit'
28
27
  end
29
-
30
28
  end
@@ -1,5 +1,4 @@
1
1
  class EOS < Oxidized::Model
2
-
3
2
  # Arista EOS model #
4
3
 
5
4
  prompt /^.+[#>]\s?$/
@@ -7,15 +6,15 @@ class EOS < Oxidized::Model
7
6
  comment '! '
8
7
 
9
8
  cmd :all do |cfg|
10
- cfg.each_line.to_a[1..-2].join
9
+ cfg.each_line.to_a[1..-2].join
11
10
  end
12
11
 
13
12
  cmd :secret do |cfg|
14
- cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
15
- cfg.gsub! /username (\S+) privilege (\d+) (\S+).*/, '<secret hidden>'
16
- cfg.gsub! /^(enable secret).*/, '\\1 <configuration removed>'
17
- cfg.gsub! /^(tacacs-server key \d+).*/, '\\1 <configuration removed>'
18
- cfg
13
+ cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
14
+ cfg.gsub! /username (\S+) privilege (\d+) (\S+).*/, '<secret hidden>'
15
+ cfg.gsub! /^(enable secret).*/, '\\1 <configuration removed>'
16
+ cfg.gsub! /^(tacacs-server key \d+).*/, '\\1 <configuration removed>'
17
+ cfg
19
18
  end
20
19
 
21
20
  cmd 'show inventory | no-more' do |cfg|
@@ -41,5 +40,4 @@ class EOS < Oxidized::Model
41
40
  end
42
41
  pre_logout 'exit'
43
42
  end
44
-
45
43
  end
@@ -1,22 +1,20 @@
1
1
  class FabricOS < Oxidized::Model
2
-
3
2
  # Brocade Fabric OS model #
4
3
  ## FIXME: Only ssh exec mode support, no telnet, no ssh screenscraping
5
4
 
6
5
  prompt /^([\w]+:+[\w]+[>]\s)$/
7
- comment '# '
6
+ comment '# '
8
7
 
9
8
  cmd 'chassisShow' do |cfg|
10
9
  comment cfg.each_line.reject { |line| line.match /Time Awake:/ or line.match /Power Usage \(Watts\):/ or line.match /Time Alive:/ or line.match /Update:/ }.join
11
10
  end
12
11
 
13
12
  cmd 'configShow -all' do |cfg|
14
- cfg = cfg.each_line.reject { |line| line.match /date = /}.join
13
+ cfg = cfg.each_line.reject { |line| line.match /date = / }.join
15
14
  cfg
16
15
  end
17
16
 
18
17
  cfg :ssh do
19
- exec true # don't run shell, run each command in exec channel
18
+ exec true # don't run shell, run each command in exec channel
20
19
  end
21
-
22
20
  end
@@ -1,6 +1,5 @@
1
1
  class FirewareOS < Oxidized::Model
2
-
3
- prompt /^([\w.@-]+[#>]\s?)$/
2
+ prompt /^\[?\w*\]?\w*?(<\w*>)?(#|>)\s*$/
4
3
  comment '-- '
5
4
 
6
5
  cmd :all do |cfg|
@@ -15,7 +14,7 @@ class FirewareOS < Oxidized::Model
15
14
 
16
15
  cmd 'show sysinfo' do |cfg|
17
16
  # avoid commits due to uptime
18
- cfg = cfg.each_line.select { |line| not line.match /(.*time.*)|(.*memory.*)|(.*cpu.*)/ }
17
+ cfg = cfg.each_line.reject { |line| line.match /(.*time.*)|(.*memory.*)|(.*cpu.*)/ }
19
18
  cfg = cfg.join
20
19
  comment cfg
21
20
  end
@@ -25,6 +24,4 @@ class FirewareOS < Oxidized::Model
25
24
  cfg :ssh do
26
25
  pre_logout 'exit'
27
26
  end
28
-
29
27
  end
30
-
@@ -1,6 +1,5 @@
1
1
  class FortiOS < Oxidized::Model
2
-
3
- comment '# '
2
+ comment '# '
4
3
 
5
4
  prompt /^([-\w\.\~]+(\s[\(\w\-\.\)]+)?\~?\s?[#>$]\s?)$/
6
5
 
@@ -15,15 +14,22 @@ class FortiOS < Oxidized::Model
15
14
  end
16
15
 
17
16
  cmd :secret do |cfg|
18
- cfg.gsub! /(set (?:passwd|password|secondary-secret|rsso-secret|psksecret|secret|key ENC)).*/, '\\1 <configuration removed>'
19
- cfg.gsub! /(set private-key).*-+END ENCRYPTED PRIVATE KEY-*"$/m , '\\1 <configuration removed>'
20
- cfg.gsub! /(IPS Malicious URL Database).*/, '\\1 <configuration removed>'
17
+ # ENC indicates an encrypted password, and secret indicates a secret string
18
+ cfg.gsub! /(set .+ ENC) .+/, '\\1 <configuration removed>'
19
+ cfg.gsub! /(set .*secret) .+/, '\\1 <configuration removed>'
20
+ # A number of other statements also contains sensitive strings
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 private-key).*-+END ENCRYPTED PRIVATE KEY-*"$/m, '\\1 <configuration removed>'
23
+ cfg.gsub! /(set ca ).*-+END CERTIFICATE-*"$/m, '\\1 <configuration removed>'
24
+ cfg.gsub! /(set csr ).*-+END CERTIFICATE REQUEST-*"$/m, '\\1 <configuration removed>'
25
+ cfg.gsub! /(Cluster uptime:).*/, '\\1 <stripped>'
21
26
  cfg
22
27
  end
23
28
 
24
29
  cmd 'get system status' do |cfg|
25
30
  @vdom_enabled = cfg.include? 'Virtual domain configuration: enable'
26
31
  cfg.gsub!(/(System time: )(.*)/, '\1<stripped>\3')
32
+ cfg.gsub! /(Virus-DB|Extended DB|IPS-DB|IPS-ETDB|APP-DB|INDUSTRIAL-DB|Botnet DB|IPS Malicious URL Database).*/, '\\1 <db version stripped>'
27
33
  comment cfg
28
34
  end
29
35
 
@@ -32,21 +38,21 @@ class FortiOS < Oxidized::Model
32
38
  cfg << cmd('config global') if @vdom_enabled
33
39
 
34
40
  cfg << cmd('get hardware status') do |cfg|
35
- comment cfg
41
+ comment cfg
36
42
  end
37
43
 
38
- #default behaviour: include autoupdate output (backwards compatibility)
39
- #do not include if variable "show_autoupdate" is set to false
40
- if defined?(vars(:fortios_autoupdate)).nil? || vars(:fortios_autoupdate)
41
- cfg << cmd('diagnose autoupdate version') do |cfg|
42
- cfg.gsub! /(FDS Address\n---------\n).*/, '\\1IP Address removed'
43
- comment cfg.each_line.reject { |line| line.match /Last Update|Result/ }.join
44
- end
44
+ # default behaviour: include autoupdate output (backwards compatibility)
45
+ # do not include if variable "show_autoupdate" is set to false
46
+ if defined?(vars(:fortios_autoupdate)).nil? || vars(:fortios_autoupdate)
47
+ cfg << cmd('diagnose autoupdate version') do |cfg|
48
+ cfg.gsub! /(FDS Address\n---------\n).*/, '\\1IP Address removed'
49
+ comment cfg.each_line.reject { |line| line.match /Last Update|Result/ }.join
50
+ end
45
51
  end
46
52
 
47
- cfg << cmd('end') if @vdom_enabled
53
+ cfg << cmd('end') if @vdom_enabled
48
54
 
49
- cfg << cmd('show')
55
+ cfg << cmd('show full-configuration | grep .')
50
56
  cfg.join "\n"
51
57
  end
52
58
 
@@ -58,6 +64,4 @@ cfg << cmd('end') if @vdom_enabled
58
64
  cfg :telnet, :ssh do
59
65
  pre_logout "exit\n"
60
66
  end
61
-
62
67
  end
63
-
@@ -1,5 +1,4 @@
1
- class FTOS < Oxidized::Model
2
-
1
+ class FTOS < Oxidized::Model
3
2
  # Force10 FTOS model #
4
3
 
5
4
  comment '! '
@@ -8,7 +7,7 @@ class FTOS < Oxidized::Model
8
7
  cfg.each_line.to_a[2..-2].join
9
8
  end
10
9
 
11
- cmd :secret do |cfg|
10
+ cmd :secret do |cfg|
12
11
  cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
13
12
  cfg.gsub! /secret (\d+) (\S+).*/, '<secret hidden>'
14
13
  cfg
@@ -45,5 +44,4 @@ class FTOS < Oxidized::Model
45
44
  end
46
45
  pre_logout 'exit'
47
46
  end
48
-
49
47
  end
@@ -1,5 +1,4 @@
1
1
  class FujitsuPY < Oxidized::Model
2
-
3
2
  prompt /^(\([\w.-]*\)\s#|^\S+\#\s)$/
4
3
  comment '! '
5
4
 
@@ -7,13 +6,13 @@ class FujitsuPY < Oxidized::Model
7
6
  cfg.each_line.to_a[1..-2].join
8
7
  end
9
8
 
10
- # 1Gbe switch
9
+ # 1Gbe switch
11
10
  cmd 'show version' do |cfg|
12
11
  cfg.gsub! /^(<ERROR> : 2 : format error)$/, ''
13
12
  comment cfg
14
13
  end
15
14
 
16
- # 10Gbe switch
15
+ # 10Gbe switch
17
16
  cmd 'show system information' do |cfg|
18
17
  cfg.gsub! /^Current-time : [\w\s:]*$/, ''
19
18
  cfg.gsub! /^(\s{33}\^)$/, ''
@@ -38,5 +37,4 @@ class FujitsuPY < Oxidized::Model
38
37
  send "n\n"
39
38
  end
40
39
  end
41
-
42
40
  end
@@ -1,25 +1,23 @@
1
1
  class GaiaOS < Oxidized::Model
2
-
3
2
  # CheckPoint - Gaia OS Model
4
-
3
+
5
4
  # Gaia Prompt
6
5
  prompt /^([\[\]\w.@:-]+[#>]\s?)$/
7
6
 
8
7
  # Comment tag
9
8
  comment '# '
10
9
 
11
-
12
10
  cmd :all do |cfg|
13
11
  cfg = cfg.each_line.to_a[1..-2].join
14
12
  end
15
13
 
16
14
  cmd :secret do |cfg|
17
15
  cfg.gsub! /^(set expert-password-hash ).*/, '\1<EXPERT PASSWORD REMOVED>'
18
- cfg.gsub! /^(set user \S+ password-hash ).*/,'\1<USER PASSWORD REMOVED>'
19
- cfg.gsub! /^(set ospf .* secret ).*/,'\1<OSPF KEY REMOVED>'
20
- cfg.gsub! /^(set snmp community )(.*)( read-only.*)/,'\1<SNMP COMMUNITY REMOVED>\3'
21
- cfg.gsub! /^(add snmp .* community )(.*)(\S?.*)/,'\1<SNMP COMMUNITY REMOVED>\3'
22
- cfg.gsub! /(auth|privacy)(-pass-phrase-hashed )(\S*)/,'\1-pass-phrase-hashed <SNMP PASS-PHRASE REMOVED>'
16
+ cfg.gsub! /^(set user \S+ password-hash ).*/, '\1<USER PASSWORD REMOVED>'
17
+ cfg.gsub! /^(set ospf .* secret ).*/, '\1<OSPF KEY REMOVED>'
18
+ cfg.gsub! /^(set snmp community )(.*)( read-only.*)/, '\1<SNMP COMMUNITY REMOVED>\3'
19
+ cfg.gsub! /^(add snmp .* community )(.*)(\S?.*)/, '\1<SNMP COMMUNITY REMOVED>\3'
20
+ cfg.gsub! /(auth|privacy)(-pass-phrase-hashed )(\S*)/, '\1-pass-phrase-hashed <SNMP PASS-PHRASE REMOVED>'
23
21
  cfg
24
22
  end
25
23
 
@@ -36,11 +34,9 @@ class GaiaOS < Oxidized::Model
36
34
  cfg
37
35
  end
38
36
 
39
-
40
37
  cfg :ssh do
41
38
  # User shell must be /etc/cli.sh
42
39
  post_login 'set clienv rows 0'
43
40
  pre_logout 'exit'
44
41
  end
45
-
46
42
  end