#1  
Old 3rd March 2010, 21:07
dxh dxh is offline
Junior Member
 
Join Date: Nov 2009
Posts: 14
Thanks: 5
Thanked 0 Times in 0 Posts
Default ispconfig alerting

Does anyone know how I can set up email alerts from ispconfig?
For example if apache stops, could I be alerted via email?
Thanks for reading
Reply With Quote
Sponsored Links
  #2  
Old 4th March 2010, 00:31
BorderAmigos BorderAmigos is offline
Senior Member
 
Join Date: Apr 2008
Location: San Diego & Tijuana
Posts: 302
Thanks: 26
Thanked 33 Times in 31 Posts
Send a message via MSN to BorderAmigos Send a message via Yahoo to BorderAmigos
Default

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.
__________________
System6Hosting.com, ISPConfig 3, Debian.

Last edited by BorderAmigos; 4th March 2010 at 00:43.
Reply With Quote
The Following User Says Thank You to BorderAmigos For This Useful Post:
dxh (4th March 2010)
  #3  
Old 4th March 2010, 01:12
dxh dxh is offline
Junior Member
 
Join Date: Nov 2009
Posts: 14
Thanks: 5
Thanked 0 Times in 0 Posts
 
Default Thanks. Testing now

Thanks for the help. I will test this out.
Reply With Quote
Reply

Bookmarks

Tags
alerts, ispconfig

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPconfig setup - DNS, router and general access problems ingvar Installation/Configuration 6 31st July 2010 13:13
Install a Comodo InstantSSL Certificate for ISPconfig Apache, Postfix, Imap & Pop gwa7 Tips/Tricks/Mods 1 30th September 2009 18:08
Install a Comodo InstantSSL Certificate for ISPconfig Apache, Postfix, Imap & Pop gwa7 Installation/Configuration 0 10th April 2009 04:54
ISPConfig 2.3.1-dev released till General 0 8th May 2006 22:18
SP-Server Setup - Ubuntu 5.10 "Breezy Badger" - Page 6 (changes) LuisC-SM HOWTO-Related Questions 0 21st April 2006 15:16


All times are GMT +2. The time now is 15:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.