oxidized 0.2.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 685b7ced661d1682eb3702d88419a71e17069868
4
- data.tar.gz: 0e3194c5964e0f803d70382e0f227c25d0a574b4
3
+ metadata.gz: c4e125d54180398e4fd35652a8ca384c85d451ec
4
+ data.tar.gz: 46cef914c85dcaadfafcbde310d7c9bbc3707f0b
5
5
  SHA512:
6
- metadata.gz: 4bfa8faf73182f97fd614db4b5530e6e37bcc632b3d0380d5dfff9d6f5336c17be6dffc833b3c7a25c82a88e0841788e92f4c51340a6729eee931ceadfec0685
7
- data.tar.gz: 5929ddbd24859dfcb219deeba837f5070a5cea4327eb9b8b0b643c09045fbf59cc82d4d1759de7dc5f1913445d91fe0e397e22d2eb9cf5b78322de5d953b25ce
6
+ metadata.gz: 0261cf513efbab1d3bc06ff184c72e70d7371256628441501e2b1d2a44796531091f4fba0eee3b93130993030c4c3e1d78d8c33db01727c17af1760337640f32
7
+ data.tar.gz: 0662f963ddcbd6da7ab8e6e1cd12ef723c88511cd69ed4673e58e66f00657287cc39c6aec9b0e66bb4c2b441474aa76a67f5bab3a8b5ed7e16ddd1c845236272
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # 0.3.0
2
2
  - FEATURE: *FIXME* bunch of stuff I did for richih, docs needed
3
+ - FEATURE: ComWare model (by erJasp)
4
+ - FEATURE: Add comment support for router.db file
5
+ - FEATURE: Add input debugging and related configuration options
6
+ - BUGFIX: Fix ASA model prompt
7
+ - BUGFIX: Fix Aruba model display
8
+ - BUGFIX: Fix changing output in PowerConnect model
3
9
 
4
10
  # 0.2.4
5
11
  - FEATURE: Cisco SMB (Nikola series VxWorks) model by @thetamind
data/README.md CHANGED
@@ -57,6 +57,7 @@ Oxidized is a network device configration backup tool. Its a RANCID replacment!
57
57
  * Extreme Networks XOS
58
58
  * Force10 FTOS
59
59
  * FortiGate FortiOS
60
+ * HP Comware (HP A-series, H3C, 3Com)
60
61
  * HP ProCurve
61
62
  * Huawei VRP
62
63
  * Juniper JunOS
data/TODO.md CHANGED
@@ -1,3 +1,17 @@
1
+ # refactor core
2
+ * move state from memory to disk, sqlite probably
3
+ * allows us to retain stats etc over restart
4
+ * simplifies code
5
+ * keep only running nodes in memory
6
+ * negligible I/O cost, as majority is I/O wait getting config
7
+
8
+ # separate login to owon package
9
+ * oxidized-script is not only use-case
10
+ * it would be good to have minimal package used to login to routers
11
+ * oxidized just one consumer of that functionality
12
+ * what to do with models, we need model to know how to login. Should models be separated to another package? oxidized-core, oxidized-models and oxidized-login?
13
+ * how can we allow interactive login in oxidized-login? With functional VTY etc? REPL loop in input/ssh and input/telnet?
14
+
1
15
  # thread number
2
16
  * think about algo
3
17
  * if job ended later than now-iteration have rand(node.size) == 0 to add thread
@@ -6,4 +20,4 @@
6
20
 
7
21
  # docs, testing
8
22
  * yard docs
9
- * rspec tests
23
+ * minitest tests
@@ -0,0 +1,86 @@
1
+ #!/bin/sh
2
+ #
3
+ # Written by Stefan Schlesinger / sts@ono.at / http://sts.ono.at
4
+ #
5
+ ### BEGIN INIT INFO
6
+ # Provides: oxidized
7
+ # Required-Start: $remote_fs $syslog
8
+ # Required-Stop: $remote_fs $syslog
9
+ # Default-Start: 2 3 4 5
10
+ # Default-Stop: 0 1 6
11
+ # Short-Description: Start Oxidized at boot time
12
+ # Description: Oxidized - Network Device Configuration Backup Tool
13
+ ### END INIT INFO
14
+
15
+ set -e
16
+
17
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin
18
+ DAEMON=/home/sts/oxidized/bin/oxidized
19
+ NAME="oxidized"
20
+ DESC="Oxidized - Network Device Configuration Backup Tool"
21
+ ARGS=""
22
+ USER="sts"
23
+
24
+ test -x $DAEMON || exit 0
25
+
26
+ . /lib/lsb/init-functions
27
+
28
+ if [ -r /etc/default/$NAME ]; then
29
+ . /etc/default/$NAME
30
+ fi
31
+
32
+ CONFIG="${CONFIG:-/etc/oxidized/config}"
33
+
34
+ PIDFILE=/var/run/$NAME.pid
35
+
36
+ do_start()
37
+ {
38
+ start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile \
39
+ --oknodo --chuid $USER --exec $DAEMON -- -c $CONFIG $ARGS
40
+ }
41
+
42
+ do_stop()
43
+ {
44
+ start-stop-daemon --oknodo --stop --quiet -v --pidfile $PIDFILE \
45
+ --chuid $USER --retry KILL/10 -- -c $CONFIG $ARGS
46
+ }
47
+
48
+ case "$1" in
49
+ start)
50
+ if [ "$ENABLED" = "no" ]; then
51
+ log_failure_msg "Not starting $DESC: disabled via /etc/default/$NAME"
52
+ exit 0
53
+ fi
54
+
55
+ log_daemon_msg "Starting $DESC..." "$NAME"
56
+ if do_start ; then
57
+ log_end_msg 0
58
+ else
59
+ log_end_msg 1
60
+ fi
61
+ ;;
62
+ stop)
63
+ log_daemon_msg "Stopping $DESC..." "$NAME"
64
+ if do_stop ; then
65
+ log_end_msg 0
66
+ else
67
+ log_end_msg 1
68
+ fi
69
+ ;;
70
+
71
+ restart|force-reload)
72
+ $0 stop
73
+ sleep 1
74
+ $0 start
75
+ ;;
76
+ status)
77
+ status_of_proc -p $PIDFILE $DAEMON $NAME
78
+ ;;
79
+ *)
80
+ N=/etc/init.d/$NAME
81
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
82
+ exit 1
83
+ ;;
84
+ esac
85
+
86
+ exit 0
@@ -0,0 +1,41 @@
1
+ class Comware < Oxidized::Model
2
+ # HP (A-series)/H3C/3Com Comware
3
+
4
+ prompt /^(<[\w.-]+>)$/
5
+ comment '# '
6
+
7
+ # example how to handle pager
8
+ #expect /^\s*---- More ----$/ do |data, re|
9
+ # send ' '
10
+ # data.sub re, ''
11
+ #end
12
+
13
+ cmd :all do |cfg|
14
+ #cfg.gsub! /^.*\e\[42D/, '' # example how to handle pager
15
+ cfg.each_line.to_a[1..-2].join
16
+ end
17
+
18
+ cfg :telnet do
19
+ username /^Username:$/
20
+ password /^Password:$/
21
+ end
22
+
23
+ cfg :telnet, :ssh do
24
+ post_login 'screen-length disable'
25
+ post_login 'undo terminal monitor'
26
+ pre_logout 'quit'
27
+ end
28
+
29
+ cmd 'display version' do |cfg|
30
+ cfg = cfg.each_line.select {|l| not l.match /uptime/ }.join
31
+ comment cfg
32
+ end
33
+
34
+ cmd 'display device' do |cfg|
35
+ comment cfg
36
+ end
37
+
38
+ cmd 'display current-configuration' do |cfg|
39
+ cfg
40
+ end
41
+ end
data/oxidized.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'oxidized'
3
- s.version = '0.2.4'
3
+ s.version = '0.3.0'
4
4
  s.licenses = %w( Apache-2.0 )
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = [ 'Saku Ytti', 'Samer Abdel-Hafez' ]
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.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-02 00:00:00.000000000 Z
12
+ date: 2015-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asetus
@@ -68,6 +68,7 @@ files:
68
68
  - Rakefile
69
69
  - TODO.md
70
70
  - bin/oxidized
71
+ - extra/oxidized.init
71
72
  - extra/rest_client.rb
72
73
  - extra/syslog.rb
73
74
  - lib/oxidized.rb
@@ -91,6 +92,7 @@ files:
91
92
  - lib/oxidized/model/aosw.rb
92
93
  - lib/oxidized/model/asa.rb
93
94
  - lib/oxidized/model/ciscosmb.rb
95
+ - lib/oxidized/model/comware.rb
94
96
  - lib/oxidized/model/eos.rb
95
97
  - lib/oxidized/model/fabricos.rb
96
98
  - lib/oxidized/model/fortios.rb
@@ -144,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
146
  version: '0'
145
147
  requirements: []
146
148
  rubyforge_project: oxidized
147
- rubygems_version: 2.2.2
149
+ rubygems_version: 2.4.5
148
150
  signing_key:
149
151
  specification_version: 4
150
152
  summary: feeble attempt at rancid