monit-general
[Top][All Lists]
Advanced

[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:

--8<--
  check process myproc with pidfile /var/run/myproc.pid
    ... (service check definitions) ...
    mode manual
--8<--


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

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

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).


Cheers,
Martin



Bryan K. Wright wrote:
Hi folks,

address@hidden said:

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


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).

                                                Thanks,
                                                Bryan





reply via email to

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