NAME

  dmon - a distributed monitor


SYNOPSIS

  Usage: dmon [OPTIONS] [COMMANDS]
  OPTIONS  : [-s] [-q] [-v] [-d] [-h] [-i] [-t] [-c file]
  COMMANDS : stop|start|reload|state
  option s : be silent
  option q : be quiet ; only errors
  option v : be verbose ; show all actions
  option d : show debug info ; internals
  option T : trace ; show all debug info
  option h : show help ; exit
  option t : test config and work ; exit
  option i : interactive ; don't fork the daemon
  option c : use config <file> ; default [dmon.conf,/etc/dmon/conf]


DESCRIPTION

Program dmon provides system monitoring on a collection of hosts. Each host runs dmon as a daemon.

In a few web-pages, dmon shows you :

What the dmon-system does, is determined by a work-config file. It contains (among other things) :

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

The system is distributed in the sense that :


OPTIONS

-s

be silent

-q

be quiet ; only errors

-v

be verbose ; show all actions

-d

show debug info ; internals

-T

trace ; show all debug info

-h

show help ; exit

-t

test config and work ; exit

-i

interactive ; don't fork the daemon

-c

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


CONFIG FILE

location

The default locations of the config file are :

syntax

A 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 'key' and 'value' pairs
  |# a 'key' 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
  +--------------------------------------------------

config file : required entries

server host

Specify the (fully qualified) hostname of the server.

config file : optional entries

hostname host
domain domain

Specify a fully qualified hostname for the client. The default is :

  hostname `hostname`

If `hostname` is not fully qualified (does not contain a dot), dmon attempts to append a a domain-string. If defined, dmon uses config-option domain ; otherwise file /etc/resolv.conf is searched for a search list and the first name found used.

If $hostname resolves to a CNAME, the pointed-to name is used.

Using dmon -t -v tells you which (canonical) $hostname dmon uses.

PORT port

Specify a number ; the default is :

  PORT 22007

The server listens for connections on port $PORT. The client listens for connections on port $PORT+1.

ival_make_state interval-spec

Specify the interval after which the client will compute the next state. The default is (one minute) :

  ival_make_state 1m

An interval-spec can be given in seconds (as in 22 or 22s), minutes [m], hours [h], days [d] and/or weeks [w].

The interval-specs can be combined in any order :

  dw      # a day and a week
  7d+24h  # same thing
  w-0.5h  # a week minus half an hour
  hm6     # 3666 seconds
ival_send_report interval-spec

Specify the interval after which the client will send the next report to the server. The default is :

  ival_send_report 5m
ival_check_work interval-spec

Specify the interval after which the client will request a fresh work-file from the server. The default is :

  ival_check_work 10m
ival_keep_events interval-spec

Specify how long the server must store events. The default is four weeks :

  ival_keep_events 4w

The server cleans up the event-history hourly.

loglvl Silent | Quiet | Terse | Verbose | Debug | Trace

Specify a log-level ; the default is

  loglvl Terse
plot_url url

Script gen-dmon-page generates references to plotter plotter.php as $url ; the default is :

  plot_url /plotter.php

A leading slash is interpreted as the DOCUMENTROOT of the vhost running gen-dmon-page.

rotate num interval-spec

Specify parameters for log rotation ; the default is

  rotate 8 1d

On start-up, and after interval-spec seconds, dmon will rotate its logfile (/var/log/dmon/dmon.log), saving num files.

bindir dir

Specify the directory where the programs live. The default is :

  bindir /usr/sbin

Option $bindir is used by the UPGRADE-facility. The server sends (and the clients installs in) $bindir/dmon.

Option $bindir is ignored by root.

logdir dir

Specify the directory where the logfiles live. The default is :

  logdir /var/log/dmon
vardir dir

Specify a dmon keeps it files. The default is :

  vardir /var/dmon
rundir dir

Specify a run-dir. The default is :

  rundir /var/run/dmon

This is where the daemon keeps its files.

lckdir dir

Specify a lock-dir. The default is :

  rundir /var/lock/subsys
httpdgid group-name | number

There is no default. Specify the group (name or number) under which the httpd is running on the pagemaker.

Gid $httpdgid is used by program users-dmon to make the user-database writable for the http-daemon.

page_sec url

Specify a (https) url ; there is no default.

$page_sec is used on the pagemaker by cgi-script gen-dmon-page to refer to the secure dmon-web-site, where users can login.


Client

Client commands

By default, the clients listens on port 22008 for connections. The client accepts connections from localhost and the server. It expects a command from the list below.

To send a command to the client, use netcat (nc) :

  echo <command> | nc localhost 22007
  echo <command> | nc <client-hostname> 22007


Server

Server commands

By default, the server listens on port 22007 for connections. The server accepts connections from localhost and the clients. It expects a command from the list below.

To send a command to the server, use netcat (nc) :

  echo <command> | nc localhost 22007
  echo <command> | nc <server-hostname> 22007


INSTALL

Requirements

Installation

Installation - server

Installation - client

Installation - pagemaker

The pagemaker must be a dmon-host and a web-server.


PRODUCTION

Here are some tips for using dmon :


SIGNALS

  HUP  : dmon reloads  ; dmon re-reads the config ; re-inits client and server
  USR1 : dmon re-execs ; dmon stops with END { exec $PROGRAM_NAME, @ARGV }


FILES


SEE ALSO

mk-dmon-work, gen-dmon-page, users-dmon


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

dmon © 2015-2016 Henk P. Penning - All rights reserved ; dmon-0.05-p270 - Wed Nov 16 09:15:09 2016