topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday October 31, 2024, 7:01 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Auto-Ping?  (Read 4244 times)

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Auto-Ping?
« on: March 08, 2012, 03:10 PM »
My search did not yield any useful result, so I apologize if I missed something.  I am not sure if "Auto-Ping" is the right name, but what I am looking for is a way to monitor whether a web site is "up" or "down."

If there is nothing available I will post a request in "Coding Snacks."  Thanks.



rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 2,193
    • View Profile
    • Donate to Member
Re: Auto-Ping?
« Reply #1 on: March 08, 2012, 03:14 PM »

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
Re: Auto-Ping?
« Reply #2 on: March 08, 2012, 10:28 PM »
Try this, it's just a quick butcher of my iFallover script elsewhere.

OK, I've deleted it because it was a complete screwup, my brain certainly was dormant at the time  :-[

However, I will have another up shortly...just one question:

Do you want to check for the existence of the website or the machine it's hosted on?

A ping will show the latter but won't tell you if the website is actually up.

Also, what do you consider necessary criteria for a website to be 'up', eg. Error 404 means a webserver is up but the page you were looking for isn't on it.
« Last Edit: March 10, 2012, 07:50 PM by 4wd »

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
Re: Auto-Ping?
« Reply #3 on: March 10, 2012, 08:39 PM »
OK, as Bullwinkle always said, 'This time for sure!'

The new improved version that seems to work.  Comes with a cast iron executable guarantee*.

It checks for the existence of a website by trying to retrieve the website page at set intervals and changes the SysTray icon accordingly.

If all is well then it will look like this:

2012-03-11_13-23-34.jpg

If the website is down then, (in theory), you'll get a 5 second popup tooltip:

2012-03-11_13-22-18.jpg

The icon will change to a red circle with cross and the tooltip will change to:

2012-03-11_13-23-04.jpg

Explanation of the lines:
1) No connection to the website - this could be because the host machine has died or the webserver program on the host machine is not running.
2) A ping to Google was either OK or not - a failed ping to Google could indicate you have a network problem at your end, (since Google is up most of the time).  If this fails you won't get line 3 - not much point.
3) It passes the website address to http://www.checksite.us and displays the result, this will either be it's down for Everyone or Just You.

Configuration:

2012-03-11_13-24-16.jpg

It'll open the first time the program is run or if you select it from the tray icon menu.

The first connection is attempted at the end of the first elapsed interval after program execution, so until then the SysTray icon will look like the executable icon.

You can put the executable anywhere you like, you can name it anything you like - the config file will be located in the same directory and have the same name, (except extension), as the executable.

Have one for each site and name them accordingly, eg. google.exe, donationcoder.exe, etc.exe

Source, executable, icons, etc in the archive.

* It'll work until the moment you execute it.

Updated: 20120312 - Fixed some typos and added an option for the popup to the config.
« Last Edit: March 12, 2012, 07:27 AM by 4wd, Reason: Updated executable »

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,768
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Auto-Ping?
« Reply #4 on: March 12, 2012, 08:22 PM »
Assuming you have internet access and just want to verify that a certain website is working, you can use other websites such as:

http://isitup.org/
http://isup.me/

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Re: Auto-Ping?
« Reply #5 on: March 13, 2012, 09:39 PM »
Thank you for the assistance.  I will test them out and report back.  :)