summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md55
-rw-r--r--lib/oxidized/model/asa.rb48
-rw-r--r--lib/oxidized/model/fabricos.rb8
3 files changed, 102 insertions, 9 deletions
diff --git a/README.md b/README.md
index 2a92a4d..d202db4 100644
--- a/README.md
+++ b/README.md
@@ -8,8 +8,29 @@
* restful API to fetch configurations (/node/fetch/[NODE] or /node/fetch/group/[NODE])
* restful API to show list of nodes (GET /nodes)
+# Supported OS types
+
+ * A10 Networks ACOS
+ * Alcatel-Lucent Operating System AOS
+ * Alcatel-Lucent Operating System AOS7
+ * Alcatel-Lucent Operating System Wireless
+ * Alcatel-Lucent TiMOS
+ * Arista EOS
+ * Brocade Fabric OS
+ * Brocade Ironware
+ * Cisco AireOS
+ * Cisco ASA
+ * Cisco IOS
+ * Cisco IOS-XR
+ * DELL PowerConnect
+ * Force10 FTOS
+ * FortiGate FortiOS
+ * HP ProCurve
+ * Juniper JunOS
+
# Install
- * early days, but try:
+
+ * Debian
1. apt-get install ruby ruby-dev libsqlite3-dev libssl-dev
2. gem install oxidized
3. gem install oxidized-script oxidized-web # if you don't install oxidized-web, make sure you remove "rest" from your config
@@ -18,6 +39,38 @@
6. (maybe point to your rancid/router.db or copy it there)
7. oxidized
+ * CentOS, Oracle Linux, Red Hat Linux version 6
+ 1. Install Ruby 1.9.3 or greater
+ * For Ruby 2.1.2 installation instructions see "Installing Ruby 2.1.2 using RVM"
+ 2. Install Oxidized dependencies
+ * yum install cmake sqlite-devel openssl-devel
+ 3. Install Oxidized daemon and Web front-end from Ruby Gems
+ * gem install oxidized
+ * gem install oxidized-script oxidized-web
+ 4. Start Oxidized, this will create initial configuration
+ * oxidized
+ 5. Edit Oxidized configuration and create device database
+ * vi ~/.config/oxidized/config
+ * vi ~/.config/oxidized/router.db
+ 6. If you are using file system storage create config directory
+ * mkdir -p ~/.config/oxidized/configs/default
+ 7. Start Oxidized
+ * oxidized
+
+ * Installing Ruby 2.1.2 using RVM
+ 1. Install Ruby 2.1.2 build dependencies
+ * yum install curl gcc-c++ patch readline readline-devel zlib zlib-devel
+ * yum install libyaml-devel libffi-devel openssl-devel make cmake
+ * yum install bzip2 autoconf automake libtool bison iconv-devel
+ 2. Install RVM
+ * curl -L get.rvm.io | bash -s stable
+ 3. Setup RVM environment
+ * source /etc/profile.d/rvm.sh
+ 4. Compile and install Ruby 2.1.2
+ * rvm install 2.1.2
+ 5. Set Ruby 2.1.2 as default
+ * rvm use --default 2.1.2
+
# API
## Input
* gets config from nodes
diff --git a/lib/oxidized/model/asa.rb b/lib/oxidized/model/asa.rb
new file mode 100644
index 0000000..3ee4e2d
--- /dev/null
+++ b/lib/oxidized/model/asa.rb
@@ -0,0 +1,48 @@
+class ASA < Oxidized::Model
+
+ # Cisco ASA model #
+ # Only SSH supported for the sake of security
+
+ prompt /^\r*([\w]+[#>]\s?)$/
+ comment '! '
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[1..-2].join
+ end
+
+ cmd :secret do |cfg|
+ cfg.gsub! /enable password (\S+) (.*)/, 'enable password <secret hidden> \2'
+ cfg.gsub! /username (\S+) password (\S+) (.*)/, 'username \1 password <secret hidden> \3'
+ cfg
+ end
+
+ cmd 'show clock' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show version' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show running-config' do |cfg|
+ cfg = cfg.each_line.to_a[3..-1].join
+ cfg.gsub! /^: [^\n]*\n/, ''
+ cfg
+ end
+
+ cmd 'show inventory' do |cfg|
+ comment cfg
+ end
+
+ cfg :ssh do
+ if vars :enable
+ post_login do
+ send "enable\n"
+ send vars(:enable) + "\n"
+ end
+ end
+ post_login 'terminal pager 0'
+ pre_logout 'exit'
+ end
+
+end
diff --git a/lib/oxidized/model/fabricos.rb b/lib/oxidized/model/fabricos.rb
index 4854541..7ab9fd5 100644
--- a/lib/oxidized/model/fabricos.rb
+++ b/lib/oxidized/model/fabricos.rb
@@ -6,10 +6,6 @@ class FabricOS < Oxidized::Model
prompt /^([\w]+:+[\w]+[>]\s)$/
comment '# '
- cmd :all do |cfg|
- cfg
- end
-
cmd 'chassisShow' do |cfg|
comment cfg
end
@@ -22,8 +18,4 @@ class FabricOS < Oxidized::Model
exec true # don't run shell, run each command in exec channel
end
- cfg :ssh do
- pre_logout 'exit'
- end
-
end