Both monit and webmin have this capability and can monitor your services. If you don't want to use those you could try this hack for ISPConfig 3.
EDIT: (I had to kill monit and webmin then stop apache2 to test this, it worked.)
In /usr/local/ispconfig/server/mods-available/monitor_core_module.inc.php
Find this code...
Code:
$state = 'error'; // because service is down
}
}
/*
Insert the data into the database
*/
$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
Then add the following code and adjust it to your liking.
Code:
$state = 'error'; // because service is down
}
}
// Begin hack --------------------------
if ($state=='error')
{
$server_error="";
$server_error.= ($data['webserver'] == 0) ? 'Web Server Down! ' : '';
$server_error.= ($data['ftpserver'] == 0) ? 'FTP Server Down! ' : '';
$server_error.= ($data['smtpserver'] == 0) ? 'SMTP Server Down! ' : '';
$server_error.= ($data['pop3server'] == 0) ? 'POP3 Server Down! ' : '';
$server_error.= ($data['imapserver'] == 0) ? 'IMAP Server Down! ' : '';
$server_error.= ($data['bindserver'] == 0) ? 'DNS Server Down! ' : '';
$server_error.= ($data['mysqlserver'] == 0) ? 'MySQL Server Down! ' : '';
mail('somebody_who_cares@somewhere.com','Server Down',$server_error);
}
// End hack ----------------------------
/*
Insert the data into the database
*/
$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
This would probably re-send the email every minute as ISPConfig 3 does it's cron so someone may want to improve on it.
Recent comments
1 day 6 hours ago
1 day 6 hours ago
1 day 11 hours ago
1 day 17 hours ago
1 day 18 hours ago
1 day 19 hours ago
2 days 17 min ago
2 days 6 hours ago
2 days 10 hours ago
2 days 12 hours ago