multiple extended traceroute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2012 06:00 PM - edited 03-07-2019 07:46 AM
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
- Labels:
-
Other Switching
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2012 10:51 PM
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
