edimusrex has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to get the version information off of a cisco sg300 smart switch. I have decided to use the module Net::SSH2::Cisco which I have used in the past for a cisco phone server. When running the following script
#!/usr/bin/perl use warnings; use strict; use Net::SSH2::Cisco; my $host = "<my_host>"; my $user = "<my_user>"; my $password = "<my_password>"; my $session = Net::SSH2::Cisco->new(host => $host); $session->login(username => $user, password => $password); my @version = $session->cmd("show version"); print @version; $session->close;
Thanks in advanced
** Update **
I think I have isolated the issue but now need to figure out how to implement it. The issue seems to be related to the expected prompt for the username/login. The switch expects "User Name:" as the prompt. I've switched to using the module Net::Appliance::Session which appears to have a way to allow custom prompts, just a matter of figuring it out now. Help always appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Issue with ssh to a cisco smart switch
by VinsWorldcom (Prior) on Sep 12, 2017 at 22:43 UTC | |
by edimusrex (Monk) on Sep 13, 2017 at 14:12 UTC | |
|
Re: Issue with ssh to a cisco smart switch
by thanos1983 (Parson) on Sep 12, 2017 at 22:38 UTC | |
by edimusrex (Monk) on Sep 13, 2017 at 14:13 UTC | |
|
Re: Issue with ssh to a cisco smart switch
by Anonymous Monk on Sep 12, 2017 at 20:51 UTC |