Package: mon
Version: 0.99.2-15
Severity: minor

The following patches arrange the manual page entries in alphabetical
order. This helps reading the options and definitions when consulting
the meaning quickly.

The patches are separate, arranged according to the sections, for easy
review. They can be squeezed into one in final debian/patches/...

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From 3a7146142e0f8049e0621ef9530a942248261a76 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Tue, 20 Oct 2009 09:09:38 +0300
Subject: [PATCH 1/7] doc/mon.8: (OPTIONS): aphabetical order


Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 doc/mon.8 |   49 ++++++++++++++++++++++++++++++++++---------------
 1 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/doc/mon.8 b/doc/mon.8
index da708bf..6f8c27a 100644
--- a/doc/mon.8
+++ b/doc/mon.8
@@ -1,4 +1,3 @@
-.\" $Id: mon.8 1.11 Sat, 18 Aug 2001 15:37:53 -0400 trockij $
 .TH mon 8 "$Date: Sat, 18 Aug 2001 15:37:53 -0400 $" Linux "Parallel Service 
Monitoring Daemon"
 .SH NAME
 mon \- monitor services for availability, sending alarms upon failures.
@@ -53,23 +52,27 @@ a colon.  Non-absolute paths are taken to be relative to the
 base directory
 .RI ( /usr/lib/mon
 by default).
+
+.TP
+.BI \-A\  authfile
+Authentication configuration file. By default this is
+.IR /etc/mon/auth.cf " if the " /etc/mon
+directory exists, or
+.I /usr/lib/mon/auth.cf
+otherwise.
+
 .TP
 .BI \-b\  dir
 Base directory for mon. scriptdir, alertdir, and statedir
 are all relative to this directory unless specified from /.
 Default is
 .IR /usr/lib/mon .
+
 .TP
 .BI \-B\  dir
 Configuration file base directory. All config files are located here, including
 mon.cf, monusers.cf, and auth.cf.
-.TP
-.BI \-A\  authfile
-Authentication configuration file. By default this is
-.IR /etc/mon/auth.cf " if the " /etc/mon
-directory exists, or
-.I /usr/lib/mon/auth.cf
-otherwise.
+
 .TP
 .BI \-c\  file
 Read configuration from
@@ -78,36 +81,44 @@ This defaults to
 .IR /etc/mon/mon.cf " if the " /etc/mon
 directory exists, otherwise to
 .IR /etc/mon.cf .
+
 .TP
 .BI \-d
 Enable debugging mode.
+
 .TP
 .BI \-D\ dir
 Path to state directory.  Default is the first of
 .IR /var/state/mon ", " /var/lib/mon ", and " /usr/lib/mon/state.d
 which exists.
+
 .TP
 .BI \-f
 Fork and run as a daemon process. This is the
 preferred way to run
 .BR mon .
+
 .TP
 .BI \-h
 Print help information.
+
 .TP
 .BI \-i\  secs
 Sleep interval, in seconds. Defaults to 1. This shouldn't need to
 be adjusted for any reason.
+
 .TP
 .BI \-k\  num
 Set log history to a maximum of
 .I num
 entries. Defaults
 to 100.
+
 .TP
 .BI \-l
 Load state from the last saved state file. Currently the only
 supported saved state is disabled watches, services, and hosts.
+
 .TP
 .BI \-L\ dir
 Sets the log dir. See also
@@ -117,6 +128,12 @@ in the configuration file.  The default is
 if that directory exists, otherwise
 .BR log.d
 in the base directory.
+
+.TP
+.BI \-m\  num
+Set the throttle for the maximum number of processes to
+.IR num .
+
 .TP
 .B \-M
 Pre-process the configuration file with the
@@ -125,18 +142,13 @@ macro expansion package
 .\"
 .\"
 .\"
-.TP
-.BI \-m\  num
-Set the throttle for the maximum number of processes to
-.IR num .
+
 .TP
 .BI \-p\  num
 Make server listen on port
 .IR num .
 This defaults to 2583.
-.TP
-.B \-S
-Start with the scheduler stopped.
+
 .TP
 .BI \-P\  pidfile
 Store the server's pid in
@@ -149,12 +161,14 @@ and
 whose directory exists.  An empty value tells
 .B mon
 not to use a pid file.
+
 .TP
 .BI \-r\  delay
 Sets the number of seconds used to randomize the startup delay
 before each service is scheduled. Refer to the global
 .I randstart
 variable in the configuration file.
+
 .TP
 .BI \-s\  dir
 Path to monitor scripts. Default is
