Diagnostic Pinging – fpingbat

I found an awesome ping utility last week called fping: http://www.kwakkelflap.com/fping.html

The main things I like about it over the ping command is that comes with Windows is that it can send more pings over a given time period (1ms to 5 seconds) and can print a timestamp with each ping. The link above describes other things it can do.

I wrote a basic script which I’ve dubbed “fpingbat” to go along with it to quickly and easily test for network issues from a PC to a certain node. Here’s what I came up with:

@echo off

setlocal

:input
set INPUT=
set /P INPUT=Please enter a hostname or IP address: %=%
if “%INPUT%”==”” goto input

echo Pinging %INPUT% echo Information being logged to: log\%INPUT%_%date:~10,4%-%date:~7,2%-%date:~4,2%_pinglog.txt
echo Started at: %date% %time%
echo Press Ctrl+C to terminate batch job

“%~dp0\fping\x64 (64 bit)\fping.exe” %INPUT% -c -T -D -t 600 >> “%~dp0\log\%INPUT%_%date:~10,4%-%date:~7,2%-%date:~4,2%_pinglog.txt”

endlocal

What this script does is ask for an IP address or hostname to ping, then it pings it non-stop every 600 ms until you terminate the batch job. It will automatically place the output of the ping into a filename in a “Log” directory. Each ping is timestamped to assist with troubleshooting. The script should still work if you move the files around since it uses relative paths.

It’s convenient in that you can go to a machine, run the script from a network directory, minimise the console window, and view the results from the network directory from a machine of your choice a few hours later.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: