haywardweb
05-11-2005, 04:47 PM
Recently, httpd has frequently been crashing, but the service is still running. What I mean by this is that apache won't serve webpages, but the service is still running.
It would be nice if DA's Service Monitor was more complex. I'd like to see the Service Monitor monitor functionality rather than just existance.
I wrote a script to run with the task queue every minute to solve this problem.
#!/usr/local/bin/php -q
<?php
error_reporting(0);
$file = @file("http://haywardwebdesign.com/scripts/keepup/constant.txt");
if ($file['0'] == "up") {
}
else {
exec('service httpd restart');
mail("tom@haywardwebdesign.com","httpd restart","httpd was auto-restarted from $_SERVER[PHP_SELF].","From: Server <tom@haywardwebdesign.com>\n\r",'-ftom@haywardwebdesign.com');
}
?>
I'm thinking of writing something like this for MySQL also, as I have been having the same problem with that process.
I understand that this will be difficult to do for every process because each process has a unique function, but I'd like to see it at least for web/mail/db/ftp (my top four).
It would be nice if DA's Service Monitor was more complex. I'd like to see the Service Monitor monitor functionality rather than just existance.
I wrote a script to run with the task queue every minute to solve this problem.
#!/usr/local/bin/php -q
<?php
error_reporting(0);
$file = @file("http://haywardwebdesign.com/scripts/keepup/constant.txt");
if ($file['0'] == "up") {
}
else {
exec('service httpd restart');
mail("tom@haywardwebdesign.com","httpd restart","httpd was auto-restarted from $_SERVER[PHP_SELF].","From: Server <tom@haywardwebdesign.com>\n\r",'-ftom@haywardwebdesign.com');
}
?>
I'm thinking of writing something like this for MySQL also, as I have been having the same problem with that process.
I understand that this will be difficult to do for every process because each process has a unique function, but I'd like to see it at least for web/mail/db/ftp (my top four).