Service Monitor could be better

haywardweb

Verified User
Joined
Jan 12, 2005
Messages
21
Location
WA
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.

PHP:
#!/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("[email protected]","httpd restart","httpd was auto-restarted from $_SERVER[PHP_SELF].","From: Server <[email protected]>\n\r",'[email protected]'); 
 } 
 ?>

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