From 3e96e56e99328e5587827eef0b9bd8fd27afa436 Mon Sep 17 00:00:00 2001 From: sfini <30525392+sfini@users.noreply.github.com> Date: Fri, 28 Jul 2017 14:54:37 +0200 Subject: Create radware.rb Added support for Radware/Alteon Application Switch --- lib/oxidized/model/radware.rb | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lib/oxidized/model/radware.rb diff --git a/lib/oxidized/model/radware.rb b/lib/oxidized/model/radware.rb new file mode 100644 index 0000000..4834915 --- /dev/null +++ b/lib/oxidized/model/radware.rb @@ -0,0 +1,60 @@ +class RADWARE < Oxidized::Model + + prompt /^\(?.+\)?\s?[#>]/ + + comment '! ' + + cmd :secret do |cfg| + cfg.gsub!(/^([\s\t]*admpw ).*/, '\1 ') + cfg.gsub!(/^([\s\t]*pswd ).*/, '\1 ') + cfg.gsub!(/^([\s\t]*esecret ).*/, '\1 ') + 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 -- cgit v1.2.1 From edea8fad9c815b49f74371bcc14956ea80e02015 Mon Sep 17 00:00:00 2001 From: sfini <30525392+sfini@users.noreply.github.com> Date: Fri, 4 Aug 2017 12:48:54 +0200 Subject: Update and rename radware.rb to alteonos.rb Change class and name for align the script with librenms --- lib/oxidized/model/alteonos.rb | 60 ++++++++++++++++++++++++++++++++++++++++++ lib/oxidized/model/radware.rb | 60 ------------------------------------------ 2 files changed, 60 insertions(+), 60 deletions(-) create mode 100644 lib/oxidized/model/alteonos.rb delete mode 100644 lib/oxidized/model/radware.rb diff --git a/lib/oxidized/model/alteonos.rb b/lib/oxidized/model/alteonos.rb new file mode 100644 index 0000000..f611f57 --- /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 ') + cfg.gsub!(/^([\s\t]*pswd ).*/, '\1 ') + cfg.gsub!(/^([\s\t]*esecret ).*/, '\1 ') + 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/radware.rb b/lib/oxidized/model/radware.rb deleted file mode 100644 index 4834915..0000000 --- a/lib/oxidized/model/radware.rb +++ /dev/null @@ -1,60 +0,0 @@ -class RADWARE < Oxidized::Model - - prompt /^\(?.+\)?\s?[#>]/ - - comment '! ' - - cmd :secret do |cfg| - cfg.gsub!(/^([\s\t]*admpw ).*/, '\1 ') - cfg.gsub!(/^([\s\t]*pswd ).*/, '\1 ') - cfg.gsub!(/^([\s\t]*esecret ).*/, '\1 ') - 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 -- cgit v1.2.1 From 6854faf354f497cc8616453bf55708590b42281d Mon Sep 17 00:00:00 2001 From: sfini <30525392+sfini@users.noreply.github.com> Date: Mon, 7 Aug 2017 09:21:54 +0200 Subject: Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 825abf0..816a95e 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,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/alteonos.rb) * Quanta * [Quanta / VxWorks 6.6 (1.1.0.8)](lib/oxidized/model/quantaos.rb) * Siklu -- cgit v1.2.1 From 05e569fa813ca4c341dd5aed1bdb991624282c10 Mon Sep 17 00:00:00 2001 From: sfini <30525392+sfini@users.noreply.github.com> Date: Tue, 8 Aug 2017 12:57:42 +0200 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 816a95e..bd26b74 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * [PLANET SG/SGS Switches](lib/oxidized/model/planet.rb) * [pfSense](lib/oxidized/model/pfsense.rb) * Radware - * [AlteonOS](/lib/oxidized/alteonos.rb) + * [AlteonOS](lib/oxidized/model/alteonos.rb) * Quanta * [Quanta / VxWorks 6.6 (1.1.0.8)](lib/oxidized/model/quantaos.rb) * Siklu -- cgit v1.2.1 From fbcce13409af722c5439e15fa0cd83378a63bc31 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Tue, 22 Aug 2017 10:27:36 +0100 Subject: Update alteonos.rb --- lib/oxidized/model/alteonos.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/oxidized/model/alteonos.rb b/lib/oxidized/model/alteonos.rb index f611f57..9eacf4e 100644 --- a/lib/oxidized/model/alteonos.rb +++ b/lib/oxidized/model/alteonos.rb @@ -5,9 +5,9 @@ class ALTEONOS < Oxidized::Model comment '! ' cmd :secret do |cfg| - cfg.gsub!(/^([\s\t]*admpw ).*/, '\1 ') - cfg.gsub!(/^([\s\t]*pswd ).*/, '\1 ') - cfg.gsub!(/^([\s\t]*esecret ).*/, '\1 ') + cfg.gsub!(/^([\s\t]*admpw ).*/, '\1 ') + cfg.gsub!(/^([\s\t]*pswd ).*/, '\1 ') + cfg.gsub!(/^([\s\t]*esecret ).*/, '\1 ') cfg end -- cgit v1.2.1