@@ -164,6 +178,11 @@ a colon.  Non-absolute paths are taken to be relative to 
the
 base directory
 .RI ( /usr/lib/mon
 by default).
+
+.TP
+.B \-S
+Start with the scheduler stopped.
+
 .TP
 .BI \-v
 Print version information.
-- 
1.6.4.3

>From fcdb104f98a3f3e7679b47c40d9a6fab5b31be5a Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Tue, 20 Oct 2009 09:12:20 +0300
Subject: [PATCH 2/7] doc/mon.8: (ALERT PROGRAMS): aphabetical order


Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 doc/mon.8 |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/doc/mon.8 b/doc/mon.8
index 6f8c27a..5163dd4 100644
--- a/doc/mon.8
+++ b/doc/mon.8
@@ -405,32 +405,40 @@ and
 directories if not specified.  They are invoked with the following command-line
 parameters:
 
-.TP
-.BI \-s\  service
-Service tag from the configuration file.
+
 .TP
 .BI \-g\  group
 Host group name from the configuration file.
+
 .TP
 .BI \-h\  hosts
 The expanded version of the host group, space delimited, but contained
 in one shell "word".
+
 .TP
 .BI \-l\  alertevery
 The number of seconds until the next alarm will be sent.
+
 .TP
 .BI \-O
 This option  is  supplied  to an alert only if the
 alert is being generated as a result of an expected traap timing out
+
+.TP
+.BI \-s\  service
+Service tag from the configuration file.
+
 .TP
 .BI \-t\  time
 The time (in
 .BR time (2)
 format) of when this failure condition
 was detected.
+
 .TP
 .BI \-T
 This option is supplied to an alert only if the alert was triggered by a trap
+
 .TP
 .B \-u
 This option is supplied to an alert only if it is being
-- 
1.6.4.3

>From a5053400c52aff0e8896b6f4c417fee0da8787ba Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Tue, 20 Oct 2009 09:27:38 +0300
Subject: [PATCH 3/7] doc/mon.8: (Global Variables): aphabetical order


Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 doc/mon.8 |  273 ++++++++++++++++++++++++++++++-------------------------------
 1 files changed, 136 insertions(+), 137 deletions(-)

diff --git a/doc/mon.8 b/doc/mon.8
index 5163dd4..619e67e 100644
--- a/doc/mon.8
+++ b/doc/mon.8
@@ -572,53 +572,6 @@ hash is only generated upon startup or after a "reset" 
command, so newly
 added alert scripts will not be recognized until a "reset" is performed.
 
 .TP
-.BI "mondir = " dir
-.I dir
-is the full path to the monitor scripts. This value may also be
-set by the
-.B \-s
-command-line parameter.
-
-Multiple monitor paths may be specified by separating them with
-a colon.  Non-absolute paths are taken to be relative to the
-base directory
-.RI ( /usr/lib/mon
-by default).
-
-When the configuration file is read, all monitors referenced from the
-configuration will be looked up in each of these paths, and the
-full path to the first
-instance of the monitor found is stored in a hash. This hash is only
-generated upon startup or after a "reset" command, so newly added monitor
-scripts will not be recognized until a "reset" is performed.
-
-.TP
-.BI "statedir = " dir
-.I dir
-is the full path to the state directory.
-.B mon
-uses this directory to save various state information.
-
-.TP
-.BI "logdir = " dir
-.I dir
-is the full path to the log directory.
-.B mon
-uses this directory to save various logs, including
-the downtime log.
-
-.TP
-.BI "basedir = " dir
-.I dir
-is the full path for the state, script, and alert directory.
-
-.TP
-.BI "cfbasedir = " dir
-.I dir
-is the full path where all the config files can be found
-(monusers.cf, auth.cf, etc.).
-
-.TP
 .BI "authfile = " file
 .I file
 is the full path to the authentication file.
@@ -663,54 +616,47 @@ global will be used. If no global is given, the PAM
 service will be used.
 
 .TP
-.BI "userfile = " file
-This file is used when
-.B authtype
-is set to
-.IR userfile .
-It consists of a sequence of lines of the format
-.BR "'username : password'" .
-.B password
-is stored as the hash returned by the standard Unix
-crypt(3) function. 
-.B NOTE:
-the format of this file is compatible with the Apache file based
-username/password file format. It is possible to use the
-.I htpasswd
-program supplied with Apache to manage the mon userfile.
-
-Blank lines and lines beginning with # are ignored.
-
-.TP
-.BI "pamservice = " service
-The PAM service used for authentication. This is applicable
-only if "pam" is specified as a parameter to the
-.B authtype
-setting. If this global is not defined, it defaults
-to
-.BR "passwd" .
+.BI "basedir = " dir
+.I dir
+is the full path for the state, script, and alert directory.
 
 .TP
