Small Ping Program or Batch file needed.

What I need is pretty simple I think. I need a program or batch file that I can setup to ping our vpn three once every 6 hours or so. It would be ideal if the results could be in a log of some sort, but it's not required.

Everything New Technology 1823 This topic was started by ,


data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
What I need is pretty simple I think. I need a program or batch file that I can setup to ping our vpn three once every 6 hours or so. It would be ideal if the results could be in a log of some sort, but it's not required.
 
Is there any freeware out there that would do this for me, or would a batch file be the way to go with windows task manager.
 
It will be used from a Win2k System (SP4)
 
Thanks for your recommendations!

Participate on our website and join the conversation

You have already an account on our website? Use the link below to login.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


data/avatar/default/avatar22.webp

9 Posts
Location -
Joined 2003-12-08
Look for program called Nagios.
Runs on Linux and I have been told Windows Machines.

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
Thanks for the reply, but it looks to only run under *nix OS's.

data/avatar/default/avatar30.webp

556 Posts
Location -
Joined 2003-03-28
What about just putting this in a .bat file and running it as a scheduled task?
 

Code:
ping -n 5 www.yahoo.com >> c:\log.txt

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
Quote:What about just putting this in a .bat file and running it as a scheduled task?

Code:
ping -n 5 www.yahoo.com >> c:\log.txt



That was what I tried to begin with. Doesn't work. Just flashes the .bat on the screen for .2 seconds then closes. No ping is done, no log is created.

Thank you for your reply though.

data/avatar/default/avatar35.webp

2172 Posts
Location -
Joined 2002-08-26
There's a switch you can add after cmd.exe that will keep the window open until the batch file is complete, I believe it's /c.
 
For example:
 
cmd.exe /c pingtest.bat
 

Quote:CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
[ [/C | /K] string]
 
/C Carries out the command specified by string and then terminates
 
Note that multiple commands separated by the command separator '&&'
are accepted for string if surrounded by quotes. Also, for compatibility
reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the
same as /C. Any other switches are ignored.
 
