PDA

View Full Version : Service Monitor could be better



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

jmstacey
05-11-2005, 06:20 PM
Maybe if the service monitor called editable files. That would allow you to make any customizations to the way the service monitor checks for service status aswell as what to do when certain conditions are detected.

redeye
06-05-2005, 06:28 AM
Got something for mysql allready?

jmstacey
06-05-2005, 09:29 PM
I don't think DirectAdmin's service monitor has changed in that respect. However you could always disable monitoring of MySQL by DirectAdmin an make your own custom MySQL monitor using cron such as in the example provided here:
http://help.directadmin.com/item.php?id=64

redeye
06-06-2005, 04:21 AM
Thx, i should check the helpfiles more often ;)