diff options
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | extra/oxidized.service | 5 | ||||
-rw-r--r-- | lib/oxidized/model/alteonos.rb | 60 | ||||
-rw-r--r-- | lib/oxidized/model/ciscosmb.rb | 5 | ||||
-rw-r--r-- | lib/oxidized/model/enterasys.rb | 30 | ||||
-rw-r--r-- | lib/oxidized/model/hpemsa.rb | 13 | ||||
-rw-r--r-- | lib/oxidized/model/ipos.rb | 8 | ||||
-rw-r--r-- | lib/oxidized/model/ucs.rb | 31 | ||||
-rw-r--r-- | lib/oxidized/model/weos.rb | 22 | ||||
-rw-r--r-- | lib/oxidized/model/xos.rb | 4 |
10 files changed, 183 insertions, 4 deletions
@@ -98,6 +98,7 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * [NXOS](lib/oxidized/model/nxos.rb) * [SMA](lib/oxidized/model/ciscosma.rb) * [SMB (Nikola series)](lib/oxidized/model/ciscosmb.rb) + * [UCS](lib/oxidized/model/ucs.rb) * Citrix * [NetScaler (Virtual Applicance)](lib/oxidized/model/netscaler.rb) * Coriant (former Tellabs) @@ -117,8 +118,9 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * Ericsson/Redback * [IPOS (former SEOS)](lib/oxidized/model/ipos.rb) * Extreme Networks - * [XOS](lib/oxidized/model/xos.rb) + * [Enterasys](/lib/oxidized/model/enterasys.rb) * [WM](lib/oxidized/model/mtrlrfs.rb) + * [XOS](lib/oxidized/model/xos.rb) * F5 * [TMOS](lib/oxidized/model/tmos.rb) * Force10 @@ -136,6 +138,7 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * [Comware (HP A-series, H3C, 3Com)](lib/oxidized/model/comware.rb) * [Procurve](lib/oxidized/model/procurve.rb) * [BladeSystem (Onboard Administrator)](lib/oxidized/model/hpebladesystem.rb) + * [MSA](lib/oxidized/model/hpemsa.rb) * Huawei * [VRP](lib/oxidized/model/vrp.rb) * Juniper @@ -165,6 +168,8 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * [PANOS](lib/oxidized/model/panos.rb) * [PLANET SG/SGS Switches](lib/oxidized/model/planet.rb) * [pfSense](lib/oxidized/model/pfsense.rb) + * Radware + * [AlteonOS](lib/oxidized/model/alteonos.rb) * Quanta * [Quanta / VxWorks 6.6 (1.1.0.8)](lib/oxidized/model/quantaos.rb) * Siklu @@ -181,6 +186,8 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * [EdgeSwitch](lib/oxidized/model/edgeswitch.rb) * Watchguard * [Fireware OS](lib/oxidized/model/firewareos.rb) + * Westell + * [Westell 8178G, Westell 8266G](lib/oxidized/model/weos.rb) * Zhone * [Zhone (OLT and MX)](lib/oxidized/model/zhoneolt.rb) * Zyxel diff --git a/extra/oxidized.service b/extra/oxidized.service index 35d7932..e474608 100644 --- a/extra/oxidized.service +++ b/extra/oxidized.service @@ -1,10 +1,11 @@ #For debian 8 put it in /lib/systemd/system/ +#For RHEL / CentOS 7 put it in /etc/systemd/system/ #and call it with systemctl start oxidized.service [Unit] Description=Oxidized - Network Device Configuration Backup Tool -#After=network-online.target multi-user.target -#Wants=network-online.target +After=network-online.target multi-user.target +Wants=network-online.target [Service] ExecStart=/usr/local/bin/oxidized diff --git a/lib/oxidized/model/alteonos.rb b/lib/oxidized/model/alteonos.rb new file mode 100644 index 0000000..9eacf4e --- /dev/null +++ b/lib/oxidized/model/alteonos.rb @@ -0,0 +1,60 @@ +class ALTEONOS < Oxidized::Model + + prompt /^\(?.+\)?\s?[#>]/ + + comment '! ' + + cmd :secret do |cfg| + cfg.gsub!(/^([\s\t]*admpw ).*/, '\1 <password removed>') + cfg.gsub!(/^([\s\t]*pswd ).*/, '\1 <password removed>') + cfg.gsub!(/^([\s\t]*esecret ).*/, '\1 <password removed>') + cfg + end + + ############################################################################################## + ## Added to remove # + ## # + ##/* Configuration dump taken 14:10:20 Fri Jul 28, 2017 (DST) # + ##/* Configuration last applied at 16:17:05 Fri Jul 14, 2017 # + ##/* Configuration last save at 16:17:43 Fri Jul 14, 2017 # + ##/* Version 29.0.3.12, vXXXXXXXX, Base MAC address XXXXXXXXXXX # + ##/* To restore SSL Offloading configuration and management HTTPS access, # + ##/* it is recommended to include the private keys in the dump. # + ## OR # + ##/* To restore SSL Offloading configuration and management HTTPS access,it is recommended # + ##/* to include the private keys in the dump. # + ## # + ############################################################################################## + + cmd 'cfg/dump' do |cfg| + cfg.gsub! /^([\s\t\/*]*Configuration).*/, '' + cfg.gsub! /^([\s\t\/*]*Version).*/, '' + cfg.gsub! /^([\s\t\/*]*To restore ).*/, '' + cfg.gsub! /^([\s\t\/*]*it is recommended to include).*/, '' + cfg.gsub! /^([\s\t\/*]*to include ).*/, '' + cfg + end + + #Answer for Dispay private keys + expect /^Display private keys\?\s?\[y\/n\]\: $/ do |data, re| + send "n\r" + data.sub re, '' + end + + #Answer for sync to peer on exit + expect /^Confirm Sync to Peer\s?\[y\/n\]\: $/ do |data, re| + send "n\r" + data.sub re, '' + end + + #Answer for Unsaved configuration + expect /^(WARNING: There are unsaved configuration changes).*/ do |data, re| + send "n\r" + data.sub re, '' + end + + cfg :ssh do + pre_logout 'exit' + end + +end diff --git a/lib/oxidized/model/ciscosmb.rb b/lib/oxidized/model/ciscosmb.rb index e5501d5..5ddcfcb 100644 --- a/lib/oxidized/model/ciscosmb.rb +++ b/lib/oxidized/model/ciscosmb.rb @@ -16,12 +16,17 @@ class CiscoSMB < Oxidized::Model cmd :secret do |cfg| cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>' cfg.gsub! /username (\S+) privilege (\d+) (\S+).*/, '<secret hidden>' + cfg.gsub! /^(encrypted radius-server key).*/, '\\1 <configuration removed>' cfg end cmd 'show version' do |cfg| comment cfg end + + cmd 'show bootvar' do |cfg| + comment cfg + end cmd 'show running-config' do |cfg| cfg = cfg.each_line.to_a[0..-1].join diff --git a/lib/oxidized/model/enterasys.rb b/lib/oxidized/model/enterasys.rb new file mode 100644 index 0000000..708d380 --- /dev/null +++ b/lib/oxidized/model/enterasys.rb @@ -0,0 +1,30 @@ +class Enterasys < Oxidized::Model + + # Enterasys B3/C3 models # + + prompt /^.+\w\(su\)->\s?$/ + + comment '!' + + cmd :all do |cfg| + cfg.each_line.to_a[2..-3].map{|line|line.delete("\r").rstrip}.join("\n") + "\n" + end + + cmd 'show system hardware' do |cfg| + comment cfg + end + + cmd 'show config' do |cfg| + cfg.gsub! /^This command shows non-default configurations only./, '' + cfg.gsub! /^Use 'show config all' to show both default and non-default configurations./, '' + cfg.gsub! /^!|#.*/, '' + cfg.gsub! /^$\n/, '' + + cfg + end + + cfg :ssh do + pre_logout 'exit' + end + +end diff --git a/lib/oxidized/model/hpemsa.rb b/lib/oxidized/model/hpemsa.rb new file mode 100644 index 0000000..4fe636f --- /dev/null +++ b/lib/oxidized/model/hpemsa.rb @@ -0,0 +1,13 @@ +class HpeMsa < Oxidized::Model + + prompt /^#\s?$/ + + cmd 'show configuration' + + cfg :ssh do + post_login 'set cli-parameters pager disabled' + pre_logout 'exit' + end + +end + diff --git a/lib/oxidized/model/ipos.rb b/lib/oxidized/model/ipos.rb index 5efd831..938f12d 100644 --- a/lib/oxidized/model/ipos.rb +++ b/lib/oxidized/model/ipos.rb @@ -3,7 +3,7 @@ class IPOS < Oxidized::Model # Ericsson SSR (IPOS) # Redback SE (SEOS) - prompt /^([\[\]\w.@-]+[#>]\s?)$/ + prompt /^([\[\]\w.@-]+[#:>]\s?)$/ comment '! ' cmd 'show chassis' do |cfg| @@ -52,6 +52,12 @@ class IPOS < Oxidized::Model cfg :telnet, :ssh do post_login 'terminal length 0' + if vars :enable + post_login do + cmd "enable" + cmd vars(:enable) + end + end pre_logout do send "exit\n" send "n\n" diff --git a/lib/oxidized/model/ucs.rb b/lib/oxidized/model/ucs.rb new file mode 100644 index 0000000..a1f6c10 --- /dev/null +++ b/lib/oxidized/model/ucs.rb @@ -0,0 +1,31 @@ +class UCS < Oxidized::Model + + prompt /^(\r?[\w.@_()-]+[#]\s?)$/ + comment '! ' + + cmd 'show version brief' do |cfg| + comment cfg + end + + cmd 'show chassis detail' do |cfg| + comment cfg + end + + cmd 'show fabric-interconnect detail' do |cfg| + comment cfg + end + + cmd 'show configuration all | no-more' do |cfg| + cfg + end + + cfg :ssh, :telnet do + post_login 'terminal length 0' + pre_logout 'exit' + end + + cfg :telnet do + username /^login:/ + password /^Password:/ + end +end diff --git a/lib/oxidized/model/weos.rb b/lib/oxidized/model/weos.rb new file mode 100644 index 0000000..1b20286 --- /dev/null +++ b/lib/oxidized/model/weos.rb @@ -0,0 +1,22 @@ +class WEOS < Oxidized::Model + + #Westell WEOS, works with Westell 8178G, Westell 8266G + + prompt /^(\s[\w.@-]+[#>]\s?)$/ + + cmd :all do |cfg| + cfg.each_line.to_a[1..-2].join + end + + cmd 'show running-config' do |cfg| + cfg + end + + cfg :telnet do + username /login:/ + password /assword:/ + post_login 'cli more disable' + pre_logout 'logout' + end + +end diff --git a/lib/oxidized/model/xos.rb b/lib/oxidized/model/xos.rb index 6f1323f..90f6f4a 100644 --- a/lib/oxidized/model/xos.rb +++ b/lib/oxidized/model/xos.rb @@ -29,6 +29,10 @@ class XOS < Oxidized::Model cmd 'show configuration' + cmd 'show policy detail' do |cfg| + comment cfg + end + cfg :telnet do username /^login:/ password /^\r*password:/ |