From b38994b4bb0fdaa9a7e492db31926b43a11c225e Mon Sep 17 00:00:00 2001 From: Erik Muller Date: Fri, 21 Jul 2023 19:37:31 +0200 Subject: [PATCH 1/2] Fix for #2880 - opengear config not saved Switch opengear config handling to use the same process as the comment method, which works correctly. --- lib/oxidized/model/opengear.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/oxidized/model/opengear.rb b/lib/oxidized/model/opengear.rb index a6fa8c6d2..a1a29106a 100644 --- a/lib/oxidized/model/opengear.rb +++ b/lib/oxidized/model/opengear.rb @@ -13,7 +13,13 @@ class OpenGear < Oxidized::Model cmd('cat /etc/version') { |cfg| comment cfg } - cmd('config -g config') { |cfg| cfg } + cmd 'config -g config' do |cfg| + out='' + cfg.each_line do |line| + out << line + end + out + end cfg :ssh do exec true # don't run shell, run each command in exec channel From a5252af97e1504b2d96fe3909056c16b9552057b Mon Sep 17 00:00:00 2001 From: Erik Muller Date: Fri, 21 Jul 2023 19:41:05 +0200 Subject: [PATCH 2/2] Add serial number collection for Opengear --- CHANGELOG.md | 2 ++ lib/oxidized/model/opengear.rb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e014b5fa..1672e291e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## Added - model for D-Link cisco like CLI (@mirackle-spb) - model for Ruijie Networks RGOS devices (@spike77453) +- Add serial number collection to Opengear (@ermuller) + Added ability to send mail with the Docker container + Documentation to send mail with hooks @@ -23,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - fixed new date/time format with newer RouterOS `# jun/01/2023 12:11:25 by RouterOS 7.9.1` vs `# 2023-06-01 12:16:16 by RouterOS 7.10rc1` (@tim427) - fixed netscaler backups with hostname set #2828 (@electrocret) - Do not redirect stderr when fetching opnsense version since default shell (csh) doesn't support it (@spike77453) +- Fix missing configuration for Opengear (@ermuller) ## [0.29.1 - 2023-04-24] diff --git a/lib/oxidized/model/opengear.rb b/lib/oxidized/model/opengear.rb index a1a29106a..90dc7d2a9 100644 --- a/lib/oxidized/model/opengear.rb +++ b/lib/oxidized/model/opengear.rb @@ -13,6 +13,11 @@ class OpenGear < Oxidized::Model cmd('cat /etc/version') { |cfg| comment cfg } + cmd 'showserial' do |cfg| + cfg.gsub! /^/, 'Serial Number: ' + comment cfg + end + cmd 'config -g config' do |cfg| out='' cfg.each_line do |line|