[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how exec a command
From: |
monitml |
Subject: |
how exec a command |
Date: |
Wed, 12 Nov 2014 17:01:08 +0100 |
User-agent: |
SquirrelMail/1.4.21 |
Howdy, I try to add an option to send (exactly the output of top by
email), so I've added that line:
if cpu > 75% for 2 cycles then exec "/bin/bash -c top -bn1 | mail -s top
address@hidden"
as below (but does not run)
any idea?
thanks!
Pol
# APACHE
check process apache with pidfile /var/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 # 10minutes
if cpu > 1% for 2 cycles then exec "/bin/bash -c top -bn1 | mail -s
top address@hidden"
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 192.168.1.212 port 80 protocol http
and request "/monit/token"
then restart
- how exec a command,
monitml <=