Thanks Martin, the new feature will be very welcome.
I currently have a number of processes that I need to stop if they are
running.
The "if does not exist" will really simplify my monit config!

Thanks!
Phil

On 12 March 2015 at 11:50, Martin Pala <[email protected]> wrote:

> 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, [email protected] 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
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to