NAME

  mk-dmon-work - generate dmon work-files


SYNOPSIS

  Usage: mk-dmon-work [-v] [-q] [-d] [-f] [-h] [-l] [-w conf] [-c conf]
  option v : be verbose
  option q : be quiet
  option d : show debug info
  option f : action ; otherwise dry-run
  option h : show help ; exit
  option l : show item-list ; exit
             default : show : item-name
             with -v : show : item-name kind probe default-args
             with -d : show as json object
  option w : use work-config file <conf> ;
             default [ work.conf, /etc/dmon/work ]
  option c : use dmon-config file <conf> ;
             default [ dmon.conf, /etc/dmon/conf ]


DESCRIPTION

Program mk-dmon-work reads a work-config file and generates a work-file for the dmon-server, each dmon-client and the dmon-pagemaker.

The work-config-file is described below ; see WORK.CONF.

The work-files are generated into a staging directory (note the .tmp) :

  /var/dmon/works.tmp/

If -f is specified, mk-dmon-work rsyncs (preserving timestamps) into :

  /var/dmon/works.tmp/ => /var/dmon/works/

Note : rsync uses -c --no-t, copying only files with a changed checksum, and preserving last-change time-stamps on others.

The last-change time-stamps on work-files matter ; dmon assumes that a newer file indicates updated content.

On startup, a dmon-client issues a WORK-command to the server, which responds with a work-file-text and a last-modified timestamp.

Later, periodicly (default every 10 minutes), the client examines the last-modified timestamp of the client's work-file on the server. The timestamp is sent be the server in response to a client's REPORT command. If that is not available, the client issues a WORK_LM command to the server, which responds with the client's work-file timestamp. If the timestamp has changed, the client reloads itself.


OPTIONS

-q

be quiet

-v

be verbose

-d

show debug info ; internals

-h

show help ; exit

-l

show the list of item-names, one name per line ; then exit. With -v, also show the item's probe and default probe-arguments. With -d, show all items as a JSON-object.

-w

use work-config conf ; default : work.conf, /etc/dmon/work

-c

use dmon-config conf ; default : dmon.conf, /etc/dmon/conf


WORK.CONF

location

The default locations of the config file are :

format

A work-config file looks like this :

  +--------------------------------------------------
  |# lines that start with '#' are comment
  |# blank lines are ignored too
  |# tabs are replaced by a space
  |
  |# the config entries are 'keyword' and 'value' pairs
  |# a 'keyword' begins in column 1
  |# the 'value' is the rest of the line
  |somekey  part1 part2 part3 ...
  |otherkey part1 part2 part3 ...
  |
  |# indented lines are glued
  |# the next three lines mean 'somekey part1 part2 part3'
  |somekey part1
  |  part2
  |  part3
  +--------------------------------------------------

notation

In the sections below, we use the following notation :

usage

The main purpose of the work-config is to specify which items each host must monitor.

There are many items and usually there are many hosts, so a plain (host,item)-list would be very long. To condense the list, we use grouping of hosts and items.

  hosts linux_hosts host1 host2 host3 ...
  items linux_items cpu_load uptime root_avail root_usage ...

To specify that all linux_hosts must monitor all linux_items you can simply write :

  get @linux_hosts @linux_items

You can build larger groups out of atoms and smaller groups :

  hosts ftpd_servers host1 host2 ...
  hosts http_servers host3 host4 @ftp_servers ...

The host (item) lists are really set-expressions (read '+' as set-union) :

  hosts group-name A B C   
  hosts group-name A + B + C # same thing

Exceptions can be made with operator '' (read as set-subtraction) :

  # all www-servers also serve ftp, except host1, host2
  hosts ftp_servers @www_servers – host1 – host2

In general :

The default operator is '+' :

  A B C   # same as : A + B + C
  A - B C # same as : A - B + C

keywords


LICENSE

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl 5.10.0 README file.


AUTHOR

mk-dmon-work © 2015-2018 Henk P. Penning - All rights reserved ; dmon-0.05-p308 - Thu Oct 4 09:52:57 2018