Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would be grateful for any help, Thanks!#!/usr/bin/perl use strict; use warnings; use Net::Appliance::Session; my @ipconadd = qw(1.1.1.1 2.2.2.2 3.3.3.3); my $s = Net::Appliance::Session->new({ personality => 'ios', transport => 'SSH', host => @ipconadd }); eval { $s->connect({ username => 'admin', password => 'coolbro' }); $s->begin_privileged({ password => 'verycoolbro' }); print $s->cmd('show hostname'); print $s->cmd('show inventory | i SN'); $s->end_privileged; }; if ($@) { warn "failed to execute command: $@"; } $s->close;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: read IPv4 addresses from array
by GrandFather (Saint) on Aug 18, 2015 at 07:48 UTC | |
by andreyns (Initiate) on Aug 18, 2015 at 08:53 UTC | |
|
Re: read IPv4 addresses from array
by Corion (Patriarch) on Aug 18, 2015 at 07:48 UTC | |
by andreyns (Initiate) on Aug 18, 2015 at 09:00 UTC | |
by Corion (Patriarch) on Aug 18, 2015 at 09:06 UTC | |
by andreyns (Initiate) on Aug 18, 2015 at 09:50 UTC |