On Mon, 20 May 2002, kyle wrote:

> etc..So, is there a way for me to do an include where we have something
> like:

mon supports automatic pre-processing of config files with m4 if you
either append ".m4" to the end of the filename or if you start the server
with the "-M" option. since gnu m4 has builtin macro for including files,
then yes, there is a way for you to do an include.

mon.m4:

watch www
    include(core-checks.m4)dnl
    service http
    description http check - unique to the www hostgroup
    interval 5m
    monitor http.monitor

etc.

keep in mind the search path for m4's "include" will be "/" unless you
change it by exporting the M4PATH environment variable before you start
the mon server.


> Is anything like this currently implemented? Also, anyway to also include
> a hostlist from a mysql database or at least from a file list or dbm
> file? I have one hostgroup which has approx. 500 hosts!

> This doable? Something like this in place?

gnu m4 has a builtin called "esyscmd" which allows you to run an external
program and include its output into the m4 output.  i'd suggest writing a
small program which will extract your host groups from whatever source and
send a formatted mon config file chunk to stdout, and simply incorporate
that into your main config via m4's "esyscmd".

> I've been looking at mon and netsaint, but netsaint is not
> doing it for me(spent the past 2 weeks testing netsaint)

whatever makes you happy :)


Reply via email to