Sponsored Content
Top Forums Shell Programming and Scripting perl script to traceroute an IP from windows Post 302697623 by Skrynesaver on Friday 7th of September 2012 06:03:56 AM
Old 09-07-2012
I haven't used Net::Traceroute on windows, however the traceroute executable on windows is called tracert. You can specify the trace_program in the constructor so that the declaration of $tr becomes
Code:
my $tr=Net::Traceroute->new(
                            host=> "google.com"
                            trace_program=>"tracert"
                           );

;

Note that you can also set debug=>1 in the event that you still need to see what is going wrong.
This User Gave Thanks to Skrynesaver For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merge two files in windows using perl script

Hi I want to merge two or more files using perl in windows only(Just like Paste command in Unix script) . How can i do this.Is ther any single command to do this? Thanks Kunal (1 Reply)
Discussion started by: kunal_dixit
1 Replies

2. Shell Programming and Scripting

How to change a directory on windows via perl script

How to change a directory on windows via perl script. I wanna mount a share on windows via perl script. I have used:- system("dir"); gives the list of directories in the drive i am.This command works well. Now i want to move from c drive to z drive via perl script.I am using:- ... (2 Replies)
Discussion started by: TRUPTI
2 Replies

3. Shell Programming and Scripting

Looking for a perl script (windows) to delete the contents of a file

Hi All, Im having a file named logserver.txt. I want a perl script to take a backup of that file, along with the datestamp; move the file to a different location or empty the contents of the file after backup. Remember, the file gets generated when the related service starts. My condition is... (14 Replies)
Discussion started by: ntgobinath
14 Replies

4. UNIX for Dummies Questions & Answers

Need help configuring Active Perl on Windows Vista.: Perl Scripting on Windows

Hi All, Need help configuring Active Perl on Windows Vista. I am trying to install Active Perl on Windows Vista. The version of Active Perl i am trying to install is : ActivePerl 5.10.1 Build 1006 After installing it through cmd, When i try to run perl -v to check the version, i get the... (2 Replies)
Discussion started by: Vabiosis
2 Replies

5. Windows & DOS: Issues & Discussions

Running perl script from a VB.NET windows service

Here is the snippet of the code that I'm trying to execute. Stat of the service does not launch perl script. OnStop works fine. Please could you help here. Public Class Service1 Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This... (0 Replies)
Discussion started by: hansini
0 Replies

6. Shell Programming and Scripting

Traceroute script weird output

This script is giving weird output #!/bin/bash NETPATH=(`/bin/traceroute -n 4.2.2.2 | awk '{print $2}'`) for i in "${NETPATH}" do echo $i done The output: to 11.11.11.1 1.1.1.1 99.111.208.2 traceroute_test.sh traceroute_test.sh (7 Replies)
Discussion started by: thumbs
7 Replies

7. Shell Programming and Scripting

Launch a windows program from perl script

Hi i wanted to know if any one can give me an example on how to launch a windows program in a perl script. I wanted to open the nmap software on my computer with a perl script, i heard this can be done with the system function. Would the function be in this format: $text =... (1 Reply)
Discussion started by: kingbp
1 Replies

8. Programming

Problem with Perl script after moving from a Windows/Apache Server to a UNIX server.

I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning. The script is called cwrmail.pl and is located in my cgi-bin. When I... (9 Replies)
Discussion started by: BigBobbyB
9 Replies

9. IP Networking

Perl : traceroute error

I am writing a perl code(windows) to traceroute IP address and to print the output. Could anyone please supply the code. I had executed the below code which was taken from cpan modules #!C:/perl/bin/perl.exe use Net::Traceroute; $tr = Net::Traceroute->new(host=> "google.com");... (1 Reply)
Discussion started by: giridhar276
1 Replies

10. Shell Programming and Scripting

Perl script to parse multiple windows event logs.

Hi all, I am developing a log parsing agent in perl to send windows Event logs to Zenoss Monitoring tool. Using Win32::EventLog i can able to get the Event messages but only one Eventype eg Application or System could able to parse at a time. Can you please help to how to open mutiple eventlogs... (3 Replies)
Discussion started by: kar_333
3 Replies
SC_ANALYSIS_DUMP(1)					    BSD General Commands Manual 				       SC_ANALYSIS_DUMP(1)

