I am looking for a service that monitors the CPU of a Unix computer (and that can react according to the load) and thought that Monit could do the job but I am in a difficult situation:
I need, according to the CPU load level (>50% / >75% / >95%), different actions. I wrote those lines:
check system $HOST
if cpu > 50% then exec "one.sh"
if cpu > 75% then exec "two.sh"
if cpu > 95% then exec "three.sh"
But when the CPU load is higher than 95%, monit launches the 3 scripts. I want to monit to launches one the 3 scripts, according to the CPU load.
I looked for embedded if with monit but it does not seem to exist. Otherwise it would have been simple.
Do you have any idea how to make it work?
Have a nice day!
Bibio