clear this doubt please...urgent

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
sweetraskels
Forum Newbie
Posts: 3
Joined: Sun Nov 12, 2006 11:22 pm

clear this doubt please...urgent

Post by sweetraskels »

hi ..
how to find the status of a website to know if the website is live or if the website has failed.

the site is a PHP site that runs against a MySQL database. Each day, a backup routine runs to store this content on tape. Once in a while, this backup routine seems to shut down the MySQL service, but not restart the service. So the page fails.


is there a way to run a script on a local workstation that checks once an hour (or every 30 minutes) the content of a site to see if is properly rendering. If there is a problem, the script should generate an email to the project leader responsible for that project.

is there a way to do this..?

if so please tell me
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

simple.

Code: Select all

$file = @file_get_contents('http://php.net/');

if (!$file) {
   mail = mail(...);
}
To automate the process, consider searching for "cron tab", or "task scheduler"
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

You could also set up a cron script on the MySQL server that ensures that the server is always up. You could also look at getting a less volatile backup procedure (hot backup, anyone?)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

To see if it's "rendering" correctly you'd want to run some sort of diff. I've never had an issue with a bit of human involvement here. It's quite common for large companies (at least ones I used to support) to have a daily set of human checks to test various aspects of a website.
sweetraskels
Forum Newbie
Posts: 3
Joined: Sun Nov 12, 2006 11:22 pm

am new

Post by sweetraskels »

hi..

thanks for your help..

but u know am new to this php

i cnt get what is cron script or smething of tat sort

can you explain me in detail as how to do

and where to do
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

sweetraskels
Forum Newbie
Posts: 3
Joined: Sun Nov 12, 2006 11:22 pm

urgent

Post by sweetraskels »

hi am using Windows 2003 server
and not linux
now wat to do
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

google icron.
User avatar
theFool
Forum Newbie
Posts: 17
Joined: Thu Oct 26, 2006 2:00 am
Location: Berlin, DE

Post by theFool »

For windows server 2003 you can use the build-in task scheduler, too.

here is a small tutorial to start with:
http://www.iopus.com/guides/winscheduler.htm
Post Reply