Closed bueste closed 4 months ago
We need a model maintainer for Cisco SMB who could work on this issue.
This change work for all SG and CBS Switches. Only the CBS220 is not working.
I could fix it and I have create a new Model for the cisco cbs220 series.
`class CiscoSMBCBS < Oxidized::Model using Refinements
prompt /^[^\r\n]+[#>]/ comment '! '
cmd :all do |cfg| lines = cfg.each_line.to_a[1..-2]
lines[0].gsub!(/^\r.*?/, '') unless lines.empty?
lines.join
end
cmd :secret do |cfg|
cfg.gsub! /^(snmp-server community)./, '\1
cmd 'show version' do |cfg|
cfg.gsub! /.Uptime for this control./, ''
cfg.gsub! /.System restarted./, ''
cfg.gsub! /uptime is\ .+/, '
cmd 'show bootvar' do |cfg| comment cfg end
cmd 'show running-config' do |cfg| cfg = cfg.each_line.to_a[0..-1].join cfg.gsub! /^Current configuration : [^\n]\n/, '' cfg.sub! /^(ntp clock-period)./, '! \1' cfg.gsub! /^ tunnel mpls traffic-eng bandwidth[^\n]\n( (?: [^\n]\n)* tunnel mpls traffic-eng auto-bw)/mx, '\1' cfg end
cfg :telnet, :ssh do username /User ?[nN]ame:/ password /^\r?Password:/
post_login 'terminal datadump' # Disable pager
post_login 'terminal width 0'
post_login 'terminal len 0'
pre_logout 'exit' # exit returns to previous priv level, no way to quit from exec(#)
pre_logout 'exit'
end end ` Could you pull it to the production tree?
Issue for the Cisco SMB SG Series fix:
`class CiscoSMB < Oxidized::Model using Refinements
prompt /^\r?([\w.@()-]+[#>]\s?)$/ comment '! '
cmd :all do |cfg| lines = cfg.each_line.to_a[1..-2]
lines[0].gsub!(/^\r.*?/, '') unless lines.empty?
lines.join
end
cmd :secret do |cfg|
cfg.gsub! /^(snmp-server community)./, '\1
cmd 'show version' do |cfg|
cfg.gsub! /.Uptime for this control./, ''
cfg.gsub! /.System restarted./, ''
cfg.gsub! /uptime is\ .+/, '
cmd 'show bootvar' do |cfg| comment cfg end
cmd 'show running-config' do |cfg| cfg = cfg.each_line.to_a[0..-1].join cfg.gsub! /^Current configuration : [^\n]\n/, '' cfg.sub! /^(ntp clock-period)./, '! \1' cfg.gsub! /^ tunnel mpls traffic-eng bandwidth[^\n]\n( (?: [^\n]\n)* tunnel mpls traffic-eng auto-bw)/mx, '\1' cfg end
cfg :telnet, :ssh do username /User ?[nN]ame:/ password /^\r?Password:/
post_login 'terminal datadump' # Disable pager
post_login 'terminal width 0'
post_login 'terminal len 0'
pre_logout 'exit' # exit returns to previous priv level, no way to quit from exec(#)
pre_logout 'exit'
end end `
This is great! Can you please submit a Pull Request? For Instructions see at https://github.com/ytti/oxidized/blob/master/CONTRIBUTING.md#how-to-contribute-content If something is not clear, just ask, I'll be happy to complete the instructions.
Tested on SB250+SB350 and various CBS Switches.
I hat to outcoment:
Running CBS and SG Switches here without problems. No need to outcomment.
Tested on SB250+SB350 and various CBS Switches.
I hat to outcoment:
Those switches haven't an enable comment...