Closed pavelbischoffi closed 1 year ago
In case of old 3Com models (3ComOS 3.x), you need a couple to tricks to make them work, Read this link:
https://github.com/ytti/oxidized/issues/2173
In summary, you need to add these 2 lines:
info-center source default channel 1 log state off debug state off
screen-length 0
Last one under "user-interface vty 0 4". It should work with that
Can you please reformat your paste to make it readable? (https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code)
Hi,
I am using the code in comware.rb file to archive configuration from some 3 com 5500 EI switches. But I am able to download only begining of the config output exactly to first pager (---- More ---- string) I can see in comware.rb, I am pasting below, the example how to manage pager, but I do not understand how to use it in display current config command on end of the file, has anybody some idea?
class Comware < Oxidized::Model
HP (A-series)/H3C/3Com Comware
sometimes the prompt might have a leading nul or trailing ASCII Bell (^G)
prompt /^\0*(<[\w.-]+>).?$/ comment '# '
example how to handle pager
expect /^\s*---- More ----$/ do |data, re|
send ' '
data.sub re, ''
end
cmd :all do |cfg|
cfg.gsub! /^.*\e[42D/, ''
example how to handle pager
end
cmd :secret do |cfg| cfg.gsub! /^( snmp-agent community)./, '\1'
cfg.gsub! /^( password hash). /, '\1 '
cfg.gsub! /^( password cipher).*/, '\1 '
cfg
end
cfg :telnet do username /^(Username|login):/ password /^Password:/ end
cfg :telnet, :ssh do
enable command-line mode on SMB comware switches (HP V1910, V1920)
end
cmd 'display version' do |cfg| cfg = cfg.each_line.reject { |l| l.match /uptime/i }.join comment cfg end
cmd 'display device' do |cfg| comment cfg end
cmd 'display device manuinfo' do |cfg| cfg = cfg.each_line.reject { |l| l.match 'FF'.hex.chr }.join comment cfg end
cmd 'display current-configuration' do |cfg| cfg end end