The init.d script handles the creation of the PID file, so I would look
there.

Ryan Hall
(407) 852-8487


On Mon, Jun 30, 2014 at 1:10 PM, Bruce MacKenzie <[email protected]> wrote:

> ubuntu
> check process apache with pidfile /run/apache2.pid start program =
> "/etc/init.d/apache2 start" with timeout 60 seconds stop program =
> "/etc/init.d/apache2 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
>
>  check process sshd with pidfile /var/run/sshd.pid
>  start program "/etc/init.d/ssh start"
>  stop program "/etc/init.d/ssh stop"
>  if failed host 127.0.0.1 port 22 protocol ssh then restart
>  if 5 restarts within 5 cycles then timeout
>
> CentOS 6
>
> check process apache with pidfile /var/run/httpd/httpd.pid
>     start program = "/etc/init.d/httpd start" with timeout 60 seconds
>     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
>
> check process sshd with pidfile /var/run/sshd.pid
>  start program "/etc/init.d/sshd start"
>  stop program "/etc/init.d/sshd stop"
>  if failed host 127.0.0.1 port 22 protocol ssh then restart
>  if 5 restarts within 5 cycles then timeout
>
> CentOS 5
>
>  check process apache with pidfile /var/run/httpd.pid
>     start program = "/etc/init.d/httpd start" with timeout 60 seconds
>     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
>
> check process sshd with pidfile /var/run/sshd.pid
>  start program "/etc/init.d/sshd start"
>  stop program "/etc/init.d/sshd stop"
>  if failed host 127.0.0.1 port 22 protocol ssh then restart
>  if 5 restarts within 5 cycles then timeout
>
> One thing I’ve noticed because I’ll watch on the server as mmonit does
> it’s thing. When it works correctly the PID doesn’t go away the number just
> changes. On the process’ that fail the PID disappears from the place it
> should be.
>
>
> Bruce
> [email protected]
>
>
>
> On Jun 30, 2014, at 9:57 AM, Paul Theodoropoulos <[email protected]>
> wrote:
>
>  Can you share the relevant monit conf files?
>
>  On 6/30/14 9:41 AM, Bruce MacKenzie wrote:
>
> Hello. I’m testing on ubuntu and CentOS 5&6. On the ubuntu server everything 
> works fine. Start, stop, restart from mmonit, On the server stopping the 
> service prompts mmonit to start, restart on the server records a change in 
> PID for apache, mysql and ssh.
> On CentOS everything works for ssh. The restart from mmonit for apache and 
> mysql fails. For some reason the service actually does start but the PID 
> isn’t recorded in the expected place. If I do a netstat the PID is listed. I 
> kill it then have mmonit monitor and it restarts the service.
> Any ideas what I can look at?
>
> Thanks
> [email protected]
>
>
>
>
> --
> To unsubscribe:https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
> --
> Paul Theodoropouloswww.anastrophe.com
>
>  --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to