Results 1 to 4 of 4

Thread: Windows server ping every hour

  1. #1
    Join Date
    Oct 2010
    Posts
    2

    Windows server ping every hour

    Hi I want to create an app that will ping one of our servers and display a message to the end users. server .... is ok, or server .... is down.

    I would like the script to be able to ping the server every hour or so and when the user want to check.

    Thanks

  2. #2
    Join Date
    Feb 2009
    Posts
    32

    Re: Windows server ping every hour

    check the following script and paste on the batch file.
    Code:
    #!/bin/sh
    #
    # pinghosts - ping hosts in /etc/hosts, output is coloured (red=bad). Ver 1.00.
    #
    
    
    for host in `awk '/^[0-9]/ { print $1 }' /etc/hosts`
    do
    	echo "Checking $host: \c"
    	ping $host 1 2>&1 | \
    	   sed 's/.*no answer.*/[31;1m&[0m/;s/.*is alive.*/[32;2m&[0m/'
    done

  3. #3
    Join Date
    Oct 2010
    Posts
    2

    Re: Windows server ping every hour

    HI Thanks for the file.

    I have pasted this into a .bat file but cant get it to work.

    Please can you help?

  4. #4
    Join Date
    Apr 2009
    Posts
    107

    Re: Windows server ping every hour

    I am having an idea of coding that works in python :
    Code:
    import time, tm
    while 1:
    tm.system("echo %s >> c:\\path\\to\\log.txt" % time.asctime())
    tm.system("ping foobar.com >> c:\\path\\to\\log.txt")
    time.sleep(3600)
    Hope it makes some help for you.

Similar Threads

  1. Replies: 4
    Last Post: 11-01-2011, 07:27 PM
  2. Accurate hour-by-hour weather forecast for Windows Mobile
    By Fortunate in forum Portable Devices
    Replies: 6
    Last Post: 17-09-2010, 11:57 PM
  3. Windows 7 64-bit cannot ping or connect to Exchange server
    By Chauncey in forum Networking & Security
    Replies: 5
    Last Post: 05-04-2010, 04:36 PM
  4. Cannot ping Windows server 2008
    By Segvoia in forum Networking & Security
    Replies: 3
    Last Post: 16-07-2009, 06:55 PM
  5. Unable To Ping Outside Windows 2003 Server
    By Rich in forum Windows Server Help
    Replies: 9
    Last Post: 18-07-2008, 01:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,031,358.72608 seconds with 17 queries