Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

multiple extended traceroute

Hello All, I am having an issue Running multiple extended traceroute commands at a time. We have a major change for summarizing and post checkout needs to trace public dns, to make sure we are taking the same path. Here is what I wanted to do

Traceroute 4.2.2.2 source vlan 1

Traceroute 4.2.2.2 source vlan 2 .... The list goes on for about more than 100 commands. When using putty, prompt returns after executing first command , but I wanted to capture atleast 10 commands at a time minimum to save my time. Any ideas? I Know to run tcl script for ping but not for traceroute.

Any help will be greatly appreciated.

Sent from Cisco Technical Support iPhone App

1 REPLY

multiple extended traceroute

Hello,

One thing is sure that you have to take help of script anyway to run many commands with little efforts.

Unfortunately I do not know tcl script.

I am using below perl scripts for running multipe commands on routers/nodes.

----------------------------------------------------------------------------------------------------------------------------------------

#!/usr/bin/perl

use strict;
use Net::Telnet ;


my @cmd_list;

my $f1 = "command_list.txt";  ### Store command you want to run here in this file ###

open FILE1, "$f1" or die "Could not open file: $! \n";
@cmd_list=;
@cmd_list = grep(/\S/, @cmd_list);
close FILE1;

my $session = new Net::Telnet (Timeout => 15,Prompt => '/#$/');
print "\n\n";


$session->open("node_name") ; ###  Need to change 'node_name' according to your router IP/hostname ###
$session->errmode("return");

$session->login('username', 'password');  ### Change credential accordingly ###

foreach $cmd (@cmd_list)  {
my @output=$session->cmd("$cmd");
print "@output";
}


$session->close;

----------------------------------------------------------------------------------------------------------------------------------------

Hope this helps

Regards # Mahesh

442
Views
5
Helpful
1
Replies