monit-general
[Top][All Lists]
Advanced

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

Re: Monitoring multiple apps running under a non privileged user


From: Martin Pala
Subject: Re: Monitoring multiple apps running under a non privileged user
Date: Wed, 1 Oct 2014 11:09:05 +0200

You can use the "include" statement:

        include /usr/local/monit.d/*

If you'll split the configuration for the deployed processes to one file per 
process, you'll be to add/remove these include files automatically. You can 
also add check for the "include" directory timestamp ... each time you 
add/remove file from the directory, its mtime is updated, which you can use to 
reload monit automatically:

        check directory monit_includes with path /usr/local/monit.d/
                if changed timestamp then exec "/sbin/restart monit"

Note that if you'll have syntax error in new include file, monit restart 
attempt will kill it, as it will hit the syntax error => in the above exec 
action it'll be safer to use some simple script which will restart monit 
conditionally - check the syntax first (using "monit -t") and restart only if 
there are no problems, otherwise keep running and/or fire alarm.

Regards,
Martin


On 01 Oct 2014, at 00:51, Tim Uckun <address@hidden> wrote:

> I have the following scenario.
> 
> We have multiple web apps owned by the deploy user  and running as the web 
> user.  I would like monit to check each app directory for a monit.conf file 
> (app/config/monit.conf) and process it as the deploy user.  When a new app is 
> deployed I would like monit to notice this and run the config file. When an 
> app is removed I would like monit to notice this and kill the processes 
> started by that app (this is probably too much to ask).
> 
> Obviously running monit via the users cron would do this but I am wondering 
> if it's possible to do this using the daemon mode.
> 
> Cheers.
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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