Compatible Support Forums: Small Ping Program or Batch file needed.

Jump to content

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Small Ping Program or Batch file needed.

#1 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 17 December 2003 - 08:01 PM

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!
0

#2 User is offline   dhs13 

  • stranger
  • Group: Members
  • Posts: 9
  • Joined: 08-December 03

Posted 17 December 2003 - 08:58 PM

Look for program called Nagios.
Runs on Linux and I have been told Windows Machines.
0

#3 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 17 December 2003 - 10:54 PM

Thanks for the reply, but it looks to only run under *nix OS's.
0

#4 User is offline   ViolentGreen 

  • addict
  • Group: Members
  • Posts: 557
  • Joined: 28-March 03

Posted 17 December 2003 - 11:54 PM

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

0

#5 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 18 December 2003 - 12:35 AM

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.
0

#6 User is offline   adamvjackson 

  • Pooh-Bah
  • Group: Members
  • Posts: 2174
  • Joined: 26-August 02

Posted 18 December 2003 - 05:56 AM

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]
[[/S] [/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.
0

#7 User is offline   Down8 

  • addict
  • Group: Members
  • Posts: 657
  • Joined: 31-July 00

Posted 18 December 2003 - 02:50 PM

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&#58;\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
0

#8 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 18 December 2003 - 04:52 PM

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&#58;\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?
0

#9 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 18 December 2003 - 04:55 PM

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!

smile

* 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!
0

#10 User is offline   ViolentGreen 

  • addict
  • Group: Members
  • Posts: 557
  • Joined: 28-March 03

Posted 18 December 2003 - 07:13 PM

Quote:
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&#58;\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?[/quote]

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


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

#11 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 18 December 2003 - 08:21 PM

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
0

#12 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 18 December 2003 - 09:10 PM

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?
0

#13 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 19 December 2003 - 02:39 AM

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
0

#14 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 19 December 2003 - 04:20 PM

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.
0

#15 User is offline   jmmijo 

  • veteran
  • Group: Members
  • Posts: 1550
  • Joined: 29-May 02

Posted 20 December 2003 - 07:40 PM

@Lotus and APK,

I've copied the APK Ping into the LeechMeNow folder. Have fun smile
0

#16 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 23 December 2003 - 07:05 PM

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!
0

#17 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 23 December 2003 - 09:03 PM

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
0

#18 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 23 December 2003 - 10:40 PM

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!
0

#19 User is offline   Lotus 

  • enthusiast
  • Group: Members
  • Posts: 286
  • Joined: 17-July 01

Posted 23 December 2003 - 10:48 PM

Also, the video card I am using on this machine is an Intel 82810E.
0

#20 User is offline   jmmijo 

  • veteran
  • Group: Members
  • Posts: 1550
  • Joined: 29-May 02

Posted 24 December 2003 - 05:58 AM

OK, the updates are in the LeechMeNow folder smile
0

Share this topic:


  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users