Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st February 2009, 17:52
steve51184 steve51184 is offline
Member
 
Join Date: Mar 2008
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default help modifying check_services.php to run a custom command if any service is down

hi all i need help modifying check_services.php to run a custom command if any service is down

the file i want to run is a php script that sends me an sms and i thought as ispconfig has it's own install of php that even if apache is down i'll get an sms wherever i am in the world.. so how do i edit check_services.php to run the command?
Reply With Quote
Sponsored Links
  #2  
Old 22nd February 2009, 20:10
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,727 Times in 2,565 Posts
Default

You can specify a command in the ISPConfig interface (Management > Server > Services > Monitoring).
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 22nd February 2009, 20:24
steve51184 steve51184 is offline
Member
 
Join Date: Mar 2008
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

is that in the "Offline" bit?

also this is the command i'm trying to run but it won't work as it has special characters like the &

Code:
/root/ispconfig/php/php "/var/www/web1/web/sms/index.php?sendto=1&message=xxx&submit=Submit" &> /dev/null
also i've tried with and without the "

Last edited by steve51184; 22nd February 2009 at 20:37.
Reply With Quote
  #4  
Old 23rd February 2009, 00:53
steve51184 steve51184 is offline
Member
 
Join Date: Mar 2008
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

any ideas falko?
Reply With Quote
  #5  
Old 23rd February 2009, 18:43
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,727 Times in 2,565 Posts
Default

In that case I suggest you install monit: http://www.howtoforge.com/server_mon...debian_etch_p2
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 23rd February 2009, 19:31
steve51184 steve51184 is offline
Member
 
Join Date: Mar 2008
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

monit sounds cool but how is this any different from the service monitoring that ispconfig or even webmin has built in?

also i'm wanting to run that above command if/when a service is down and as far as i know monit won't do that but ispconfig will
Reply With Quote
  #7  
Old 7th March 2009, 13:19
id10t id10t is offline
Senior Member
 
Join Date: Nov 2008
Posts: 240
Thanks: 2
Thanked 22 Times in 22 Posts
Default

Of course, ISPConfig may be down as well.

I would take a look at the check service php file in ISPConfig, and make a copy of it to work on. Then modify to check services and ispconfig up, send mail/sms/etc, and make it run under PHP cli. Then schedule as a cron job.
Reply With Quote
  #8  
Old 7th March 2009, 13:21
steve51184 steve51184 is offline
Member
 
Join Date: Mar 2008
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

how do i run a a php script via php cli and will it work if apache2 is down?
Reply With Quote
  #9  
Old 8th March 2009, 15:38
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,727 Times in 2,565 Posts
Default

Quote:
Originally Posted by steve51184 View Post
how do i run a a php script via php cli
Code:
php /path/to/php-script
Quote:
Originally Posted by steve51184 View Post
and will it work if apache2 is down?
How do you mean that?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 8th March 2009, 19:12
steve51184 steve51184 is offline
Member
 
Join Date: Mar 2008
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by falko View Post
Code:
php /path/to/php-script
How do you mean that?
well i'm wanting to run a php script that will sms me if apache2 goes down so i'm asking can i still use php if apache is down... that why i was originally wanting to use ispconfigs copy of php
Reply With Quote
Reply

Bookmarks

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
dns server error Hellbound General 7 2nd August 2007 09:18
Email not going out! cybereatl Installation/Configuration 12 28th February 2007 14:02
This is %#@*&^$# embarrassing! domino Smalltalk 34 5th February 2007 21:57
UebiMiau login puntjuh Installation/Configuration 13 14th March 2006 18:24


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


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