HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=19)
-   -   help modifying check_services.php to run a custom command if any service is down (http://www.howtoforge.com/forums/showthread.php?t=31607)

steve51184 21st February 2009 18:52

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?

falko 22nd February 2009 21:10

You can specify a command in the ISPConfig interface (Management > Server > Services > Monitoring).

steve51184 22nd February 2009 21:24

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 "

steve51184 23rd February 2009 01:53

any ideas falko?

falko 23rd February 2009 19:43

In that case I suggest you install monit: http://www.howtoforge.com/server_mon...debian_etch_p2

steve51184 23rd February 2009 20:31

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

id10t 7th March 2009 14:19

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.

steve51184 7th March 2009 14:21

how do i run a a php script via php cli and will it work if apache2 is down?

falko 8th March 2009 16:38

Quote:

Originally Posted by steve51184 (Post 173929)
how do i run a a php script via php cli

Code:

php /path/to/php-script
Quote:

Originally Posted by steve51184 (Post 173929)
and will it work if apache2 is down?

How do you mean that?

steve51184 8th March 2009 20:12

Quote:

Originally Posted by falko (Post 174099)
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


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

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