If /C or /K is specified, then the remainder of the command line after
the switch is processed as a command line, where the following logic is
used to process quote (") characters:
 
1. If all of the following conditions are met, then quote characters
on the command line are preserved:
 
- no /S switch
- exactly two quote characters
- no special characters between the two quote characters,
where special is one of: &<>()@^|
- there are one or more whitespace characters between the
the two quote characters
- the string between the two quote characters is the name
of an executable file.
 
2. Otherwise, old behavior is to see if the first character is
a quote character and if so, strip the leading character and
remove the last quote character on the command line, preserving
any text after the last quote character.

 
That was from CMD /? at a cmd prompt, if you're curious. There's a lot more information there, too, but the majority of it was irrevelant in your case.

data/avatar/default/avatar13.webp

651 Posts
Location -
Joined 2000-07-31
Quote:Quote:What about just putting this in a .bat file and running it as a scheduled task?

Code:
ping -n 5 www.yahoo.com >> c:\log.txt



That was what I tried to begin with. Doesn't work. Just flashes the .bat on the screen for .2 seconds then closes. No ping is done, no log is created.

Thank you for your reply though.
Strange, it worked perfectly for me.

-bZj

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
Quote:Quote:Quote:What about just putting this in a .bat file and running it as a scheduled task?

Code:
ping -n 5 www.yahoo.com >> c:\log.txt



That was what I tried to begin with. Doesn't work. Just flashes the .bat on the screen for .2 seconds then closes. No ping is done, no log is created.

Thank you for your reply though.
Strange, it worked perfectly for me.

-bZj


I found where my problem was. Now it's working as it should. Is there a way to timestamp the log?

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
Quote:
Let me know the exacts on it, sounds like you want an hourly counter & test of connection type of pinger... mine is not far from that & I could add a feature like that in pretty easy I think, bit of math on 1 minute timers work + a variable that acts as a counter for the number of hours to do ping checks in question.

Quote:Is there any freeware out there that would do this for me, or would a batch file be the way to go with windows task manager.

It will be used from a Win2k System (SP4)

Thanks for your recommendations!

Yes, there might be... I can add that into my pinger pretty easy now that I think about it!



* Put it this way, there might be one... for Win32, & pretty soon! Good idea for another app of mine to modify to do that exact function!

APK

Yes an hourly counter to check if our server is online. It would be great if it could write the results to a log and have those results timestamped. If you find the time to do this, let me know!

data/avatar/default/avatar30.webp

556 Posts
Location -
Joined 2003-03-28
Quote:Quote:Quote:
What about just putting this in a .bat file and running it as a scheduled task?

Code:
ping -n 5 www.yahoo.com >> c:\log.txt
That was what I tried to begin with. Doesn't work. Just flashes the .bat on the screen for .2 seconds then closes. No ping is done, no log is created.

Thank you for your reply though.
Strange, it worked perfectly for me.

-bZj


I found where my problem was. Now it's working as it should. Is there a way to timestamp the log?

In your .bat file have the lines
Code:
echo ---------------------------echo %TIME% %DATE% >> c:\log.txtping -n 5 www.yahoo.com >> c:\log.txt


That will give you the timestamp (in the format "11:26:24.88 Thu 12/18/2003") right above the ping results.

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
I will gladly do the minutes for you as well as test the app. Feel free to e-mail me when you want to get started on the testing. In the meantime, I'll get you your minutes.
 
lotus@prexar.com

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
If I understood what it is you wanted, then here is your answer.
 
1034310 total minutes
 
(60 + 61 + 62 + 63 ... + 1430 + 1440)
 
Is this what you wanted APK?

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
Sounds really good! I can't wait to try this out!
 
60
120
180
240
300
360
420
480
540
600
660
720
780
840
900
960
1020
1080
1140
1200
1260
1320
1380
1440

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
Thanks for taking the time to do this APK, I appreciate it. This is going to come in extremely handy for me, and others I would imagine.

data/avatar/default/avatar01.webp

1547 Posts
Location -
Joined 2002-05-29
@Lotus and APK,
 
I've copied the APK Ping into the LeechMeNow folder. Have fun

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
It's currently running without any problems. I like what you've done with it. The timed pings are working as they should, and the log file is just what I needed.
 
I have a couple idea's for you, not sure how easy it would be to implement them.
 
I'll test it for another day or so, then give you my thoughts. But so far so good!
 
Thanks for doing it so quick!

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
Well, I'll tell you, from a users stand point, TABS are a great thing. I think that adding tabs would make the program a little more stylish. I LOVE the idea of adding a notification/warning message stating that the IP/name your pinging is down/offline. If you added along with that message the time it went down, it would be extremely handy. To be able to toggle that option on and off with a checkbox is a great idea as well.
 
So far the one thing I noticed (bug related?) is that when I minimize and hide screen, the names of the icons on the desktop hide as well =) Easily brought back by clicking them. But still, thought you should know.
 
I would also like to see the program remeber IP address I recently pinged. I notice if I shut it down and the restart it, the IP defaults back to 127.0.0.1. Maybe even add a drop down menu for IP's/names you have pinged. It would be just a convenience option.
 
I'll give you more comments soon, got to get back to work!
 
Regards,
 
Scott / Lotus

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
Upon closing and re-opening, the IP WAS the one I last pinged. Strange, it was the 127.0.0.1 the last time. Oh well, all is good with it!

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
Also, the video card I am using on this machine is an Intel 82810E.

data/avatar/default/avatar01.webp

1547 Posts
Location -
Joined 2002-05-29
OK, the updates are in the LeechMeNow folder

data/avatar/default/avatar06.webp

286 Posts
Location -
Joined 2001-07-17
OP
many thanks jmmijo