|Use a Script result for Action
|Fri, 2 Dec 2011 13:27:08 -0800
I have a process that I want to monitor . I have a script that checks to see if the Process is responding or if messages are being queued. Depending on if how many messages are in queue I need to respond differently. Normally I would use Nagios for this check but I want to use Monit’s rule based system to do something depending on output.
Is it possible to do something like this
check process my-process with pidfile /var/run/myprocess
start program = "/etc/init.d/my-process start"
stop program = "/etc/init.d/process stop"
if exec “/bin/bash /usr/bin/my-script” == 1 then alert
else if exec “/bin/bash /usr/bin/my-script” == 2 then stop
How can I use the output of my script to start, alert or stop my process?
|[Prev in Thread]
|[Next in Thread]