From 7e6dc8cce71d6e2753a4e865d8bfbcd347fe1f8a Mon Sep 17 00:00:00 2001 From: Frederik Kriewitz Date: Sun, 10 Dec 2017 21:53:14 +0100 Subject: model: Add support for Broadband Network Platform Software from GCOM Technologies Co.,Ltd. (#1097) * Add support for Broadband Network Platform Software from GCOM Technologies Co.,Ltd. * requested changes --- lib/oxidized/model/gcombnps.rb | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 lib/oxidized/model/gcombnps.rb (limited to 'lib') diff --git a/lib/oxidized/model/gcombnps.rb b/lib/oxidized/model/gcombnps.rb new file mode 100644 index 0000000..4a97162 --- /dev/null +++ b/lib/oxidized/model/gcombnps.rb @@ -0,0 +1,85 @@ +class GcomBNPS < Oxidized::Model + # For switches from GCOM Technologies Co.,Ltd. running the "Broadband Network Platform Software" + # Author: Frederik Kriewitz + # + # tested with: + # - S5330 (aka Fiberstore S3800) + + prompt /^\r?([\w.@()-]+?(\(1-16 chars\))?[#>:]\s?)$/ # also match SSH password promt (post_login commands are sent after the first prompt) + comment '! ' + +# alternative to handle the SSH login, but this breaks telnet +# expect /^Password\(1-16 chars\):/ do |data| +# send @node.auth[:password] + "\n" +# '' +# end + + # handle pager (can't be disabled?) + expect /^\.\.\.\.press ENTER to next line, CTRL_C to quit, other key to next page\.\.\.\.$/ do |data, re| + send ' ' + data.sub re, '' + end + + cmd :all do |cfg| + cfg = cfg.gsub " \e[73D\e[K", '' # remove garbage remaining from the pager + cfg.each_line.to_a[1..-2].join + end + + cmd :secret do |cfg| + cfg.gsub! /^(snmp-server community)\s+[^\s]+\s+(.*)/, '\\1