monit-general
[Top][All Lists]
Advanced

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

monit check that a process does NOT exist


From: Phil Townes
Subject: monit check that a process does NOT exist
Date: Tue, 11 Nov 2014 12:03:54 +0000

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


reply via email to

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