monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use a Script result for Action


From: Johnny Costello
Subject: Use a Script result for Action
Date: 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?

 

Thanks

 

JC


reply via email to

[Prev in Thread] Current Thread [Next in Thread]