Closed adamboutcher closed 6 years ago
It looks like the password maybe changing per firmware?
This model of switch HP Comware 1950 has always had a different password although it looks like it's changeable per firmware, could we have this as a variable?
Thanks
On 8 Nov 2016 6:28 p.m., "ytti" notifications@github.com wrote:
It looks like the password maybe changing per firmware?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ytti/oxidized/issues/611#issuecomment-259218552, or mute the thread https://github.com/notifications/unsubscribe-auth/AB0qiwRm5r58VG9Q25PCqs2VZvPI4LZSks5q8L9bgaJpZM4KsgKA .
We could have hash mapping firmware to password. Then query for version, and set password from hash based on returned version.
But I don' really understand the problem even, I don't have these devices. Maybe @sid3windr @erJasp @amarti2038 or @nickhilliard can chime in.
There's a section for the 1910/1920 I believe but the command it initially sends is incorrect for the later models...
The line https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/comware.rb#L32
is incorrect for this model switch, it should be
send "xtd-cli-mode\n"
@sid3windr comments about the cli-mode command?
I know it's been a while but do we have any news/update on this issue?
@adamboutcher Can we send both commands to catch the different models or will that cause issues?
If you send _cmdline-mode on to my model which uses xtd-cli-mode just ends up saying "% Unrecognised command found at '^' potision.", so you could check for that and then provide the correct command.
Or just send them both? If it returns to the prompt after then things should just carry on.
I can't test how the models that don't support the xtd-cli-mode command would act but I cant see why not.
Try it for you, add the command to the model (see https://github.com/ytti/oxidized/blob/master/docs/Creating-Models.md on how to do it in your own install). See if it works and then feel free to submit as a pull request. I'm not sure it's the way the project would want it to be done but let's see.
i made the hp1950 work by making a copy of the comware model to : /var/lib/gems/2.3.0/gems/oxidized-0.21.0/lib/oxidized/model/comware1950.rb
changeing the lines: username /^login: $/ password /^Password: $/
and: cfg :telnet, :ssh do
# 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\n"
send "y\n"
send vars(:comware_cmdline) + "\n"
end
end
@semplonius6 Thanks for the help, I'm not a ruby dev so wasn't sure where/how to edit the files. I've pushed a change to the comware file which works for my newer model Comwares:
PR #1305
Closed by #1305
Hi,
As all the commands required for Oxidized to work are being some stupid password wall xtd_cli_mode, the HP Comware 1950 doesn't get its configuration backed up.
Some kind soul on Reddit has found the password here (foes-bent-pile-atom-ship), I was wondering if you guys could add support?
Thanks