Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raisecom.rb script issues #3378

Open
Roc3912 opened this issue Jan 21, 2025 · 0 comments
Open

raisecom.rb script issues #3378

Roc3912 opened this issue Jan 21, 2025 · 0 comments

Comments

@Roc3912
Copy link

Roc3912 commented Jan 21, 2025

The original script is this:

cfg :ssh do
post_login 'terminal page-break disable'
pre_logout 'exit'
end
end
There is a difference between the terminal page-break disable command of raisecom equipment and the terminal length0 of cisco. The command effect still exists after the session ends. The command will be automatically output after the next login to the device, which is very unfriendly.

This is the version I optimized and I think is pretty good:

class RAISECOM < Oxidized::Model
using Refinements

comment '!' ##在每行添加 !注释,如果想去除可以' '
prompt /([>-#]\s?)$/

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

cmd 'show running-config' do |cfg|
comment cfg
end

cmd 'terminal page-break enable' do |cfg|
comment cfg
cfg
end

cfg :telnet do
username /Login:/
password /Password:/
post_login 'terminal page-break disable'
pre_logout 'exit'
end
end

note:
!command in qos mapping mode
!
--More-- (The device will not automatically paging,It looks like the command has been executed successfully.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant