Remstats Home


  About remstats
  Release Notes
  FAQ
  Conventions
  Prerequisites
  Installation
  Configuration
  Configuration Tools
  Servers
  Collectors
  Updater
  Monitors
      alerter
  pagemakers
  run-remstats2
  CGIs
  troubleshooting
  do-traceroutes
  Miscellany
      alerter
      availability-report
      convert-config-links
      files
      functions
      genindex
      genmenu
      htmlpod
      lockfile
      podhtml
      podlatex
      podpdf
      remstats-backup
      remstats-cleanup
      remstats-version
      rename-host
      rrd-report
      rt-updater
  Thank-you
  Index


Live Data

Remstats was written by Thomas Erskine at the CRC in Canada and now looking for work.

[Top] [Prev] [Next]

alerter - construct and send alert text

Usage:

alerter version 1.15 from remstats 1.0.13a
usage: alerter [options] args
where options are:
    -d ddd  set debugging output to level 'ddd'
    -h      show this help
    -f fff  use 'fff' as configuration directory [/home/groups/r/re/remstats/etc/config]
The args are documented in alert-monitor; a quick list:
    towho host ip realrrd wildpart var status old_status value relation 
    threshold alertstart duration hostdesc rrddesc webmaster template

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.

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.


[
Top] [Remstats] [SourceWorks] [RRDtool] [SourceForge]
Last updated Fri May 30 13:50:42 PDT 2003 by <terskine@users.sourceforge.net>.