-.BI "snmpport = " portnum
-Set the SNMP port that the server binds to.
+.BI "cfbasedir = " dir
+.I dir
+is the full path where all the config files can be found
+(monusers.cf, auth.cf, etc.).
 
 .TP
-.BI "serverbind = " addr
+.BI "cltimeout = " secs
+Sets the client inactivity timeout to
+.I secs.
+This is meant to help thwart denial of service attacks or
+recover from crashed clients.
+.I secs
+is interpreted as a "1h/1m/1s" string, where
+"1m" = 60 seconds.
 
 .TP
-.BI "trapbind = " addr
+.BI "dep_behavior = " {a|m}
+.B dep_behavior
+controls whether the dependency expression
+suppresses either the running of alerts or monitors
+when a node in the dependency graph fails. Read more
+about the behavior in the "Service Definitions" section
+below.
 
-.B serverbind
-and
-.B trapbind
-specify which address to bind the server and trap ports to, respectively.
-If these are not defined, the default address is INADDR_ANY, which
-allows connections on all interfaces. For security reasons,
-it could be a good idea to bind only to the loopback interface.
+This is a global setting which controls the default
+settings for the service-specified variable.
 
 .TP
-.BI "snmp =" {yes|no}
-Turn on/off SNMP support (currently unimplemented).
+.BI "dep_recur_limit = " depth
+Limit dependency recursion level to
+.IR depth .
+If dependency recursion (dependencies which depend on other dependencies)
+tries to go beyond
+.IR depth ,
+then the recursion is aborted and a messages is logged to syslog.
+The default limit is 10.
 
 .TP
 .BI "dtlogfile = " file
@@ -775,28 +721,12 @@ for a description of
 .IR timeval .
 
 .TP
-.BI "serverport = " port
-.I port
-is the TCP port number that the server should bind to. This value may also be
-set by the
-.B \-p
-command-line parameter. Normally this port is looked up via getservbyname(3),
-and it defaults to 2583.
-
-.TP
-.BI "trapport = " port
-.I port
-is the UDP port number that the trap server should bind to.
-Normally this port is looked up via getservbyname(3),
-and it defaults to 2583.
-
-.TP
-.BI "pidfile = " path
-.I path
-is the file the sever will store its pid in.  This value may also be set
-by the
-.B \-P
-command-line parameter.
+.BI "logdir = " dir
+.I dir
+is the full path to the log directory.
+.B mon
+uses this directory to save various logs, including
+the downtime log.
 
 .TP
 .BI "maxprocs = " num
@@ -809,14 +739,42 @@ configuration file! You don't want to use a garbled 
configuration
 file now, do you?
 
 .TP
-.BI "cltimeout = " secs
-Sets the client inactivity timeout to
-.I secs.
-This is meant to help thwart denial of service attacks or
-recover from crashed clients.
-.I secs
-is interpreted as a "1h/1m/1s" string, where
-"1m" = 60 seconds.
+.BI "mondir = " dir
+.I dir
+is the full path to the monitor scripts. This value may also be
+set by the
+.B \-s
+command-line parameter.
+
+Multiple monitor paths may be specified by separating them with
+a colon.  Non-absolute paths are taken to be relative to the
+base directory
+.RI ( /usr/lib/mon
+by default).
+
+When the configuration file is read, all monitors referenced from the
+configuration will be looked up in each of these paths, and the
+full path to the first
+instance of the monitor found is stored in a hash. This hash is only
+generated upon startup or after a "reset" command, so newly added monitor
+scripts will not be recognized until a "reset" is performed.
+
+.TP
+.BI "pamservice = " service
+The PAM service used for authentication. This is applicable
+only if "pam" is specified as a parameter to the
+.B authtype
+setting. If this global is not defined, it defaults
+to
+.BR "passwd" .
+
+.TP
+.BI "pidfile = " path
+.I path
+is the file the sever will store its pid in.  This value may also be set
+by the
+.B \-P
+command-line parameter.
 
 .TP
 .BI "randstart = " interval
@@ -837,33 +795,33 @@ will be a random number between zero and
 .I randstart
 seconds.
 
+.B serverbind
+and
+.B trapbind
+specify which address to bind the server and trap ports to, respectively.
+If these are not defined, the default address is INADDR_ANY, which
+allows connections on all interfaces. For security reasons,
+it could be a good idea to bind only to the loopback interface.
+
 .TP
-.BI "dep_recur_limit = " depth
-Limit dependency recursion level to
-.IR depth .
-If dependency recursion (dependencies which depend on other dependencies)
-tries to go beyond
-.IR depth ,
-then the recursion is aborted and a messages is logged to syslog.
-The default limit is 10.
+.BI "serverbind = " addr
 
 .TP
-.BI "dep_behavior = " {a|m}
-.B dep_behavior
-controls whether the dependency expression
-suppresses either the running of alerts or monitors
-when a node in the dependency graph fails. Read more
-about the behavior in the "Service Definitions" section
-below.
+.BI "serverport = " port
+.I port
+is the TCP port number that the server should bind to. This value may also be
+set by the
+.B \-p
+command-line parameter. Normally this port is looked up via getservbyname(3),
+and it defaults to 2583.
 
-This is a global setting which controls the default
-settings for the service-specified variable.
+.TP
+.BI "snmp =" {yes|no}
+Turn on/off SNMP support (currently unimplemented).
 
 .TP
-.BI "syslog_facility = " facility
-Specifies the syslog facility used for logging.
-.B daemon
-is the default.
+.BI "snmpport = " portnum
+Set the SNMP port that the server binds to.
 
 .TP
 .BI "startupalerts_on_reset = " {yes|no}
@@ -872,6 +830,47 @@ If set to "yes", startupalerts will be invoked when the
 .B reset
 client command is executed. The default is "no".
 
+.TP
+.BI "statedir = " dir
+.I dir
+is the full path to the state directory.
+.B mon
+uses this directory to save various state information.
+
+.TP
+.BI "syslog_facility = " facility
+Specifies the syslog facility used for logging.
+.B daemon
+is the default.
+
+.TP
+.BI "trapbind = " addr
+
+.TP
+.BI "trapport = " port
+.I port
+is the UDP port number that the trap server should bind to.
+Normally this port is looked up via getservbyname(3),
+and it defaults to 2583.
+
+.TP
+.BI "userfile = " file
+This file is used when
+.B authtype
+is set to
+.IR userfile .
+It consists of a sequence of lines of the format
+.BR "'username : password'" .
+.B password
+is stored as the hash returned by the standard Unix
+crypt(3) function.
+.B NOTE:
+the format of this file is compatible with the Apache file based
+username/password file format. It is possible to use the
+.I htpasswd
+program supplied with Apache to manage the mon userfile.
+
+Blank lines and lines beginning with # are ignored.
 
 .SS "Hostgroup Entries"
 
-- 
1.6.4.3

>From 488fe02da437a677d0123a907e73f5b08f7798ee Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Tue, 20 Oct 2009 09:30:37 +0300
Subject: [PATCH 4/7] doc/mon.8: (ALERT PROGRAMS::env vars): aphabetical order


Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 doc/mon.8 |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/doc/mon.8 b/doc/mon.8
index 619e67e..0887de5 100644
--- a/doc/mon.8
+++ b/doc/mon.8
@@ -289,37 +289,37 @@ the user in the service definition,
 passes certain variables to monitor process.
 
 .TP
-.B MON_LAST_SUMMARY
-The first line of the output from the last time the
-monitor exited.
+.B MON_DESCRIPTION
+The description of this service, as defined in the
+configuration file using the
+.I description
+tag.
 
 .TP
-.B MON_LAST_OUTPUT
-The entire output of the monitor from the last time it
-exited.
+.B MON_DEPEND_STATUS
+The depend status, "o" if dependency failure, "1" otherwise.
+
+.TP
+.B MON_FIRST_FAILURE
+The time(2) of the first time this service failed.
 
 .TP
 .B MON_LAST_FAILURE
 The time(2) of the last failure for this service.
 
 .TP
-.B MON_FIRST_FAILURE
-The time(2) of the first time this service failed.
+.B MON_LAST_OUTPUT
+The entire output of the monitor from the last time it
+exited.
 
 .TP
 .B MON_LAST_SUCCESS
 The time(2) of the last time this service passed.
 
 .TP
-.B MON_DESCRIPTION
-The description of this service, as defined in the
-configuration file using the
-.I description
-tag.
-
-.TP
-.B MON_DEPEND_STATUS
-The depend status, "o" if dependency failure, "1" otherwise.
+.B MON_LAST_SUMMARY
+The first line of the output from the last time the
+monitor exited.
 
 .TP
 .B MON_LOGDIR
-- 
1.6.4.3

>From 4b813bf81e8bd76d4e8f4bd0b1d54aa9928241c2 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Tue, 20 Oct 2009 09:36:00 +0300
Subject: [PATCH 5/7] doc/mon.8: (Service Definitions): aphabetical order


Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 doc/mon.8 |  204 ++++++++++++++++++++++++++++++------------------------------
 1 files changed, 102 insertions(+), 102 deletions(-)

diff --git a/doc/mon.8 b/doc/mon.8
index 0887de5..e439de3 100644
--- a/doc/mon.8
+++ b/doc/mon.8
@@ -914,96 +914,6 @@ traps.
 .SS "Service Definitions"
 
 .TP
-.BI service " servicename"
-A service definition begins with they keyword
-.B service
-followed by a word which is the tag for this service.
-
-The components of a service are an interval, monitor, and
-one or more time period definitions, as defined below.
-
-If a service name of "default" is defined within a watch
-group called "dafault" (see above), then the default/default
-definition will be used for handling unknown mon traps.
-
-.TP
-.BI interval " timeval"
-The keyword
-.B interval
-followed by a time value specifies the frequency that
-a monitor script will be triggered.
-Time values are defined as "30s", "5m", "1h", or "1d",
-meaning 30 seconds, 5 minutes, 1 hour, or 1 day. The numeric portion
-may be a fraction, such as "1.5h" or an hour and a half. This
-format of a time specification will be referred to as
-.IR timeval .
-
-.TP
-.BI failure_interval " timeval"
-Adjusts the polling interval to
-.I timeval
-when the service check is failing. Resets the interval
-to the original when the service succeeds.
-
-.TP
-.BI traptimeout " timeval"
-This keyword takes the same time specification argument as
-.BI interval ,
-and makes the service expect a trap from an external source
-at least that often, else a failure will be registered. This is
-used for a heartbeat-style service.
-
-.TP
-.BI trapduration " timeval"
-If a trap is received, the status of the service the trap was delivered
-to will normally remain constant. If
-.B trapduration
-is specified, the status of the service will remain in a failure
-state for the duration specified by
-.IR timeval ,
-and then it will be reset to "success".
-
-.TP
-.BI randskew " timeval"
-Rather than schedule the monitor script to run at the start of each
-interval, randomly adjust the interval specified by the
-.B interval
-parameter by plus-or-minus
-.B "randskew".
-The skew value is specified as the
-.B interval
-parameter: "30s", "5m", etc...
-For example if
-.B "interval"
-is 1m, and
-.B "randskew"
-is "5s", then
-.I mon
-will schedule the monitor script some time between every
-55 seconds and 65 seconds.
-The intent is to help distribute the load on the server when
-many services are scheduled at the same intervals.
-
-.TP
-.BI monitor " monitor-name [arg...]"
-The keyword
-.B monitor
-followed by a script name and arguments
-specifies the monitor to run when the timer
-expires. Shell-like quoting conventions are
-followed when specifying the arguments to send
-to the monitor script.
-The script is invoked from the directory
-given with the
-.B \-s
-argument, and all following words are supplied
-as arguments to the monitor program, followed by the
-list of hosts in the group referred to by the current watch group.
-If the monitor line ends with ";;" as a separate word,
-the host groups are not appended to the argument list
-when the program is invoked.
-
-.TP
 .B allow_empty_group
 The
 .B allow_empty_group
@@ -1022,18 +932,6 @@ environment variable. It should contain a brief 
description of the
 service, suitable for inclusion in an email or on a web page.
 
 .TP
-.BI exclude_hosts " host [host...]"
-Any hosts listed after
-.B exclude_hosts
-will be excluded from the service check.
-
-.TP
-.BI exclude_period " periodspec"
-Do not run a scheduled monitor during the time
-identified by
-.IR periodspec .
-
-.TP
 .BI depend " dependexpression"
 The
 .B depend
@@ -1085,6 +983,108 @@ will be run. Otherwise, the monitor will not
 be run and the status of the service will remain
 the same.
 
+.TP
+.BI exclude_hosts " host [host...]"
+Any hosts listed after
+.B exclude_hosts
+will be excluded from the service check.
+
+.TP
+.BI exclude_period " periodspec"
+Do not run a scheduled monitor during the time
+identified by
+.IR periodspec .
+
+.TP
+.BI failure_interval " timeval"
+Adjusts the polling interval to
+.I timeval
+when the service check is failing. Resets the interval
+to the original when the service succeeds.
+
+.TP
+.BI interval " timeval"
+The keyword
+.B interval
+followed by a time value specifies the frequency that
+a monitor script will be triggered.
+Time values are defined as "30s", "5m", "1h", or "1d",
+meaning 30 seconds, 5 minutes, 1 hour, or 1 day. The numeric portion
+may be a fraction, such as "1.5h" or an hour and a half. This
+format of a time specification will be referred to as
+.IR timeval .
+
+.TP
+.BI monitor " monitor-name [arg...]"
+The keyword
+.B monitor
+followed by a script name and arguments
+specifies the monitor to run when the timer
+expires. Shell-like quoting conventions are
+followed when specifying the arguments to send
+to the monitor script.
+The script is invoked from the directory
+given with the
+.B \-s
+argument, and all following words are supplied
+as arguments to the monitor program, followed by the
+list of hosts in the group referred to by the current watch group.
+If the monitor line ends with ";;" as a separate word,
+the host groups are not appended to the argument list
+when the program is invoked.
+
+.TP
+.BI randskew " timeval"
+Rather than schedule the monitor script to run at the start of each
+interval, randomly adjust the interval specified by the
+.B interval
+parameter by plus-or-minus
+.B "randskew".
+The skew value is specified as the
+.B interval
+parameter: "30s", "5m", etc...
+For example if
+.B "interval"
+is 1m, and
+.B "randskew"
+is "5s", then
+.I mon
+will schedule the monitor script some time between every
+55 seconds and 65 seconds.
+The intent is to help distribute the load on the server when
+many services are scheduled at the same intervals.
+
+.TP
+.BI service " servicename"
+A service definition begins with they keyword
+.B service
+followed by a word which is the tag for this service.
+
+The components of a service are an interval, monitor, and
+one or more time period definitions, as defined below.
+
+If a service name of "default" is defined within a watch
+group called "dafault" (see above), then the default/default
+definition will be used for handling unknown mon traps.
+
+.TP
+.BI trapduration " timeval"
+If a trap is received, the status of the service the trap was delivered
+to will normally remain constant. If
+.B trapduration
+is specified, the status of the service will remain in a failure
+state for the duration specified by
+.IR timeval ,
+and then it will be reset to "success".
+
+.TP
+.BI traptimeout " timeval"
+This keyword takes the same time specification argument as
+.BI interval ,
+and makes the service expect a trap from an external source
+at least that often, else a failure will be registered. This is
+used for a heartbeat-style service.
+
 .SS "Period Definitions"
 
 Periods are used to define the conditions which
-- 
1.6.4.3

>From c068bf8136901c6b7a3f69305c182d4d29e038ca Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Tue, 20 Oct 2009 09:42:17 +0300
Subject: [PATCH 6/7] doc/mon.8: (Period Definitions): aphabetical order


Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 doc/mon.8 |  197 ++++++++++++++++++++++++++++++-------------------------------
 1 files changed, 98 insertions(+), 99 deletions(-)

diff --git a/doc/mon.8 b/doc/mon.8
index e439de3..fb4ed7c 100644
--- a/doc/mon.8
+++ b/doc/mon.8
@@ -1092,58 +1092,41 @@ should allow alerts
 to be delivered.
 
 .TP
-.BI period " [label:] periodspec"
-A period groups one or more alarms and variables
-which control how often an alert happens when there
-is a failure.
-The
-.B period
-keyword has two forms. The first
-takes an argument which is a
-period specification from Patrick Ryan's
-Time::Period Perl 5 module. Refer to
-"perldoc Time::Period" for more information.
-
-The second form requires a label followed by a period specification, as
-defined above. The label is a tag consisting of an alphabetic character
-or underscore followed by zero or more alphanumerics or underscores
-and ending with a colon. This
-form allows multiple periods with the same period definition. One use
-is to have a period definition which has no
-.B alertafter
+.BI alert " alert [arg...]"
+A period may contain multiple alerts, which are triggered
+upon failure of the service. An alert is specified with
+the
+.B alert
+keyword, followed by an optional
+.B exit
+parameter, and arguments which are interpreted the same as
+the
+.B monitor
+definition, but without the ";;" exception. The
+.B exit
+parameter takes the form of
+.B "exit=x"
 or
-.B alertevery
-parameters for a particular time period, and another
-for the same time period with a different
-set of alerts that does contain those
-parameters.
+.B "exit=x-y"
+and has the effect that the alert is only called if the
+exit status of the monitor script falls within the range
+of the
+.B exit
+parameter. If, for example, the alert line is
+.I "alert exit=10-20 mail.alert mis"
+then
+.I mail-alert
+will only be invoked with
+.I mis
+as its arguments if the monitor
+program's exit value is between 10 and 20. This feature
+allows you to trigger different alerts at different
+severity levels (like when free disk space goes from 8% to 3%).
 
-.TP
-.BI alertevery " timeval [observe_detail]"
-The
-.B alertevery
-keyword (within a
-.B period
-definition) takes the same type of argument as the
-.B interval
-variable, and limits the number of times an alert
-is sent when the service continues to fail.
-For example, if the interval is "1h", then only
-the alerts in the period section will only
-be triggered once every hour. If the
-.B alertevery
-keyword is
-omitted in a period entry, an alert will be sent
-out every time a failure is detected. By default,
-if the summary output of two successive failures changes,
-then the alertevery interval is overridden, and an alert
-will be sent.
-If the string
-"observe_detail" is the last argument, then both the summary
-and detail output lines will be considered when comparing the
-output of successive failures. Please refer to the
-.B "ALERT DECISION LOGIC"
-section for a detailed explanation of how alerts are suppressed.
+See the
+.B "ALERT PROGRAMS"
+section above for a list of the pramaeters mon will pass
+automatically to alert programs.
 
 .TP
 .BI alertafter " num"
@@ -1190,6 +1173,40 @@ of the number of failures noticed within that
 interval.
 
 .TP
+.BI alertevery " timeval [observe_detail]"
+The
+.B alertevery
+keyword (within a
+.B period
+definition) takes the same type of argument as the
+.B interval
+variable, and limits the number of times an alert
+is sent when the service continues to fail.
+For example, if the interval is "1h", then only
+the alerts in the period section will only
+be triggered once every hour. If the
+.B alertevery
+keyword is
+omitted in a period entry, an alert will be sent
+out every time a failure is detected. By default,
+if the summary output of two successive failures changes,
+then the alertevery interval is overridden, and an alert
+will be sent.
+If the string
+"observe_detail" is the last argument, then both the summary
+and detail output lines will be considered when comparing the
+output of successive failures. Please refer to the
+.B "ALERT DECISION LOGIC"
+section for a detailed explanation of how alerts are suppressed.
+
+.TP
+.B "no_comp_alerts"
+
+If this option is specified, then upalerts will be called whenever the
+service state changes from failure to success, rather than only after
+a corresponding "down" alert.
+
+.TP
 .BI numalerts " num"
 
 This variable tells the server to call no more than
@@ -1199,48 +1216,39 @@ failure. The alert counter is kept on a per-period 
basis,
 and is reset upon each success.
 
 .TP
-.B "no_comp_alerts"
-
-If this option is specified, then upalerts will be called whenever the
-service state changes from failure to success, rather than only after
-a corresponding "down" alert.
+.BI period " [label:] periodspec"
+A period groups one or more alarms and variables
+which control how often an alert happens when there
+is a failure.
+The
+.B period
+keyword has two forms. The first
+takes an argument which is a
+period specification from Patrick Ryan's
+Time::Period Perl 5 module. Refer to
+"perldoc Time::Period" for more information.
 
-.TP
-.BI alert " alert [arg...]"
-A period may contain multiple alerts, which are triggered
-upon failure of the service. An alert is specified with
-the
-.B alert
-keyword, followed by an optional
-.B exit
-parameter, and arguments which are interpreted the same as
-the
-.B monitor
-definition, but without the ";;" exception. The
-.B exit
-parameter takes the form of 
-.B "exit=x"
+The second form requires a label followed by a period specification, as
+defined above. The label is a tag consisting of an alphabetic character
+or underscore followed by zero or more alphanumerics or underscores
+and ending with a colon. This
+form allows multiple periods with the same period definition. One use
+is to have a period definition which has no
+.B alertafter
 or
-.B "exit=x-y"
-and has the effect that the alert is only called if the
-exit status of the monitor script falls within the range
-of the
-.B exit
-parameter. If, for example, the alert line is
-.I "alert exit=10-20 mail.alert mis"
-then
-.I mail-alert
-will only be invoked with
-.I mis
-as its arguments if the monitor
-program's exit value is between 10 and 20. This feature
-allows you to trigger different alerts at different
-severity levels (like when free disk space goes from 8% to 3%).
+.B alertevery
+parameters for a particular time period, and another
+for the same time period with a different
+set of alerts that does contain those
+parameters.
 
-See the
-.B "ALERT PROGRAMS"
-section above for a list of the pramaeters mon will pass 
-automatically to alert programs.
+.TP
+.BI startupalert " alert [arg...]"
+A
+.B startupalert
+is only called when the
+.B mon
+server starts execution.
 
 .TP
 .BI upalert " alert [arg...]"
@@ -1263,19 +1271,11 @@ as an upalert. Multiple upalerts may be
 specified for each period definition.
 Set the per-period
 .B no_comp_alerts
-option to 
+option to
 send an upalert regardless if whether or not
 a "down" alert was  sent.
 
 .TP
-.BI startupalert " alert [arg...]"
-A
-.B startupalert
-is only called when the
-.B mon
-server starts execution.
-
-.TP
 .BI upalertafter " timeval"
 The
 .B upalertafter
@@ -1291,7 +1291,6 @@ or equal to the value of this option, an
 .B upalert
 will be called. Use this option to prevent
 upalerts to be called because of "blips" (brief outages).
-
 .SH "AUTHENTICATION CONFIGURATION FILE"
 The file specified by the
 .B authfile
-- 
1.6.4.3

>From b75d21fa517dd60bee09f89c3d78e0073615aa55 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Tue, 20 Oct 2009 09:47:37 +0300
Subject: [PATCH 7/7] doc/mon.8: (ALERT PROGRAM::env vars): aphabetical order


Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 doc/mon.8 |   74 ++++++++++++++++++++++++++++++------------------------------
 1 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/doc/mon.8 b/doc/mon.8
index fb4ed7c..76c0d40 100644
--- a/doc/mon.8
+++ b/doc/mon.8
@@ -453,26 +453,10 @@ variables defined by the user in the service definition, 
in addition
 to the following which are explicitly set by the server:
 
 .TP
-.B MON_LAST_SUMMARY
-The first line of the output from the last time the
-monitor exited.
-
-.TP
-.B MON_LAST_OUTPUT
-The entire output of the monitor from the last time it
-exited.
-
-.TP
-.B MON_LAST_FAILURE
-The time(2) of the last failure for this service.
-
-.TP
-.B MON_FIRST_FAILURE
-The time(2) of the first time this service failed.
-
-.TP
-.B MON_LAST_SUCCESS
-The time(2) of the last time this service passed.
+.B MON_ALERTTYPE
+Has one of the following values: "failure", "up", "startup",
+"trap", or "traptimeout", and signifies the type of alert which
+was triggered.
 
 .TP
 .B MON_DESCRIPTION
@@ -482,33 +466,30 @@ configuration file using the
 tag.
 
 .TP
-.B MON_GROUP
-The watch group which triggered this alarm
+.B MON_FIRST_FAILURE
+The time(2) of the first time this service failed.
 
 .TP
-.B MON_SERVICE
-The service heading which generated this alert
+.B MON_GROUP
+The watch group which triggered this alarm
 
 .TP
-.B MON_RETVAL
-The exit value of the failed monitor program, or return value
-as accepted from a trap.
+.B MON_LAST_FAILURE
+The time(2) of the last failure for this service.
 
 .TP
-.B MON_OPSTATUS
-The operational status of the service.
+.B MON_LAST_OUTPUT
+The entire output of the monitor from the last time it
+exited.
 
 .TP
-.B MON_ALERTTYPE
-Has one of the following values: "failure", "up", "startup",
-"trap", or "traptimeout", and signifies the type of alert which
-was triggered.
+.B MON_LAST_SUCCESS
+The time(2) of the last time this service passed.
 
 .TP
-.B MON_TRAP_INTENDED
-This is only set when an unknown mon trap is received and caught
-by the default/defaut watch/service. This contains colon
-separated entries of the trap's intended watch group and service name.
+.B MON_LAST_SUMMARY
+The first line of the output from the last time the
+monitor exited.
 
 .TP
 .B MON_LOGDIR
@@ -518,12 +499,31 @@ as indicated by the
 global configuration variable.
 
 .TP
+.B MON_OPSTATUS
+The operational status of the service.
+
+.TP
+.B MON_RETVAL
+The exit value of the failed monitor program, or return value
+as accepted from a trap.
+
+.TP
 .B MON_STATEDIR
 The directory where state files should be kept,
 as indicated by the
 .I statedir
 global configuration variable.
 
+.TP
+.B MON_SERVICE
+The service heading which generated this alert
+
+.TP
+.B MON_TRAP_INTENDED
+This is only set when an unknown mon trap is received and caught
+by the default/defaut watch/service. This contains colon
+separated entries of the trap's intended watch group and service name.
+
 .P
 The first line from standard input must be used as a brief summary
 of the problem, normally supplied as the subject line of an email, or
-- 
1.6.4.3

Reply via email to