Thank you very much Martin, it works very well.

I changed it a bit doing:

if swap > 70% then exec "/etc/init.d/httpd restart"

In this way I also receive alert from monit because apache changed pid (in this way I know it was restarted)

Thank you!
Simone
21 marzo 2012 11:41
Hi,

the swap test can be used in the system-wide "check system" only, you can use it like this:

--8<--
check system mymachine
if swap usage > 70% then exec "/usr/bin/monit restart apache"

check process apache with pidfile ...
--8<--

Regards,
Martin



21 marzo 2012 11:38
Hi all,
I'm quite new with monit so I hope you will be able to help me.

I have monit running on my CentOS 5.x and it is checking everything fine. I would like to restart apache if swap usage is > 70%, how to do it?
Have I to put "if swap > 70% then restart" in "check process apache.." or there is a way to restart apache in "check system .."?

Thank you very much,
Simone


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to