[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to monitor a process, which should not run
From: |
Martin Pala |
Subject: |
Re: How to monitor a process, which should not run |
Date: |
Thu, 12 Mar 2015 12:50:39 +0100 |
Hello,
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
Regards,
Martin
> On 11 Mar 2015, at 13:47, address@hidden wrote:
>
> Hi,
>
> 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,
>
> Michael
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general