From 6890754f0a579fc9be3912113dcfe510b2837f7c Mon Sep 17 00:00:00 2001 From: CppMonkey Date: Thu, 1 Feb 2018 17:39:00 +0000 Subject: Initial commit for SSH/Telnet on Xyzel XGS4600 series --- lib/oxidized/model/zynoscli.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lib/oxidized/model/zynoscli.rb (limited to 'lib') diff --git a/lib/oxidized/model/zynoscli.rb b/lib/oxidized/model/zynoscli.rb new file mode 100644 index 0000000..9f29a16 --- /dev/null +++ b/lib/oxidized/model/zynoscli.rb @@ -0,0 +1,35 @@ +class ZyNOSCLI < Oxidized::Model + + # Used in Zyxel DSLAMs, such as SAM1316 + + # Typical prompt "XGS4600#" + prompt /^([\w.@()-]+[#>]\s\e7)$/ + comment ';; ' + + cmd :all do |cfg| + cfg.gsub! /^.*\e7/, '' + end + + cmd 'show running-config' + + cfg :telnet do + username /^User name:/i + password /^Password:/i + end + + cfg :telnet, :ssh do + if vars :enable + post_login do + send "enable\n" + # Interpret enable: true as meaning we won't be prompted for a password + unless vars(:enable).is_a? TrueClass + expect /[pP]assword:\s?$/ + send vars(:enable) + "\n" + end + expect /^.+[#]$/ + end + end + pre_logout 'exit' + end + +end -- cgit v1.2.1 From 97aa0535a0c8c237c1ccb7a1683d5f6faa1f0339 Mon Sep 17 00:00:00 2001 From: CppMonkey Date: Tue, 20 Mar 2018 09:53:41 +0000 Subject: Added more commands Shows more details. Confirms stacking config (Ring/Chain) Allows tracking of firmware on ras0 and ras1 --- lib/oxidized/model/zynoscli.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/oxidized/model/zynoscli.rb b/lib/oxidized/model/zynoscli.rb index 9f29a16..ae64b04 100644 --- a/lib/oxidized/model/zynoscli.rb +++ b/lib/oxidized/model/zynoscli.rb @@ -1,5 +1,4 @@ class ZyNOSCLI < Oxidized::Model - # Used in Zyxel DSLAMs, such as SAM1316 # Typical prompt "XGS4600#" @@ -9,6 +8,9 @@ class ZyNOSCLI < Oxidized::Model cmd :all do |cfg| cfg.gsub! /^.*\e7/, '' end + cmd 'show stacking' + + cmd 'show version' cmd 'show running-config' @@ -31,5 +33,4 @@ class ZyNOSCLI < Oxidized::Model end pre_logout 'exit' end - end -- cgit v1.2.1