NAME
sc_analysis_dump -- dump of traceroute data in a format that is easily parsed. SYNOPSIS
sc_analysis_dump [-cCdeghHiloprst] [-D debug-count] [-G geo-server] [-S skip-count] [file ...] DESCRIPTION
The sc_analysis_dump utility provides a dump of traceroute data in a format that is easily parsed by scripts. Each line output contains a summary of a single trace, and includes the interfaces visited and the delay of each response. The output format is identical to that of sk_analysis_dump from CAIDA, except that it uses the scamper file API to read both arts++ files produced by skitter and warts files produced by scamper. The options are as follows: -c disables printing the cycle number in each line of output. -C disables printing the comments about the output at the top of the output. -d disables printing the destination address in each line of output. -D debug-count for each input file stop reading after the specified number of traces. -e adds the response from the destination to each line of output. -g use geographical data from netacuity. Not all builds of sc_analysis_dump support this option. -G geo-server specifies the name of the netacuity server to use. -h prints a help message and then exits. -H disables printing the halt fields: why traceroute halted and data for that reason. -i disables printing the RTT to each hop, and how many tries were required. -l disables printing the list id in each line of output. -o prints each line of output using the old format from sk_analysis_dump 1.0. -p disables print path data in each line of output. -r disables printing the data associated the response from a destination: the RTT, the TTL of the probe, and the TTL of the response. -s disables printing the source IP address in each line of output. -S skip-count skips the defined number of traces from each input file. -t disables printing the timestamp of when the traceroute began. OUTPUT
There is one trace per line. Fields are separated by a tab character. The output is structured into header fields (2 to 6), reply fields (7 to 10) corresponding to the response received from the destination, halt fields (11 and 12), and hop fields (beginning at index 13). 1. Key Indicates the type of line and determines the meaning of the remaining fields. This will always be 'T' for an IP trace. 2. Source Source IP of skitter/scamper monitor performing the trace. 3. Destination Destination IP being traced. 4. ListId ID of the destination list containing this destination address. This value will be zero if no list ID was provided. A ListId is a 32 bit unsigned integer. 5. CycleId ID of current probing cycle. A cycle is a single run through a given list. A CycleId is a 32 bit unsigned integer. For skitter traces, cycle IDs will be equal to or slightly earlier than the timestamp of the first trace in each cycle. There is no standard interpretation for scamper cycle IDs. This value will be zero if no cycle ID was provided. 6. Timestamp Timestamp when trace began to this destination. 7. DestReplied Whether a response from the destination was received. The character R is printed if a reply was received. The character N is printed if no reply was received. Since skitter sends a packet with a TTL of 255 when it halts probing, it is still possible for the final destination to send a reply and for the HaltReasonData (see below) to not equal no_halt. Note: scamper does not perform this last-ditch probing at TTL 255 by default. 8. DestRTT The RTT (ms) of first response packet from destination. This value is zero if DestReplied is N. 9. RequestTTL TTL set in request packet which elicited a response (echo reply) from the destination. This value is zero if DestReplied is N. 10. ReplyTTL TTL found in reply packet from destination. This value is zero if DestReplied is N. 11. HaltReason A single character corresponding to the reason, if any, why incremental probing stopped. S is printed if the destination was reached or there is no halt data. U is printed if an ICMP unreachable message was received. L is printed if a loop was detected. G is printed if the gaplimit was reached. 12. HaltReasonData Extra data about why probing halted. If HaltReason is S, the zero is output. If HaltReason is U, the ICMP code of the unreachable message is printed. If HaltReason is L, the length of the loop is printed. If HaltReason is G, the length of the gap is printed. 13. PathComplete Whether all hops to destination were found. C is printed if the trace is complete, all hops are found. I is printed if the trace is incomplete, at least one hop is missing (i.e., did not respond). 14. PerHopData Response data for each hop. If multiple IP addresses respond at the same hop, response data for each IP address are separated by semicolons: IP,RTT,numTries (for only one responding IP) IP,RTT,numTries;IP,RTT,numTries;... (for multiple responding IPs) where IP is the IP address which sent a TTL expired packet, RTT is the RTT of the TTL expired packet, and numTries is the number of tries before a response was received from the TTL. This field has the value 'q' if there was no response at a hop. EXAMPLES
The command: sc_analysis_dump file1.warts file2.warts will decode and print the traceroute objects in file1.warts, followed by the traceroute objects in file2.warts. The command: gzcat file1.warts.gz | sc_analysis_dump will decode and print the traceroute objects in the uncompressed file supplied on stdin. SEE ALSO
scamper(1), sc_wartsdump(1) AUTHORS
sc_analysis_dump is written by Matthew Luckie <mjl@luckie.org.nz>. It is derived from CAIDA's sk_analysis_dump program and should behave in an identical manner. BSD
October 15, 2010 BSD
All times are GMT -4. The time now is 06:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy