oxidized 0.16.2 → 0.16.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25fe620dbb51b1d8dacb76a070dc15a94701276f
4
- data.tar.gz: f652f415b1b70df26a440e2afc79f52a911cd113
3
+ metadata.gz: cba5f31454c2e6512d70c1688f81885e82a97ad9
4
+ data.tar.gz: 40b8dfe37843039c8fef5cedc443a7101c78ffa1
5
5
  SHA512:
6
- metadata.gz: 584f5467dc20399b3c81d906e7b8531970d75ae4a04c8d190e999218c78dbfc0b42f31cc3d0913ca10afbadd3f279ff91c702ec2364bf9763c09dceb88ad9e34
7
- data.tar.gz: 974ed7ba183e5d91b067d993da98568ba708243df949b18a9c8de4913c0500151b8f4b0cae28720e5e21d56a5e578c0e1109c1a8c59cebb473cb08bb926edf97
6
+ metadata.gz: 8ca49b2ed227d5526c2d2093c794fd67a796822f7aeb30966060ac7ff46d12446b7c54fc6438b9e54e57d442422d92dccfaf5483e71141de066dfeda5d2726cc
7
+ data.tar.gz: 2df84d9068fcdebd9c633d627a189ea5eaf915c9e04dc00af03b372dfba944c5ad8e1e0508ab93968295136d69a892b9098dbcc0218e2880558bfccf04bbb119
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.16.3
2
+ - FEATURE: pfsense support (by @stokbaek)
3
+ - BUGFIX: cumulus prompt not working with default switch configs (by @nertwork)
4
+ - BUGFIX: disconnect ssh when prompt wasn't found (by @andir)
5
+ - BUGFIX: saos, asa, acos, timos updates, cumulus
6
+
1
7
  # 0.16.2
2
8
  - BUGFIX: when not using git (by @danilopopeye)
3
9
  - BUGFIX: screenos update
