# How to ping server with time interval?



## peter7865 (Jan 24, 2013)

To ping a server continuously i have to type ping IP -t.
But how can i set interval between each ping, for example, 4 seconds?


----------



## cgc018 (Jan 22, 2012)

Hi peter,

This can actually be accomplished with writing a batch script. Check out this link that I found and let us know if this helps you out.

loops - Batch Script - Ping Address - Write to file if failure - Stack Overflow


----------



## MPR (Aug 28, 2010)

You could write a simple batch file using timeout:

:top
ping %1
timeout %2
goto :top


Name it something like pingtime.bat and run it thusly:

pingtime <address to ping> < seconds between ping sessions>

ex: pingtime google.com 10


----------



## Fjandr (Sep 26, 2012)

Here's a modified copy of a script from StackOverflow which includes logging of the ping data to a text file, and doesn't require command line arguments:

```
@ECHO OFF
set IPADDRESS=x.x.x.x
set INTERVAL=240
:PINGINTERVAL
ping %IPADDRESS% -t >> ping_stats.txt
timeout %INTERVAL%
GOTO PINGINTERVAL
```
All that needs changed is to insert the correct IP address where the x.x.x.x is.


----------



## peter7865 (Jan 24, 2013)

Thanks, for the scripts. I have very lousy ISP provider so i want to monitor how much time a day i am disconnected and for how long time. If you know for some program that can provide me the reports in more convenient way then the batch scripts, i could use it too.


----------



## MPR (Aug 28, 2010)

Here is a neat batch file that checks connection status. You could modify it to ping every few minutes and output the status reports to a file.

A handy batch file to check network connectivity.


----------



## jcgriff2 (Sep 30, 2007)

What about activating logging in your modem/router?


----------



## Tekno Venus (Jul 29, 2012)

peter7865 said:


> Thanks, for the scripts. I have very lousy ISP provider so i want to monitor how much time a day i am disconnected and for how long time. If you know for some program that can provide me the reports in more convenient way then the batch scripts, i could use it too.


PingPlotter (Standard Version) should be able to accomplish what you want - PingPlotter Download. You can also create alerts when there's no connectivity.

-Stephen


----------



## peter7865 (Jan 24, 2013)

Thanks, for all suggestions. I also found this program which is working fine:
Free network monitor - monitoring software - EasyNetMonitor

By the way, am i risking google or any other site, to ban my IP address if i ping them non stop?


----------

