  An_mont is a monitoring package. It consists of ant_mon, which controls
all, and ant_agent, which collects data and sent it to ant_mon.

  ant_mon reads mon.conf configuration file. Format is:

<keyword> <value>

  Comments are started with #, empty lines are allowed, leading spaces
are ignored.
  Config file describes sensors. Each sensor has name, address, and
value. Value is float. If value is in allowed interval, then sensor is
'good'. If value goes out of interval, it still is marked as good,
untill count of fails wont reach specified number. Then sensor is
marked as 'bad'.
  Bad sensor may return to good state, but its value must return to
the 'ret_interval' (it may be narrower, than allowed interval) and to
stay in till count of good ckecks wont reach specified number.
  All sensor values are gotten from agents (ant_agent). They get
values from modules. Each module has name and can collect data for
many sensors. So sensor name include module name and its own name.

All keywords except 'addresses', 'names', 'addr_set', 'name_set',
'var', 'action', 'defaults' and some others set value of according sensor
parameter. Setted value will be reproduced on all following sensors,
until it will be canceled by new according instruction or 'defaults'
keyword. 

Here are all keywords in config file:

heads <str>
      - list of all head monitors in the monitoring system (at least
        current server must be present)

topo <str>
     - path, contained all head servers (may be many times each). Any
       server in path will ping the next server. Servers must be
       written as numbers (indexes from 'heads' field, from 1).
       E.g.:
              heads serv1 serv2 serv3
              topo 1 2 3 2
       This means, that serv1 will ping serv2, serv2 and serv3 will
       ping each other.

port <str>
     - port to connect to agents

head_port <str>
     - port to connect to head monitors

addr <str>
     - set address of following parameters (used in 'names', 'name_set')

on_head_death <str>
     - action on death of any head server, which pings me. In 'topo'
       example, if serv2 fails, serv1 and serv3 do action, if serv3
       fails, serv3 does, and if serv1 fails nobody will act.

on_any_head_death <str>
     - action on death of ANY head server. Information about death of
       a server is sending to the rest and all head servers can do
       something on this event.

head_tmout <int>
     - timeout in seconds of head servers. Do NOT set it less than head_ping,
       best choice would be head_ping*3

head_ping <int>
     - interval in seconds between pings of head servers

name <str>
     - set name of following parameters. name MUST be in
       format: mod_name mod_arg1 ... mod_argN param_name
       module arguments may be ommitted (mod_name:param_name)
       (used in addr_set)

out_name <str>
     - set associated name

log_level <int>
     - log level. This is a sum of following numbers:
       1   - warnings and errors
       2   - debug messages
       4   - deep debug messages (not recommended)
       8   - config loading
       16  - network communications
       32  - extern modules communications
       64  - sensors events
       128 - misc info

interval <int>
     - set check interval

tmout <int>
     - set timeout priod

interval_tmout <int>
     - set check interval for timed out entries

recon_interval <int>
     - set check interval to reconnect to disconnected agents

recon_tmout <int>
     - timeout for reconnection to disconnected agents
       (when all params on this agent will be 'timed out')

bad_count <int>
     - set number of bad ckecks to mark sensor as bad

ret_count <int>
     - set number of good checks to mark sensor as good

min <float>
     - set minimal value

max <float>
     - set maximal value

min_ret <float>
     - set minimal value to return in good state

max_ret <float>
     - set maximal value to return in good state

mons <str>
     - list of head servers, which can monitor this parameter (one at
       least must be specified). If first server fails second starts
       monitor it, if second fails third will be, and so on...
       It MUST be just servers indexes - 1,2,3...

on_good <str>
     - list of action names (see 'action') via space. These actions
       will be activated if sensor IS in good state

on_bad <str>
     - list of action names (see 'action') via space. These actions
       will be activated if sensor IS in bad state

on_single_good <str>
     - list of action names (see 'action') via space. These actions
       will be activated if sensor is in bad state, but good value is
       received

on_single_bad <str>
     - list of action names (see 'action') via space. These actions
       will be activated if sensor IS in good state, but badd value is
       received

on_fail <str>
     - list of action names (see 'action') via space. These actions
       will be activated if sensor is being marked bad

on_ret <str>
     - list of action names (see 'action') via space. These actions
       will be activated if sensor is being marked good

on_tmout <str>
     - list of action names (see 'action') via space. These actions
       will be activated if sensor is timed out

defaults
     - resets all sensor parameters to defaults

on_conn <str>
     - list of action names via space. These actions will be activated
       if connection to host agent was established.
       These actions are GLOBAL (not associated with ensor). Only
       varaibles valid in action templates: name, out_name (=name),
       addr (=name), state (Connected,Disconnected), num_state
       (0-conn,1-disconn), enabled, date, time.

on_conn_err <str>
     - list of action names via space. These actions will be activated
       if connection to host agent was failed. See 'on_conn' for notes.

addr_set <str>
     - list via spaces of addresses. Creates a set of sensors, which
       are described by above instructions with only different
       addresses (they all will have the same names)
       (see 'names')

name_set <str>
      - list via ';' of sensor names. See name instuction. Creates a
        set of sensors, which are described by above instructions with
        only different names (they all will have the same addresses)
        NOTE that ';' must be placed JUST AFTER sensor name. Without
        spaces.
        (see 'addr')

addresses <str>
     - list via spaces of addresses. These addreses will be remembered
       and will produce sensors when 'names' instruction will be met

names <str>
     - list via ';' of sensor names. Creates a set of sensors. Each
       name will create a set of sensors with addresses, specified in
       'addresses' instruction. If there was no 'addresses'
       instruction, then no sensors will be created (and no warning
       will be printed!)

var <str> <str>
    - describes a variable, which may be used later in action
      template. First agument is variable name, second is the
      value. You cannot change this value in runtime.

act_line <str>
    - defines action template line.
      This line may contain variables ans '\n','\t',\r' symbols. It
      will be attached to following actions. When action will be
      activated, this line will be sent to the action module with all
      variales and symbols substituted.
      NOTE that '\n' is standard delimiter in Ant server-actionmodule
      protocol, so if you use it, you must properly handle it in module.

      Template can contain following variables:
        addr               address
        name               name
        out_name           associated name
        state              state
        num_state          numerical state
                           (0=active,1=min-fail,2=max=fail,3=dep-fail,
                           4=timeout,5=no-value,10=disabled)
        id                 internal id
        value              current value
        min                min
        max                max
        min_ret            min ret value
        max_ret            max ret value
        bad_count          count to be failed
        bad_count_cur      current count of bads
        ret_count          count to be good
        ret_count_cur      current count of goods
        interval           check interval
        timeout            timeout interval
        time               current time in unix format

      any user variable, defined vy 'var' instruction may be used
      also.

action <str> <str> [... <str>]
    - defines an action.
      First argument is action name (see on_* instuctions). The rest
      arguments are action module name and its parameters. By default
      all modules are in current directory.


  Ant_mon handles two signals:
    SIG_USR1 - dump file /tmp/ant_mon.dump. This file describes internal state
               of most server components.
    SIG_HUP  - config file reload.