Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: read IPv4 addresses from array

by Corion (Patriarch)
on Aug 18, 2015 at 09:06 UTC ( [id://1138984]=note: print w/replies, xml ) Need Help??


in reply to Re^2: read IPv4 addresses from array
in thread read IPv4 addresses from array

If you want help with these "many syntax errors", you will have to show them to us.

Replies are listed 'Best First'.
Re^4: read IPv4 addresses from array
by andreyns (Initiate) on Aug 18, 2015 at 09:50 UTC
    OMG! It is works! I had a problem like: Global symbol "$s" requires explicit package name at csc-getinfo.pl line 34. because last line was $s->close; Now I rewrite a little bit a script.
    #!/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); foreach my $ip (@ipconadd) { print "Processing $ip:\n"; my $s = Net::Appliance::Session->new({ personality => 'ios', transport => 'SSH', host => $ip }); eval { $s->connect({ username => 'login', password => 'password' }); $s->begin_privileged({ password => 'verycoolbro' }); print $s->cmd('show hostname'); print $s->cmd('show inventory | i SN'); $s->end_privileged; $s->close; }; print "IP $ip done.\n"; }; if ($@) { warn "failed to execute command: $@"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1138984]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-24 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found