Hi,

check the logs to see if the apache cpu test matched. Note that apache usually 
uses fork process model and the real work is done by apache children => you may 
need to use the total cpu test:

        if total cpu > 1% for 2 cycles then exec "/bin/bash -c 'top -bn1 | mail 
-s top [email protected]'"

Regards,
Martin


You can run monit in debug mode (using -v option) to trace the tests ... 

> On 12 Nov 2014, at 18:00, Pol Hallen <[email protected]> wrote:
> 
> Hi Martin, thanks for your reply :-)
> 
> so using:
> 
>> if cpu > 1% for 2 cycles then exec "/bin/bash -c 'top -bn1 | mail -s top
> [email protected]'"
> 
> does not run (within apache) although using same (for example) to check
> percentage of disk:
> 
> if cpu > 1% then exec "/bin/bash -c 'top -bn1 | mail -s top
> [email protected]'"
> 
> runs!
> 
> how investigate about that problem? are "for 2 cycles" a problem?
> 
> thanks
> 
> Pol
> 
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Reply via email to