|Subject:||Re: How to monitor a process, which should not run|
|Date:||Thu, 12 Mar 2015 12:27:30 +0000|
you can use "check program" to trigger action if the program exists, something like:
check program myprocess with path "/usr/bin/pgrep mypattern"
if status = 0 then exec "/my/script"
The pgrep returns 0 if some process matched => monit will execute script in such case.
I have also created new feature request for simple native process existence (in addition to existing "if does not exist" statement), so we may implement this in the future: https://bitbucket.org/tildeslash/monit/issue/171/support-if-exists-then-for-testing-that
> On 11 Mar 2015, at 13:47, address@hidden wrote:
> I’m wondering if it is possible to watch for unwanted processes. I need to know, if a process is running, which shouldn’t run.
> Is this possible with monit?
> How would the config look like?
> Kind regards,
> To unsubscribe:
|[Prev in Thread]||Current Thread||[Next in Thread]|