Remstats Home


  About remstats
  Release Notes
  FAQ
  Conventions
  Prerequisites
  Installation
  Configuration
  Configuration Tools
  Servers
  Collectors
  Updater
  Monitors
      alert-monitor
          alerter
          alert-email
          alert-winpopup
      ping-monitor
      topology-monitor
  run-remstats
  CGIs
  do-traceroutes
  Miscellany
  Thank-you
  Index


  Live Data

  Remstats was written by
  Thomas Erskine at the
  CRC in Canada and now
  at SourceWorks.

[Top] [Prev] [Next]

alerter - construct and send alert text

Usage:

Can't locate remstats.pl in @INC (@INC contains: . /usr/lib/remstats/lib /usr/lib/perl5/ /usr/local/lib/perl/5.6.1 /usr/local/share/perl/5.6.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.6.1 /usr/share/perl/5.6.1 /usr/local/lib/site_perl) at ../alerter line 21.

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 /etc/remstats/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 ##MAGICCOOKIES##:

	HOST IP REALRRD WILDPART FIXEDRRD VAR STATUS OLDSTATUS
	VALUE RELATION THRESHOLD START DURATION HOSTDESC RRDDESC 
	NOW TEXTNOW ALERTHOST TOWHO WEBMASTER

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.

Alert-Sending Scripts

These are now easy to write, and in many cases you won't even have to write one. There are two requirements for an alert-sending script:

  1. It must take an address to send to on the command-line, and
  2. It must accept the text on stdin.

E.G. you could use sendmail with no wrapper.


Last updated Tue Apr 16 19:09:15 PDT 2002 by
<thomas.erskine@sourceworks.com>.
[SourceWorks] [Top] [RRDtool]