summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md31
-rwxr-xr-xextra/auto-reload-config.runit2
-rwxr-xr-xextra/oxidized.init6
-rw-r--r--lib/oxidized/input/ssh.rb5
-rw-r--r--lib/oxidized/model/alvarion.rb4
-rw-r--r--lib/oxidized/model/cisconga.rb19
-rw-r--r--lib/oxidized/model/saos.rb3
7 files changed, 62 insertions, 8 deletions
diff --git a/README.md b/README.md
index f1eaac4..5dcd7e0 100644
--- a/README.md
+++ b/README.md
@@ -75,13 +75,14 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
* Check Point
* [GaiaOS](lib/oxidized/model/gaiaos.rb)
* Ciena
- * [SOAS](lib/oxidized/model/saos.rb)
+ * [SAOS](lib/oxidized/model/saos.rb)
* Cisco
* [AireOS](lib/oxidized/model/aireos.rb)
* [ASA](lib/oxidized/model/asa.rb)
* [CatOS](lib/oxidized/model/catos.rb)
* [IOS](lib/oxidized/model/ios.rb)
* [IOSXR](lib/oxidized/model/iosxr.rb)
+ * [NGA](lib/oxidized/model/cisconga.rb)
* [NXOS](lib/oxidized/model/nxos.rb)
* [SMB (Nikola series)](lib/oxidized/model/ciscosmb.rb)
* Citrix
@@ -897,6 +898,34 @@ hooks:
channel: "#network-changes"
```
+# Extra
+
+## Ubuntu SystemV init setup
+
+The init script assumes that you have a used named 'oxidized' and that oxidized is in one of the following paths:
+
+```
+/sbin
+/bin
+/usr/sbin
+/usr/bin
+/usr/local/bin
+```
+
+1.)Copy init script from extra/ folder to /etc/init.d/oxidized
+2.)Setup /var/run/
+
+```
+mkdir /var/run/oxidized
+chown oxidized:oxidized /var/run/oxidized
+```
+
+3.)Make oxidized start on boot
+
+```
+update-rc.d oxidized deafults
+```
+
Note the channel name must be in quotes.
# Ruby API
diff --git a/extra/auto-reload-config.runit b/extra/auto-reload-config.runit
index 5eaecc8..cf6e7c2 100755
--- a/extra/auto-reload-config.runit
+++ b/extra/auto-reload-config.runit
@@ -2,7 +2,7 @@
if [ -z "$CONFIG_RELOAD_INTERVAL" ]; then
# Just stop and do nothing
- read
+ sleep infinity
fi
while true; do
diff --git a/extra/oxidized.init b/extra/oxidized.init
index 197c5b1..7a9698d 100755
--- a/extra/oxidized.init
+++ b/extra/oxidized.init
@@ -14,12 +14,12 @@
set -e
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/home/sts/oxidized/bin/oxidized
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
+DAEMON=$(which oxidized)
NAME="oxidized"
DESC="Oxidized - Network Device Configuration Backup Tool"
ARGS=""
-USER="sts"
+USER="oxidized"
test -x $DAEMON || exit 0
diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb
index 9a5c508..858d5cd 100644
--- a/lib/oxidized/input/ssh.rb
+++ b/lib/oxidized/input/ssh.rb
@@ -25,7 +25,10 @@ module Oxidized
@log = File.open(Oxidized::Config::Log + "/#{@node.ip}-ssh", 'w') if Oxidized.config.input.debug?
port = vars(:ssh_port) || 22
if proxy_host = vars(:ssh_proxy)
- proxy = Net::SSH::Proxy::Command.new("ssh #{proxy_host} -W %h:%p")
+ proxy_command = "ssh "
+ proxy_command += "-o StrictHostKeyChecking=no " unless secure
+ proxy_command += "#{proxy_host} -W %h:%p"
+ proxy = Net::SSH::Proxy::Command.new(proxy_command)
end
ssh_opts = {
:port => port.to_i,
diff --git a/lib/oxidized/model/alvarion.rb b/lib/oxidized/model/alvarion.rb
index 3c762de..7a4dcc7 100644
--- a/lib/oxidized/model/alvarion.rb
+++ b/lib/oxidized/model/alvarion.rb
@@ -8,6 +8,8 @@ class Alvarion < Oxidized::Model
end
- cfg :tftp {}
+ cfg :tftp do
+
+ end
end
diff --git a/lib/oxidized/model/cisconga.rb b/lib/oxidized/model/cisconga.rb
new file mode 100644
index 0000000..73fb51c
--- /dev/null
+++ b/lib/oxidized/model/cisconga.rb
@@ -0,0 +1,19 @@
+class CiscoNGA < Oxidized::Model
+
+ comment '# '
+ prompt /([\w.@-]+[#>]\s?)$/
+
+ cmd 'show version' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show configuration' do |cfg|
+ cfg
+ end
+
+ cfg :ssh do
+ post_login 'terminal length 0'
+ pre_logout 'exit'
+ end
+
+end
diff --git a/lib/oxidized/model/saos.rb b/lib/oxidized/model/saos.rb
index 649daa7..5a4e79e 100644
--- a/lib/oxidized/model/saos.rb
+++ b/lib/oxidized/model/saos.rb
@@ -2,7 +2,7 @@ class SAOS < Oxidized::Model
# Ciena SAOS switch
# used for 6.x devices
-
+
comment '! '
cmd :all do |cfg|
@@ -11,6 +11,7 @@ class SAOS < Oxidized::Model
cmd 'configuration show' do |cfg|
cfg.gsub! /^! Created: [^\n]*\n/, ''
+ cfg.gsub! /^! On terminal: [^\n]*\n/, ''
cfg
end