data/README.md CHANGED
@@ -1,6 +1,4 @@
1
- # Oxidized [![Build Status](https://travis-ci.org/Shopify/oxidized.svg)](https://travis-ci.org/Shopify/oxidized)
2
-
3
- [![Gem Version](https://badge.fury.io/rb/oxidized.svg)](http://badge.fury.io/rb/oxidized)
1
+ # Oxidized [![Build Status](https://travis-ci.org/Shopify/oxidized.svg)](https://travis-ci.org/Shopify/oxidized) [![Gem Version](https://badge.fury.io/rb/oxidized.svg)](http://badge.fury.io/rb/oxidized) [![Join the chat at https://gitter.im/oxidized/Lobby](https://badges.gitter.im/oxidized/Lobby.svg)](https://gitter.im/oxidized/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
2
 
5
3
  Oxidized is a network device configuration backup tool. It's a RANCID replacement!
6
4
 
@@ -50,7 +48,6 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
50
48
  * AOS
51
49
  * AOS7
52
50
  * ISAM
53
- * TiMOS
54
51
  * Wireless
55
52
  * Arista
56
53
  * EOS
@@ -118,10 +115,13 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
118
115
  * MasterOS
119
116
  * Netonix
120
117
  * WISP Switch (As Netonix)
118
+ * Nokia (formerly TiMetra, Alcatel, Alcatel-Lucent)
119
+ * SR OS (TiMOS)
121
120
  * Opengear
122
121
  * Opengear
123
122
  * Palo Alto
124
123
  * PANOS
124
+ * pfSense
125
125
  * Quanta
126
126
  * Quanta / VxWorks 6.6 (1.1.0.8)
127
127
  * Supermicro
@@ -420,6 +420,8 @@ source:
420
420
  url: https://url/api
421
421
  scheme: https
422
422
  delimiter: !ruby/regexp /:/
423
+ user: username
424
+ pass: password
423
425
  map:
424
426
  name: hostname
425
427
  model: os
@@ -510,7 +512,7 @@ output:
510
512
 
511
513
  ### Output types
512
514
 
513
- If you prefer to have different outputs in different files and/or directories, you can easily do this by modifying the corresponding model. To change the behaviour for IOS, you would edit `lib/oxidized/model/ios.rb`.
515
+ If you prefer to have different outputs in different files and/or directories, you can easily do this by modifying the corresponding model. To change the behaviour for IOS, you would edit `lib/oxidized/model/ios.rb` (run `gem contents oxidized` to find out the full file path).
514
516
 
515
517
  For example, let's say you want to split out `show version` and `show inventory` into separate files in a directory called `nodiff` which your tools will not send automated diffstats for. You can apply a patch along the lines of
516
518
 
data/bin/oxidized CHANGED
@@ -9,5 +9,6 @@ begin
9
9
  Oxidized::CLI.new.run
10
10
  rescue => error
11
11
  warn "#{error}"
12
- raise if Oxidized.config.debug
12
+ debug = Oxidied.config.debug rescue true
13
+ raise if debug
13
14
  end
data/lib/oxidized.rb CHANGED
@@ -43,7 +43,7 @@ module Oxidized
43
43
  else
44
44
  require 'logger'
45
45
  if config.has_key?('log')
46
- Logger.new(config.log)
46
+ Logger.new(File.expand_path(config.log))
47
47
  else
48
48
  Logger.new(STDERR)
49
49
  end
@@ -14,6 +14,9 @@ module Oxidized
14
14
  d = node.model.get
15
15
  disconnect
16
16
  d
17
+ rescue PromptUndetect
18
+ disconnect
19
+ raise
17
20
  end
18
21
 
19
22
  def connect_cli
@@ -6,6 +6,13 @@ class ACOS < Oxidized::Model
6
6
  ##ACOS prompt changes depending on the state of the device
7
7
  prompt /^([-\w.\/:?\[\]\(\)]+[#>]\s?)$/
8
8
 
9
+ cmd :secret do |cfg|
10
+ cfg.gsub!(/community read encrypted (\S+)/, 'community read encrypted <hidden>') # snmp
11
+ cfg.gsub!(/secret encrypted (\S+)/, 'secret encrypted <hidden>') # tacacs-server
12
+ cfg.gsub!(/password encrypted (\S+)/, 'password encrypted <hidden>') # user
13
+ cfg
14
+ end
15
+
9
16
  cmd 'show version' do |cfg|
10
17
  cfg.gsub! /\s(Last configuration saved at).*/, ' \\1 <removed>'
11
18
  cfg.gsub! /\s(Memory).*/, ' \\1 <removed>'
@@ -22,11 +29,20 @@ class ACOS < Oxidized::Model
22
29
  comment cfg
23
30
  end
24
31
 
32
+ cmd 'show partition-config all' do |cfg|
33
+ cfg.gsub! /(Current configuration).*/, '\\1 <removed>'
34
+ cfg.gsub! /(Configuration last updated at).*/, '\\1 <removed>'
35
+ cfg.gsub! /(Configuration last saved at).*/, '\\1 <removed>'
36
+ cfg.gsub! /(Configuration last synchronized at).*/, '\\1 <removed>'
37
+ cfg
38
+ end
39
+
25
40
  cmd 'show running-config all-partitions' do |cfg|
26
41
  cfg.gsub! /(Current configuration).*/, '\\1 <removed>'
27
42
  cfg.gsub! /(Configuration last updated at).*/, '\\1 <removed>'
28
43
  cfg.gsub! /(Configuration last saved at).*/, '\\1 <removed>'
29
44
  cfg.gsub! /(Configuration last synchronized at).*/, '\\1 <removed>'
45
+ cfg
30
46
  end
31
47
 
32
48
  cmd 'show aflex all-partitions' do |cfg|
@@ -13,6 +13,9 @@ class ASA < Oxidized::Model
13
13
  cmd :secret do |cfg|
14
14
  cfg.gsub! /enable password (\S+) (.*)/, 'enable password <secret hidden> \2'
15
15
  cfg.gsub! /username (\S+) password (\S+) (.*)/, 'username \1 password <secret hidden> \3'
16
+ cfg.gsub! /ikev2 pre-shared-key (\S+)/, 'ikev2 pre-shared-key <secret hidden>'
17
+ cfg.gsub! /ikev2 (remote|local)-authentication pre-shared-key (\S+)/, 'ikev2 \1-authentication pre-shared-key <secret hidden>'
18
+ cfg.gsub! /^(aaa-server TACACS\+? \(\S+\) host.*\n\skey) \S+$/mi, '\1 <secret hidden>'
16
19
  cfg
17
20
  end
18
21
 
@@ -1,6 +1,6 @@
1
1
  class Cumulus < Oxidized::Model
2
2
 
3
- prompt /^((\w*)@(.*)([>#]\s)+)$/
3
+ prompt /^((\w*)@(.*)):/
4
4
  comment '# '
5
5
 
6
6
 
@@ -22,7 +22,7 @@ class Cumulus < Oxidized::Model
22
22
  cfg += cmd 'cat /etc/hosts'
23
23
 
24
24
  cfg += add_comment 'THE INTERFACES'
25
- cfg += cmd 'cat /etc/network/interfaces'
25
+ cfg += cmd 'grep -r "" /etc/network/interface* | cut -d "/" -f 4-'
26
26
 
27
27
  cfg += add_comment 'RESOLV.CONF'
28
28
  cfg += cmd 'cat /etc/resolv.conf'
@@ -30,6 +30,9 @@ class Cumulus < Oxidized::Model
30
30
  cfg += add_comment 'NTP.CONF'
31
31
  cfg += cmd 'cat /etc/ntp.conf'
32
32
 
33
+ cfg += add_comment 'IP Routes'
34
+ cfg += cmd 'netstat -rn'
35
+
33
36
  cfg += add_comment 'QUAGGA DAEMONS'
34
37
  cfg += cmd 'cat /etc/quagga/daemons'
35
38
 
@@ -55,10 +58,13 @@ class Cumulus < Oxidized::Model
55
58
  cfg += cmd 'cat /etc/cumulus/switchd.conf'
56
59
 
57
60
  cfg += add_comment 'ACL'
58
- cfg += cmd 'iptables -L'
61
+ cfg += cmd 'iptables -L -n'
59
62
 
60
63
  cfg += add_comment 'VERSION'
61
64
  cfg += cmd 'cat /etc/cumulus/etc.replace/os-release'
65
+
66
+ cfg += add_comment 'License'
67
+ cfg += cmd 'cl-license'
62
68
 
63
69
  end
64
70
 
@@ -73,4 +79,4 @@ class Cumulus < Oxidized::Model
73
79
  end
74
80
 
75
81
 
76
- end
82
+ end
@@ -24,7 +24,12 @@ class DataCom < Oxidized::Model
24
24
  cfg.cut_head
25
25
  end
26
26
 
27
- cfg :telnet, :ssh do
27
+ cfg :ssh do
28
+ password /^Password:\s$/
29
+ pre_logout 'exit'
30
+ end
31
+
32
+ cfg :telnet do
28
33
  username /login:\s$/
29
34
  password /^Password:\s$/
30
35
  pre_logout 'exit'
@@ -0,0 +1,27 @@
1
+ class PfSense < Oxidized::Model
2
+
3
+ # use other use than 'admin' user, 'admin' user cannot get ssh/exec. See issue #535
4
+
5
+ comment '# '
6
+
7
+ #add a comment in the final conf
8
+ def add_comment comment
9
+ "\n###### #{comment} ######\n"
10
+ end
11
+
12
+ cmd :all do |cfg|
13
+ cfg.each_line.to_a[1..-2].join
14
+ end
15
+
16
+ #show the persistent configuration
17
+ pre do
18
+ cfg = add_comment 'Configuration'
19
+ cfg += cmd 'cat /cf/conf/config.xml'
20
+ end
21
+
22
+ cfg :ssh do
23
+ exec true
24
+ pre_logout 'exit'
25
+ end
26
+
27
+ end
@@ -17,8 +17,10 @@ class SAOS < Oxidized::Model
17
17
  username /login:/
18
18
  password /assword:/
19
19
  end
20
- cfg :telnet do
20
+
21
+ cfg :telnet, :ssh do
22
+ post_login 'system shell set more off'
21
23
  post_login 'system shell session set more off'
22
24
  pre_logout 'exit'
23
25
  end
24
- end
26
+ end
@@ -1,8 +1,10 @@
1
1
  class TiMOS < Oxidized::Model
2
2
 
3
- # Alcatel-Lucent TiMOS (Timetra)
4
- # used in SR/ESS/SAS routers
5
-
3
+ #
4
+ # Nokia SR OS (TiMOS) (formerly TiMetra, Alcatel, Alcatel-Lucent).
5
+ # Used in 7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, and NSP.
6
+ #
7
+
6
8
  comment '# '
7
9
 
8
10
  prompt /^([-\w\.:>\*]+\s?[#>]\s?)$/
@@ -12,26 +14,81 @@ class TiMOS < Oxidized::Model
12
14
  new_cfg << cfg.each_line.to_a[1..-2].join
13
15
  end
14
16
 
17
+ #
18
+ # Show the boot options file.
19
+ #
15
20
  cmd 'show bof' do |cfg|
16
21
  comment cfg
17
22
  end
18
23
 
24
+ #
25
+ # Show the system information.
26
+ #
19
27
  cmd 'show system information' do |cfg|
20
- # strip uptime
28
+ #
29
+ # Strip uptime.
30
+ #
21
31
  cfg.sub! /^System Up Time.*\n/, ''
22
32
  comment cfg
23
33
  end
24
34
 
35
+ #
36
+ # Show the card state.
37
+ #
25
38
  cmd 'show card state' do |cfg|
26
39
  comment cfg
27
40
  end
28
41
 
29
- cmd 'show boot-messages' do |cfg|
30
- cfg.gsub! /\r/, ""
42
+ #
43
+ # Show the boot log.
44
+ #
45
+ cmd 'file type bootlog.txt' do |cfg|
46
+ #
47
+ # Strip carriage returns and backspaces.
48
+ #
49
+ cfg.gsub! /\r/, ''
50
+ cfg.gsub! /[\b][\b][\b]/, "\n"
51
+ comment cfg
52
+ end
53
+
54
+ #
55
+ # Show the running debug configuration.
56
+ #
57
+ cmd 'show debug' do |cfg|
31
58
  comment cfg
32
59
  end
33
60
 
34
- cmd 'admin display-config'
61
+ #
62
+ # Show the saved debug configuration (admin debug-save).
63
+ #
64
+ cmd 'file type config.dbg' do |cfg|
65
+ #
66
+ # Strip carriage returns.
67
+ #
68
+ cfg.gsub! /\r/, ''
69
+ comment cfg
70
+ end
71
+
72
+ #
73
+ # Show the running persistent indices.
74
+ #
75
+ cmd 'admin display-config index' do |cfg|
76
+ #
77
+ # Strip carriage returns.
78
+ #
79
+ cfg.gsub! /\r/, ''
80
+ comment cfg
81
+ end
82
+
83
+ #
84
+ # Show the running configuration.
85
+ #
86
+ cmd 'admin display-config' do |cfg|
87
+ #
88
+ # Strip carriage returns.
89
+ #
90
+ cfg.gsub! /\r/, ''
91
+ end
35
92
 
36
93
  cfg :telnet do
37
94
  username /^Login: /
@@ -1,3 +1,3 @@
1
1
  module Oxidized
2
- VERSION = '0.16.2'
2
+ VERSION = '0.16.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxidized
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.2
4
+ version: 0.16.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-07-28 00:00:00.000000000 Z
13
+ date: 2016-08-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: asetus
@@ -256,6 +256,7 @@ files:
256
256
  - lib/oxidized/model/opengear.rb
257
257
  - lib/oxidized/model/outputs.rb
258
258
  - lib/oxidized/model/panos.rb
259
+ - lib/oxidized/model/pfsense.rb
259
260
  - lib/oxidized/model/powerconnect.rb
260
261
  - lib/oxidized/model/procurve.rb
261
262
  - lib/oxidized/model/quantaos.rb