Giter Site home page Giter Site logo

Cisco SmallBusiness is not working about oxidized HOT 6 OPEN

bueste avatar bueste commented on September 18, 2024
Cisco SmallBusiness is not working

from oxidized.

Comments (6)

robertcheramy avatar robertcheramy commented on September 18, 2024

We need a model maintainer for Cisco SMB who could work on this issue.

from oxidized.

bueste avatar bueste commented on September 18, 2024

This change work for all SG and CBS Switches. Only the CBS220 is not working.

from oxidized.

bueste avatar bueste commented on September 18, 2024

I could fix it and I have create a new Model for the cisco cbs220 series.

`class CiscoSMBCBS < Oxidized::Model
using Refinements

Cisco Small Business CBS220 series switches

https://www.cisco.com/c/en/us/support/switches/business-220-series-smart-switches/series.html

prompt /^[^\r\n]+[#>]/
comment '! '

cmd :all do |cfg|
lines = cfg.each_line.to_a[1..-2]
# Remove \r from beginning of response
lines[0].gsub!(/^\r.*?/, '') unless lines.empty?
lines.join
end

cmd :secret do |cfg|
cfg.gsub! /^(snmp-server community)./, '\1 '
cfg.gsub! /username (\S+) privilege (\d+) (\S+).
/, ''
cfg.gsub! /^(username \S+ password encrypted) \S+(.)/, '\1 \2'
cfg.gsub! /^(enable password level \d+ encrypted) \S+/, '\1 '
cfg.gsub! /^(encrypted radius-server key).
/, '\1 '
cfg.gsub! /^(encrypted radius-server host .+ key) \S+(.)/, '\1 \2'
cfg.gsub! /^(encrypted tacacs-server key).
/, '\1 '
cfg.gsub! /^(encrypted tacacs-server host .+ key) \S+(.)/, '\1 \2'
cfg.gsub! /^(encrypted sntp authentication-key \d+ md5) .
/, '\1 '
cfg
end

cmd 'show version' do |cfg|
cfg.gsub! /.Uptime for this control./, ''
cfg.gsub! /.System restarted./, ''
cfg.gsub! /uptime is\ .+/, ''
comment cfg
end

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?

from oxidized.

bueste avatar bueste commented on September 18, 2024

Issue for the Cisco SMB SG Series fix:

`class CiscoSMB < Oxidized::Model
using Refinements

Cisco Small Business 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.*?/, '') unless lines.empty?
lines.join
end

cmd :secret do |cfg|
cfg.gsub! /^(snmp-server community)./, '\1 '
cfg.gsub! /username (\S+) privilege (\d+) (\S+).
/, ''
cfg.gsub! /^(username \S+ password encrypted) \S+(.)/, '\1 \2'
cfg.gsub! /^(enable password level \d+ encrypted) \S+/, '\1 '
cfg.gsub! /^(encrypted radius-server key).
/, '\1 '
cfg.gsub! /^(encrypted radius-server host .+ key) \S+(.)/, '\1 \2'
cfg.gsub! /^(encrypted tacacs-server key).
/, '\1 '
cfg.gsub! /^(encrypted tacacs-server host .+ key) \S+(.)/, '\1 \2'
cfg.gsub! /^(encrypted sntp authentication-key \d+ md5) .
/, '\1 '
cfg
end

cmd 'show version' do |cfg|
cfg.gsub! /.Uptime for this control./, ''
cfg.gsub! /.System restarted./, ''
cfg.gsub! /uptime is\ .+/, ''
comment cfg
end

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
`

from oxidized.

robertcheramy avatar robertcheramy commented on September 18, 2024

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.

from oxidized.

systeembeheerder avatar systeembeheerder commented on September 18, 2024

Tested on SB250+SB350 and various CBS Switches.

I hat to outcoment:

Running CBS and SG Switches here without problems. No need to outcomment.

from oxidized.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.