monit-general
[Top][All Lists]
Advanced

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

Re: monit check that a process does NOT exist


From: Martin Pala
Subject: Re: monit check that a process does NOT exist
Date: Tue, 11 Nov 2014 13:25:55 +0100

Hi,

the correct syntax is:

        if DOES NOT exist then exec "/usr/local/monit-scripts/ruby-daemon.sh 
push_notification stop"

Regards,
Martin



> On 11 Nov 2014, at 13:03, Phil Townes <address@hidden> wrote:
> 
> Hi, I'm using monit 5.10 on Centos 6.4.
> I'm trying to check that a process is NOT running on a server.
> If the process is running I need to stop it.
> 
> I've tried the following monit config:
> 
> # Push Notification - SHOULD NOT BE RUNNING
> check process Push_Notification_Service
>     matching "push_notification.rb"
>       if exist then exec "/usr/local/monit-scripts/ruby-daemon.sh 
> push_notification stop"
> 
> This generates a syntax error:
> Starting monit: /etc/monit.d/must_not_be_running:3: syntax error 'exist'
> 
> Is what I'm trying to do possible?
> 
> For reference, here's the content of /usr/local/monit-scripts/ruby-daemon.sh
> 
> #!/bin/bash
> echo "Asking $1 for $2"
> cd /var/www && RAILS_ENV=production bundle exec rake daemon:$1:$2
> cd - > nul
> 
> Thanks,
> Phil
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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