[Top][All Lists]

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

Re: Optionally monitoring, depending on local config?

From: Martin Pala
Subject: Re: Optionally monitoring, depending on local config?
Date: Sun, 26 Sep 2004 19:10:25 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 Debian/1.7.3-1

I think it could be possible to use 'manual' monitoring mode and monit SYSV init script to start service monitoring depending on installed server environment.

For example:

1.) monitrc is common for all servers - services which are not common are defined as 'manual' monitoring mode:

  check process myproc with pidfile /var/run/
    ... (service check definitions) ...
    mode manual

2.) monit SYSV init script is extended by tests which can enable service monitoring in the case that it is installed on the server:

  if test -x /usr/bin/myproc
    echo "Starting myproc monitoring"
    /usr/bin/monit monitor myproc > /dev/null

Note that monit daemon must be started already - the command 'monit monitor myproc' instructs the running monit daemon to enable monitoring of myproc service.

In manual monitoring mode will Monit not start monitoring automaticaly => you can use simple test for existence of monitored daemons binaries and enable monitoring explicitly in the case that it is found.

This way you can have common monitrc configuration file and common SYSV init script for all machines.

Another option could be to use monit service dependencies and existence file test. However, existence test has hardcoded default action currently => to support this directly, monit configuration file parser needs to be extended little bit (the modification is quite simple).


Bryan K. Wright wrote:
Hi folks,

address@hidden said:

Why not simply do something like this at the end of the monit conf

include /etc/monitrc.d/*

        That's an option I considered, but I manage around 150 machines
and I'd like to just push out monit (with a standard config file) onto
them without having to configure each machine individually.  I do nightly
automated updates on the machines, so it'd be trivial to turn on monit
on all of them at once if I could come up with a general-purpose
configuration file.

Another option would be to write a script that creates a tailored monitrc for each node. That's probably the route I'll go if I decide to pursue monit (and if there's no way to write a general-purpose monitrc file).


reply via email to

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