From 0b903fe94c2673930f03a676b83e84277f51d010 Mon Sep 17 00:00:00 2001 From: Robert Drake Date: Fri, 4 Nov 2016 14:23:17 -0400 Subject: This adds support for D-Link switches This specifically supports DES-3526/3550 series switches. --- README.md | 2 ++ lib/oxidized/model/dlink.rb | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lib/oxidized/model/dlink.rb diff --git a/README.md b/README.md index b9b97d7..fee5d27 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,8 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen * DELL * [PowerConnect](lib/oxidized/model/powerconnect.rb) * [AOSW](lib/oxidized/model/aosw.rb) + * D-Link + * [D-Link](lib/oxidized/model/dlink.rb) * Ericsson/Redback * [IPOS (former SEOS)](lib/oxidized/model/ipos.rb) * Extreme Networks diff --git a/lib/oxidized/model/dlink.rb b/lib/oxidized/model/dlink.rb new file mode 100644 index 0000000..5756bad --- /dev/null +++ b/lib/oxidized/model/dlink.rb @@ -0,0 +1,36 @@ +class Dlink < Oxidized::Model + # D-LINK Switches + + prompt /^(\r*[\w.@():-]+[#>]\s?)$/ + comment '# ' + + cmd :secret do |cfg| + cfg.gsub! /^(create snmp community) \S+/, '\\1 ' + cfg.gsub! /^(create snmp group) \S+/, '\\1 ' + cfg + end + + cmd :all do |cfg| + cfg.each_line.to_a[2..-2].map{|line|line.delete("\r").rstrip}.join("\n") + "\n" + end + + cmd 'show switch' do |cfg| + comment cfg + end + + cmd 'show vlan' do |cfg| + comment cfg + end + + cmd 'show config current' + + cfg :telnet do + username /\r*username:/ + password /\r*password:/ + end + + cfg :telnet, :ssh do + post_login 'disable clipaging' + pre_logout 'logout' + end +end -- cgit v1.2.1