ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.79k stars 922 forks source link

Problem with HP 830 8P #1365

Closed Olegsplit closed 1 year ago

Olegsplit commented 6 years ago

Oxidized version 0.21.0 Hi, I had problem with HP 830 8P:

#                ^
#  % Unrecognized command found at '^' position.
#                ^
#  % Unrecognized command found at '^' position.
               ^
 % Unrecognized command found at '^' position.

For this device must entered "super" user and password for it. My config file source:

  default: csv
  csv:
    file: "/home/oxidized/.config/oxidized/router.db"
    delimiter: !ruby/regexp /:/
    map:
      group: 0
      name: 1
      ip: 2
      model: 3
      username: 4
      password: 5
    vars_map:
      comware_cmdline: 6
      enable: 7

route.db Group:name:IP:comware:user:pass:super:super-pass

This didn't work until I modify comware.rb added:

cfg :telnet, :ssh do
    # enable command-line mode on SMB comware switches (HP V1910, V1920)
    # autodetection is hard, because the 'summary' command is paged, and
    # the pager cannot be disabled before _cmdline-mode on.
    if vars :comware_cmdline
      post_login do
        send "_cmdline-mode on\n"
        send "y\n"
        send vars(:comware_cmdline) + "\n"
        send vars(:enable) + "\n"
      end
    end

After that I get config from device.

What can I do something else that not modefy comware.rd?

Olegsplit commented 6 years ago

In new version(0.24.0) I have same problem and must change original code:

  cfg :telnet, :ssh do
    # enable command-line mode on SMB comware switches (HP V1910, V1920)
    # autodetection is hard, because the 'summary' command is paged, and
    # the pager cannot be disabled before _cmdline-mode on.
    if vars :comware_cmdline
      post_login do
        send "_cmdline-mode on\n"
        send "y\n"
        send vars(:comware_cmdline) + "\n"
        #send "xtd-cli-mode on\n"             <<<<<<<commented<<<<<<<<<<<<
        #send "y\n"                           <<<<<<<commented<<<<<<<<<<<<
        #send vars(:comware_cmdline) + "\n"   <<<<<<<commented<<<<<<<<<<<<
         send vars(:enable) + "\n"            <<<<<<<added<<<<<<<<<<<<<<<<
     end
    end