LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-09-2013, 04:23 AM   #1
circus78
Member
 
Registered: Dec 2011
Posts: 273

Rep: Reputation: Disabled
Question about monit


Hi,
I've some problem with monit and Apache process.
My monitrc config is:

Quote:
set daemon 60
set logfile syslog facility log_daemon
check process apache2 with pidfile /var/run/apache2.pid
start program = "/root/scripts/apache.sh start"
stop program = "/root/scripts/apache.sh stop"
if failed host website.com port 80 protocol http
and request "/index.html"
then restart
when Apache died, it seems that only "stop" script is executed, not start!

/root/scripts/apache.sh is:

Quote:
case "$1" in
start)
/etc/init.d/apache2 start

;;
stop)
/etc/init.d/apache2 stop

;;
*)
;;
esac

exit 0
How can I solve this issue?
Thank you
 
Old 08-09-2013, 07:59 AM   #2
bijanshr
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Rep: Reputation: Disabled
restart is missing in the script
restart)
$0 stop
$0 start
;;
 
Old 08-09-2013, 08:57 AM   #3
circus78
Member
 
Registered: Dec 2011
Posts: 273

Original Poster
Rep: Reputation: Disabled
This is an example (from monit documentation):

Quote:
# check process apache with pidfile /usr/local/apache/logs/httpd.pid
# start program = "/etc/init.d/httpd start"
# stop program = "/etc/init.d/httpd stop"
# if cpu > 60% for 2 cycles then alert
# if cpu > 80% for 5 cycles then restart
# if totalmem > 200.0 MB for 5 cycles then restart
# if children > 250 then restart
# if loadavg(5min) greater than 10 for 8 cycles then stop
# if failed host www.tildeslash.com port 80 protocol http
# and request "/monit/doc/next.php"
# then restart
# if failed port 443 type tcpssl protocol http
# with timeout 15 seconds
# then restart
# if 3 restarts within 5 cycles then timeout
# depends on apache_bin
# group server
there is no reference to "restart" program/condition in any example
 
Old 08-09-2013, 09:33 AM   #4
bijanshr
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Rep: Reputation: Disabled
did you take a look at this,
http://mmonit.com/wiki/Monit/MonitorApacheStatus
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed connect monit-5.5-1 to M/monit 3.0_beta1 shams2222 Linux - Server 2 06-16-2013 01:06 PM
Monit Tool saran_redhat Linux - Newbie 2 03-01-2011 10:31 AM
Monit grob115 Linux - Server 3 02-28-2010 06:53 AM
Monit parameters linuxfia Linux - Software 8 06-04-2009 10:55 AM
Monit and Mysql bichonfrise74 Linux - Newbie 2 05-04-2009 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration