Comments (6)
We need a model maintainer for Cisco SMB who could work on this issue.
from oxidized.
This change work for all SG and CBS Switches. Only the CBS220 is not working.
from oxidized.
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.
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.
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.
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)
- Can't run syslog.rb - cannot load such file -- asetus (LoadError)
- problem when you specify the ssh port
- Sonicos Model: '-' in name of device is not supported HOT 1
- fireeye ex sh run backup issue
- Rugged githubrepo unsupported URL Protocol HOT 1
- Contribution: Synology Nas model HOT 1
- Syndrome HOT 1
- Contribution: Sonicwall SonicOS 4.x model HOT 3
- Unable to write a backup of a ruckus ICX 7250 switch
- Contribution: Vmware Esxi model
- Duplicated nodes using http pagination HOT 2
- HTTPS: unsupported protocol [OpenSSL::SSL::SSLError] HOT 2
- HP ArubaOS-CX: power-consumption starting with version FL.10.13.xxxx - permanent power changes logged HOT 2
- rake test fails on Oxidized::SSH::#connect#test_0001 HOT 1
- ERROR -- : Hook push_to_remote SshError: remote rejected authentication: Failed getting response HOT 5
- Load nodes didn't recognized ArubaOS Mobility Controller 8.10.0.9 (use aosw or Aaosw) and F5 Big-IP (use tmos) HOT 1
- passwords with special characters (dollar sign and space) HOT 3
- ArubaOS8 need update propmt HOT 4
- about not login use password (maybe is ruby net-ssh problem or oxidized??) HOT 4
- vyatta snmp community secret leakage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oxidized.