From 78447501a56228a8aad3baec0e47053d62a95b8f Mon Sep 17 00:00:00 2001 From: AAm-kun Date: Thu, 18 Jul 2024 20:08:20 +0200 Subject: [PATCH 1/7] uplink_olt_model_add --- lib/oxidized/model/uplinkolt.rb | 55 +++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 lib/oxidized/model/uplinkolt.rb diff --git a/lib/oxidized/model/uplinkolt.rb b/lib/oxidized/model/uplinkolt.rb new file mode 100644 index 000000000..e2c1c21b7 --- /dev/null +++ b/lib/oxidized/model/uplinkolt.rb @@ -0,0 +1,55 @@ +class UPLINKOLT < Oxidized::Model + + prompt /^([\w.@()-]+[#>]\s?)$/ + comment '! ' + + cmd :all do |cfg| + cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, '' + cfg.gsub!(/^show running-config$/, '') + cfg.gsub!(/^.*\s*#\s*$/, '') + + # Remove leading and trailing whitespace + cfg.strip! + + # Remove empty lines + cfg.gsub!(/^\s*$/, '') + + cfg + end + + cmd 'configure terminal' do + # Enter configure terminal mode + cmd 'show version' do |cfg| + cfg.gsub! /^show version/, '' + comment cfg + end + + end + cmd 'show time' do |cfg| + cfg.gsub! /^show time/, '' + comment cfg + end + cmd 'show running-config' do |cfg| + cfg.gsub! /^Current configuration:/, '' + cfg + end + + cfg :telnet, :ssh do + username /^Login:/i + password /^Password:/i + # preferred way to handle additional passwords + post_login do + if vars(:enable) == true + cmd "enable" + elsif vars(:enable) + cmd "enable", /^[pP]assword:/ + cmd vars(:enable) + end + end + post_login 'terminal length 0' + pre_logout 'exit' + pre_logout 'disable' + pre_logout 'exit' + end + end + \ No newline at end of file From 4aa9de37179cfccc82edec21a57371ca66a4f4af Mon Sep 17 00:00:00 2001 From: AAm-kun Date: Fri, 19 Jul 2024 11:55:31 +0200 Subject: [PATCH 2/7] time_removed --- lib/oxidized/model/uplinkolt.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/oxidized/model/uplinkolt.rb b/lib/oxidized/model/uplinkolt.rb index e2c1c21b7..0151e0830 100644 --- a/lib/oxidized/model/uplinkolt.rb +++ b/lib/oxidized/model/uplinkolt.rb @@ -25,10 +25,6 @@ class UPLINKOLT < Oxidized::Model end end - cmd 'show time' do |cfg| - cfg.gsub! /^show time/, '' - comment cfg - end cmd 'show running-config' do |cfg| cfg.gsub! /^Current configuration:/, '' cfg From db4bd15ebdec87a97a56e3c002657b079204eada Mon Sep 17 00:00:00 2001 From: AAm-kun Date: Thu, 15 Aug 2024 10:51:12 +0200 Subject: [PATCH 3/7] uplink_olt_add --- docs/Supported-OS-Types.md | 1 + lib/oxidized/model/uplinkolt.rb | 90 ++++++++++++++++----------------- 2 files changed, 44 insertions(+), 47 deletions(-) diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index ec060502a..dc795001e 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -181,3 +181,4 @@ | |ZyNOS ADSL |[zynosadsl](/lib/oxidized/model/zynosadsl.rb) | |NDMS |[ndms](/lib/oxidized/model/ndms.rb) | |1308 |[zy1308](/lib/oxidized/model/zy1308.rb) +|Uplink |EP4440 |[EP4440](/lib/oxidized/model/uplinkolt.rb) \ No newline at end of file diff --git a/lib/oxidized/model/uplinkolt.rb b/lib/oxidized/model/uplinkolt.rb index e2c1c21b7..fa74398e8 100644 --- a/lib/oxidized/model/uplinkolt.rb +++ b/lib/oxidized/model/uplinkolt.rb @@ -1,55 +1,51 @@ class UPLINKOLT < Oxidized::Model + prompt /^([\w.@()-]+[#>]\s?)$/ + comment '! ' - prompt /^([\w.@()-]+[#>]\s?)$/ - comment '! ' - - cmd :all do |cfg| - cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, '' - cfg.gsub!(/^show running-config$/, '') - cfg.gsub!(/^.*\s*#\s*$/, '') - - # Remove leading and trailing whitespace - cfg.strip! - - # Remove empty lines - cfg.gsub!(/^\s*$/, '') - - cfg - end - - cmd 'configure terminal' do - # Enter configure terminal mode - cmd 'show version' do |cfg| + cmd :all do |cfg| + cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, '' + cfg.gsub!(/^show running-config$/, '') + cfg.gsub!(/^.*\s*#\s*$/, '') + # Remove leading and trailing whitespace + cfg.strip! + # Remove empty lines + cfg.gsub!(/^\s*$/, '') + cfg + end + + cmd 'configure terminal' do + # Enter configure terminal mode + cmd 'show version' do |cfg| cfg.gsub! /^show version/, '' comment cfg - end - - end - cmd 'show time' do |cfg| - cfg.gsub! /^show time/, '' - comment cfg - end - cmd 'show running-config' do |cfg| - cfg.gsub! /^Current configuration:/, '' - cfg end - - cfg :telnet, :ssh do - username /^Login:/i - password /^Password:/i - # preferred way to handle additional passwords - post_login do - if vars(:enable) == true - cmd "enable" - elsif vars(:enable) - cmd "enable", /^[pP]assword:/ - cmd vars(:enable) - end + end + + cmd 'show time' do |cfg| + cfg.gsub! /^show time/, '' + comment cfg + end + + cmd 'show running-config' do |cfg| + cfg.gsub! /^Current configuration:/, '' + cfg + end + + cfg :telnet, :ssh do + username /^Login:/i + password /^Password:/i + # preferred way to handle additional passwords + post_login do + if vars(:enable) == true + cmd "enable" + elsif vars(:enable) + cmd "enable", /^[pP]assword:/ + cmd vars(:enable) end - post_login 'terminal length 0' - pre_logout 'exit' - pre_logout 'disable' - pre_logout 'exit' end + post_login 'terminal length 0' + pre_logout 'exit' + pre_logout 'disable' + pre_logout 'exit' end - \ No newline at end of file +end From f9a646a51fd01f92f35e0b32b4e20eaa75dcd712 Mon Sep 17 00:00:00 2001 From: AAm-kun Date: Thu, 15 Aug 2024 11:07:47 +0200 Subject: [PATCH 4/7] uplink_olt_model --- lib/oxidized/model/uplinkolt.rb | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/lib/oxidized/model/uplinkolt.rb b/lib/oxidized/model/uplinkolt.rb index 756068a9d..de6c264fc 100644 --- a/lib/oxidized/model/uplinkolt.rb +++ b/lib/oxidized/model/uplinkolt.rb @@ -18,33 +18,6 @@ class UPLINKOLT < Oxidized::Model cmd 'show version' do |cfg| cfg.gsub! /^show version/, '' comment cfg -<<<<<<< HEAD - end - - end - cmd 'show running-config' do |cfg| - cfg.gsub! /^Current configuration:/, '' - cfg - end - - cfg :telnet, :ssh do - username /^Login:/i - password /^Password:/i - # preferred way to handle additional passwords - post_login do - if vars(:enable) == true - cmd "enable" - elsif vars(:enable) - cmd "enable", /^[pP]assword:/ - cmd vars(:enable) - end - end - post_login 'terminal length 0' - pre_logout 'exit' - pre_logout 'disable' - pre_logout 'exit' -======= ->>>>>>> master end end @@ -75,4 +48,4 @@ class UPLINKOLT < Oxidized::Model pre_logout 'disable' pre_logout 'exit' end -end +end \ No newline at end of file From 0ee97e9f793baead933ade0c7fa64ee5ec8a1c67 Mon Sep 17 00:00:00 2001 From: AAm-kun Date: Thu, 15 Aug 2024 11:11:43 +0200 Subject: [PATCH 5/7] uplink_olt_model --- lib/oxidized/model/uplinkolt.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oxidized/model/uplinkolt.rb b/lib/oxidized/model/uplinkolt.rb index de6c264fc..fa74398e8 100644 --- a/lib/oxidized/model/uplinkolt.rb +++ b/lib/oxidized/model/uplinkolt.rb @@ -48,4 +48,4 @@ class UPLINKOLT < Oxidized::Model pre_logout 'disable' pre_logout 'exit' end -end \ No newline at end of file +end From 15cecf78044749ca3d630c1a86a5513e480d07f4 Mon Sep 17 00:00:00 2001 From: AAm-kun Date: Sat, 28 Sep 2024 10:18:29 +0200 Subject: [PATCH 6/7] changelog and supported os update --- CHANGELOG.md | 1 + docs/Supported-OS-Types.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ad1f9bb6..34734de22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] ### Added +- model for uplink EP4440-DP OLT - model for Siklu Multihaul TG radios (@bdg-robert) - fortios: variable `fullconfig` to get the configuration with default values. Fixes: #3159 (@robertcheramy) - model for VMWare NSX DFW (@elmobp) diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 293adb1b2..d451a26f8 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -181,4 +181,4 @@ | |ZyNOS ADSL |[zynosadsl](/lib/oxidized/model/zynosadsl.rb) | |NDMS |[ndms](/lib/oxidized/model/ndms.rb) | |1308 |[zy1308](/lib/oxidized/model/zy1308.rb) -|Uplink |EP4440 |[EP4440](/lib/oxidized/model/uplinkolt.rb) \ No newline at end of file +|Uplink |EP4440-DP |[EP4440](/lib/oxidized/model/uplinkolt.rb) | |Might support all EP4440 series \ No newline at end of file From a89c62314a1919b13590f47a56cf2e9f4a842008 Mon Sep 17 00:00:00 2001 From: Robert Cheramy Date: Wed, 2 Oct 2024 11:38:33 +0200 Subject: [PATCH 7/7] Update documentation - Author of the model in CHANGELOG.md - Supported OS Types in alphabetical order --- CHANGELOG.md | 2 +- docs/Supported-OS-Types.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34734de22..062185c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] ### Added -- model for uplink EP4440-DP OLT +- model for uplink EP4440-DP OLT (@AAm-kun) - model for Siklu Multihaul TG radios (@bdg-robert) - fortios: variable `fullconfig` to get the configuration with default values. Fixes: #3159 (@robertcheramy) - model for VMWare NSX DFW (@elmobp) diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index d451a26f8..30a7d2de0 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -167,6 +167,7 @@ | |Edgeos |[edgeos](/lib/oxidized/model/edgeos.rb) | |EdgeSwitch |[edgeswitch](/lib/oxidized/model/edgeswitch.rb) | |AirFiber |[airfiber](/lib/oxidized/model/airfiber.rb) +|Uplink |EP4440-DP |[EP4440](/lib/oxidized/model/uplinkolt.rb) | |Might support all EP4440 series |VMWare |NSX Edge (configuration) |[nsxconfig](/lib/oxidized/model/nsxconfig.rb) | |NSX Edge (firewall rules) |[nsxfirewall](/lib/oxidized/model/nsxfirewall.rb) | |NSX Distributed Firewall |[nsxdfw](/lib/oxidized/model/nsxdfw.rb) @@ -181,4 +182,3 @@ | |ZyNOS ADSL |[zynosadsl](/lib/oxidized/model/zynosadsl.rb) | |NDMS |[ndms](/lib/oxidized/model/ndms.rb) | |1308 |[zy1308](/lib/oxidized/model/zy1308.rb) -|Uplink |EP4440-DP |[EP4440](/lib/oxidized/model/uplinkolt.rb) | |Might support all EP4440 series \ No newline at end of file