forked from ytti/oxidized
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Centec Networks CNOS support (ytti#2023)
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# model for Centec Networks CNOS based switches | ||
class CNOS < Oxidized::Model | ||
comment '! ' | ||
|
||
cmd :all do |cfg| | ||
cfg.each_line.to_a[0..-2].join | ||
end | ||
|
||
cmd 'show running-config' do |cfg| | ||
cfg.gsub!(/(snmp-server community )(\S+)/, '\1<hidden>') | ||
cfg.gsub!(/key type private.+key string end/m, '<private key hidden>') | ||
cfg | ||
end | ||
|
||
cmd 'show version' do |cfg| | ||
cfg.gsub! /^(.* uptime is ).*\n/, '\1' | ||
comment cfg | ||
end | ||
|
||
cmd 'show transceiver' do |cfg| | ||
comment cfg | ||
end | ||
|
||
cfg :telnet do | ||
username /^Username:/ | ||
password /^Password:/ | ||
end | ||
|
||
cfg :telnet, :ssh do | ||
post_login 'terminal length 0' | ||
pre_logout 'exit' | ||
end | ||
end |