summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-11-07 02:59:35 +0200
committerGitHub <noreply@github.com>2016-11-07 02:59:35 +0200
commit6588edc935f229be569dafc112fcd8d9b3636dad (patch)
tree05730ccccffcfc408a3e6c2984274e30b4c67329 /lib/oxidized
parentfab7e79787bd6d0d06483da35656bd6045687e06 (diff)
parent0b903fe94c2673930f03a676b83e84277f51d010 (diff)
Merge pull request #606 from rfdrake/dlink
This adds support for D-Link switches
Diffstat (limited to 'lib/oxidized')
-rw-r--r--lib/oxidized/model/dlink.rb36
1 files changed, 36 insertions, 0 deletions
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 <removed>'
+ cfg.gsub! /^(create snmp group) \S+/, '\\1 <removed>'
+ 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