From 44c67a6b5ae88dd24f5026223547cf2e37fda560 Mon Sep 17 00:00:00 2001 From: Matthew Boehlig Date: Fri, 15 Aug 2014 14:40:19 -0500 Subject: Add model for Cisco small business switches Supports 200, 300, 500, and ESW2 series switches --- lib/oxidized/model/ciscosmb.rb | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 lib/oxidized/model/ciscosmb.rb (limited to 'lib') diff --git a/lib/oxidized/model/ciscosmb.rb b/lib/oxidized/model/ciscosmb.rb new file mode 100644 index 0000000..718c60e --- /dev/null +++ b/lib/oxidized/model/ciscosmb.rb @@ -0,0 +1,48 @@ +class CiscoSMB < Oxidized::Model + + # Cisco Small Business 200, 300, 500, and ESW2 series switches + # http://www.cisco.com/c/en/us/support/switches/small-business-300-series-managed-switches/products-release-notes-list.html + + prompt /^\r?([\w.@()-]+[#>]\s?)$/ + comment '! ' + + cmd :all do |cfg| + lines = cfg.each_line.to_a[1..-2] + # Remove \r from beginning of response + lines[0].gsub!(/^\r.*?/, '') if lines.length > 0 + lines.join + end + + cmd :secret do |cfg| + cfg.gsub! /^(snmp-server community).*/, '\\1 ' + cfg.gsub! /username (\S+) privilege (\d+) (\S+).*/, '