oxidized: CiscoSMB Model doesn't work on cisco SG series (still small business)
I have a couple of cisco SG-200 specifically, and the model doesn’t match. Not even the prompt.
I’ve tried modifying the model file, and i’ve reached to the point where the oxs commands returns the output of most commands (like show clock) but i cannot manage to make it output the “show running-config” command, as it ends with
Here is the diff of what i’ve done to the file (i wasn’t sure i could make a new model file and use it)
[oxidized@oxidized model]$ diff ciscosmb.rb backupsmb
6c6
< prompt /\n?([\w.@()-]+[#>]\s?)/
---
> prompt /^\r?([\w.@()-]+[#>]\s?)$/
37,38c37,38
< username /Username:/
< password /Password:/
---
> username /^User Name:/
> password /^\r?Password:$/
41a42
> post_login 'terminal datadump' # Disable pager
[oxidized@oxidized model]$
here’s the output using the oxs
[oxidized@oxidized model]$ oxs -m ciscosmb -u cisco -p <pass> -v -d <redacted> 'show clock'
D, [2016-11-08T12:40:25.614364 #8714] DEBUG -- : resolving DNS for <redacted>...
D, [2016-11-08T12:40:25.614839 #8714] DEBUG -- : node.rb: resolving node key 'input', with passed global value of 'telnet' and node value ''
D, [2016-11-08T12:40:25.614877 #8714] DEBUG -- : node.rb: returning node key 'input' with value 'telnet'
D, [2016-11-08T12:40:25.619064 #8714] DEBUG -- : node.rb: resolving node key 'output', with passed global value of 'git' and node value ''
D, [2016-11-08T12:40:25.619114 #8714] DEBUG -- : node.rb: returning node key 'output' with value 'git'
D, [2016-11-08T12:40:25.633508 #8714] DEBUG -- : node.rb: resolving node key 'model', with passed global value of '' and node value 'ciscosmb'
D, [2016-11-08T12:40:25.633572 #8714] DEBUG -- : node.rb: setting node key 'model' to value 'junos' from global
D, [2016-11-08T12:40:25.633599 #8714] DEBUG -- : node.rb: returning node key 'model' with value 'ciscosmb'
D, [2016-11-08T12:40:25.633626 #8714] DEBUG -- : lib/oxidized/node.rb: Loading model "ciscosmb"
D, [2016-11-08T12:40:25.634408 #8714] DEBUG -- : lib/oxidized/model/model.rb Added all to the commands list
D, [2016-11-08T12:40:25.634453 #8714] DEBUG -- : lib/oxidized/model/model.rb Added secret to the commands list
D, [2016-11-08T12:40:25.634476 #8714] DEBUG -- : lib/oxidized/model/model.rb Added show version to the commands list
D, [2016-11-08T12:40:25.634493 #8714] DEBUG -- : lib/oxidized/model/model.rb Added show running-config to the commands list
D, [2016-11-08T12:40:25.634728 #8714] DEBUG -- : node.rb: resolving node key 'username', with passed global value of '' and node value ''
D, [2016-11-08T12:40:25.634768 #8714] DEBUG -- : node.rb: setting node key 'username' to value 'username' from global
D, [2016-11-08T12:40:25.634792 #8714] DEBUG -- : node.rb: returning node key 'username' with value 'username'
D, [2016-11-08T12:40:25.634808 #8714] DEBUG -- : node.rb: resolving node key 'password', with passed global value of '' and node value ''
D, [2016-11-08T12:40:25.634826 #8714] DEBUG -- : node.rb: setting node key 'password' to value 'password' from global
D, [2016-11-08T12:40:25.634843 #8714] DEBUG -- : node.rb: returning node key 'password' with value 'password'
D, [2016-11-08T12:40:26.735439 #8714] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login commands at <redacted>
D, [2016-11-08T12:40:26.735520 #8714] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login command: "terminal width 0", block: nil at <redacted>
D, [2016-11-08T12:40:26.735546 #8714] DEBUG -- : Telnet: terminal width 0 @<redacted>
D, [2016-11-08T12:40:26.778612 #8714] DEBUG -- : lib/oxidized/model/model.rb Executing show clock
D, [2016-11-08T12:40:26.778681 #8714] DEBUG -- : Telnet: show clock @<redacted>
## HOST - <redacted>
## OXS - show clock
12:44:37 DFL(UTC+8) Nov 08 2016
No time source
[oxidized@oxidized model]$ oxs -m ciscosmb -u cisco -p <pass> -v -d <redacted> 'show run'
D, [2016-11-08T12:40:30.285016 #8717] DEBUG -- : resolving DNS for <redacted>...
D, [2016-11-08T12:40:30.285504 #8717] DEBUG -- : node.rb: resolving node key 'input', with passed global value of 'telnet' and node value ''
D, [2016-11-08T12:40:30.285543 #8717] DEBUG -- : node.rb: returning node key 'input' with value 'telnet'
D, [2016-11-08T12:40:30.289605 #8717] DEBUG -- : node.rb: resolving node key 'output', with passed global value of 'git' and node value ''
D, [2016-11-08T12:40:30.289652 #8717] DEBUG -- : node.rb: returning node key 'output' with value 'git'
D, [2016-11-08T12:40:30.304237 #8717] DEBUG -- : node.rb: resolving node key 'model', with passed global value of '' and node value 'ciscosmb'
D, [2016-11-08T12:40:30.304306 #8717] DEBUG -- : node.rb: setting node key 'model' to value 'junos' from global
D, [2016-11-08T12:40:30.304335 #8717] DEBUG -- : node.rb: returning node key 'model' with value 'ciscosmb'
D, [2016-11-08T12:40:30.304360 #8717] DEBUG -- : lib/oxidized/node.rb: Loading model "ciscosmb"
D, [2016-11-08T12:40:30.305120 #8717] DEBUG -- : lib/oxidized/model/model.rb Added all to the commands list
D, [2016-11-08T12:40:30.305164 #8717] DEBUG -- : lib/oxidized/model/model.rb Added secret to the commands list
D, [2016-11-08T12:40:30.305187 #8717] DEBUG -- : lib/oxidized/model/model.rb Added show version to the commands list
D, [2016-11-08T12:40:30.305205 #8717] DEBUG -- : lib/oxidized/model/model.rb Added show running-config to the commands list
D, [2016-11-08T12:40:30.305552 #8717] DEBUG -- : node.rb: resolving node key 'username', with passed global value of '' and node value ''
D, [2016-11-08T12:40:30.305600 #8717] DEBUG -- : node.rb: setting node key 'username' to value 'username' from global
D, [2016-11-08T12:40:30.305625 #8717] DEBUG -- : node.rb: returning node key 'username' with value 'username'
D, [2016-11-08T12:40:30.305643 #8717] DEBUG -- : node.rb: resolving node key 'password', with passed global value of '' and node value ''
D, [2016-11-08T12:40:30.305661 #8717] DEBUG -- : node.rb: setting node key 'password' to value 'password' from global
D, [2016-11-08T12:40:30.305678 #8717] DEBUG -- : node.rb: returning node key 'password' with value 'password'
D, [2016-11-08T12:40:31.386393 #8717] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login commands at <redacted>
D, [2016-11-08T12:40:31.386471 #8717] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login command: "terminal width 0", block: nil at <redacted>
D, [2016-11-08T12:40:31.386497 #8717] DEBUG -- : Telnet: terminal width 0 @<redacted>
D, [2016-11-08T12:40:31.429370 #8717] DEBUG -- : lib/oxidized/model/model.rb Executing show run
D, [2016-11-08T12:40:31.429416 #8717] DEBUG -- : Telnet: show run @<redacted>
timed out while waiting for more data
/usr/local/share/gems/gems/oxidized-0.18.0/lib/oxidized/input/telnet.rb:107:in `waitfor': timed out while waiting for more data (Timeout::Error)
from /usr/local/share/gems/gems/net-telnet-0.1.1/lib/net/telnet.rb:696:in `cmd'
from /usr/local/share/gems/gems/oxidized-0.18.0/lib/oxidized/input/telnet.rb:43:in `cmd'
from /usr/local/share/gems/gems/oxidized-0.18.0/lib/oxidized/model/model.rb:84:in `cmd'
from /usr/local/share/gems/gems/oxidized-script-0.3.1/lib/oxidized/script/script.rb:23:in `cmd'
from /usr/local/share/gems/gems/oxidized-script-0.3.1/lib/oxidized/script/cli.rb:39:in `run'
from /usr/local/share/gems/gems/oxidized-script-0.3.1/bin/oxs:5:in `<top (required)>'
from /usr/local/bin/oxs:23:in `load'
from /usr/local/bin/oxs:23:in `<main>'
I assume it’s because of this line. My suspicion is that after running a “Show run” there’s a sneaky control character after the config and that’s somehow caught in the ‘line’ variable.
Does anyone have any suggestions regarding this ? Using the model without any modifications wont run any commands. The ios module doesn’t work as well.
Many thanks!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 26 (20 by maintainers)
Commits related to this issue
- Merge remote-tracking branch 'upstream/master' * upstream/master: (109 commits) delete secret password if it is called secret bump up version update changelogs Recursively search from one dir... — committed to nertwork/oxidized by deleted user 8 years ago
- Update fork (#1) * Remove extra new lines added by export command * Updated Dockerfile to use ruby 2.3 * ruby2.1 behaves oddly with this style of dependcy fixed #565 * rollback `alvarion`... — committed to MajesticFalcon/oxidized by MajesticFalcon 7 years ago
Does this mean this issue can be closed?