Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Added
- String refinements: introduce `keep_lines` and `reject_lines` methods (@robertcheramy)
- Support for storing configurations only on significant changes (@robertcheramy)
- smartbyte: new model for SmartByte switches (@freddy36)

### Changed
- Refactored models: Use `keep_lines` and `reject_lines` in aosw, arubainstant, asa, efos, firelinuxos, fsos, ironware, mlnxos and perle to (@robertcheramy)
Expand Down
1 change: 1 addition & 0 deletions docs/Supported-OS-Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
|Siklu |EtherHaul |[siklu](/lib/oxidized/model/siklu.rb) |@bdg-robert
| |Multihaul TG |[siklumhtg](/lib/oxidized/model/siklumhtg.rb) |@bdg-robert |[Siklu Multihaul TG](Model-Notes/SikluMHTG.md)
|Seiko Solutions |SmartCS, SmartCS mini |[smartcs](/lib/oxidized/model/smartcs.rb)
|SmartByte |LT-S8228G series |[smartbyte](/lib/oxidized/model/smartbyte.rb) |@freddy36
|SonicWALL |SonicOS |[sonicos](/lib/oxidized/model/sonicos.rb)
|SNR |SNR-S300G, S2xxx, S3xxx, S4xxx|[dcnos](/lib/oxidized/model/dcnos.rb)
|Speedtouch |Thomson Speedtouch |[speedtouch](/lib/oxidized/model/speedtouch.rb)
Expand Down
47 changes: 47 additions & 0 deletions lib/oxidized/model/smartbyte.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
class SmartByte < Oxidized::Model
using Refinements

comment '! '

cmd :secret do |cfg|
cfg.gsub!(/group (\S+) v2c/, 'group <hidden> v2c')
cfg.gsub!(/community (\S+)/, 'community <hidden>')
cfg
end

cmd :all do |cfg|
cfg.each_line.to_a[0..-2].join
end

cmd 'show running-config'

cmd 'show version' do |cfg|
comment cfg
end

cmd 'show interface optical-transceiver info' do |cfg|
cfg.gsub! /^\|Transceiver current alarm information: \|\s+\+-------------------------------------------------\+.*?\s+\+-------------------------------------------------\+\s+/m, ''
Comment thread
freddy36 marked this conversation as resolved.
comment cfg
end

cmd 'show power' do |cfg|
comment cfg
end

cfg :telnet do
username /^.*? login:/
password /^Password:/
end

cfg :telnet, :ssh do
post_login do
if vars(:enable)
cmd "enable", /^[pP]assword:/
cmd vars(:enable)
end
end

post_login 'terminal length 0'
pre_logout 'exit'
end
end