General discussion

Locked

per script

By mejaz ·
I have tried below scripts to get some users details from juniper (ERX)through my linux machine, but coudn't succed, any ones help is here hightly appreciated

Thanks in advance

Ejaz


#! /usr/bin/perl
$pass="xxxx";
$enable="xxxx";
#$username="[put a username here]"; # login name if needed
$infile="routerlist"; # list of routers to read from
$host="212.119.67.11";
use Net::Telnet::Cisco;
open (LIST,"$infile") or die "Couldn't open file $infile";
@list=<LIST>;
foreach (@list) {
($host)=split(/\s+/,$_);
&TELNET;
}

sub TELNET {
$t = Net::Telnet::Cisco->new(
Timeout => 10,
Host => $host
);
$t->errmode("return");
print "Trying $host\n";
#$t->login($username,$pass);
my @out=$t->password($pass);
my @out=$t->enable 5($enable);
print "downloading config...\n";
my $out=$t->cmd("show subscribers");
print $out;
$t->close;
}

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Networks Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums