Description:
[Alerter
may be rolled into the alert-monitor
at some point in
the future. It was easier to test as a separate program, and the performance
hasn't been an issue for me.]
Alerter
is passed its parameters (specified above) by the alert-monitor.
Most of them are used to fill in information in the text of the alert. The
interesting ones are towho
and template
.
It also reads the alert-destination-map config-file
to decide where the alert needs to go. This will give it a list of (method, address)
pairs.
For a given template-name, say xxx
, and method, say method
, it will
look for files in /home/groups/r/re/remstats/etc/config/alert-templates, called:
method-xxx
method-DEFAULT
xxx
DEFAULT
and take the first one it finds. Similarly, it will look for a header to add to the
top of the template called:
method-HEADER
HEADER
and a footer in one of:
method-FOOTER
FOOTER
The three pieces will be concatenated giving the template text. Then substitutions
will be done for the following magic cookies:
HOST IP REALRRD WILDPART FIXEDRRD VAR STATUS OLDSTATUS
VALUE RELATION THRESHOLD START DURATION HOSTDESC RRDDESC
NOW TEXTNOW ALERTHOST TOWHO WEBMASTER HTMLURL CGIURL HOSTINDEXURL
This gives the alert text. From the method definition in the
alert-destination-map config-file
alerter
knows which program to run to send the alert text to the
appropriate address, and it does it.