Next: spong-message-mod-template | Previous: spong-intro | [Table of Contents] | [Index] |
spong-message - send out alerts when there is a problem
spong-message [--debug] [--file filename | --message "detailed message text"] color host service time message
spong-message [--debug] --color|--status color --host hostname --service service --time time --summary "summary message text" [--file filename | --message "detailed message text"]
This program is called by the the spong-server entry elsewhere in this document to send out alerts. The the spong-server entry elsewhere in this document only makes a quick determination for send out alerts. It's only criteria is a change in status of a service. The spong-message make a more thorough determination of transmitting the alerts according to the message rules defined in the the spong.message manpage configuration file. spong-message also has throttling mechanisms to prevent an excessive number of messages from being send within a short amount of time.
The following parameters can be specified on the command line with the accompanying command line parameters.
When spong-message is called, the information passed in the arguments is run through a list of rules which determine who is contacted, when they are contacted and how often. The information is also run through a number of checks to determine if the message should be sent.
A small database in the $SPONGTMP directory is kept so that spong-message can keep track how many pages have been sent, when was the last page sent, etc. These checks help to direct problems to the correct people, and also help to throttle messages when there are wide-spread problems (such as a networking outage).
If you are going to be performing maintenance on a machine, or have standard down time for a machine, you can specify that down time in the spong.hosts file using the down attribute in a %HOSTS variable. If a problem is reported during the time indicated, spong-message will not send any messages.
spong-message also checks for any the acknowledgements|spong-ack entry elsewhere in this document active for a machine. If there an active acknowledgement found for a machine and service, no messages will be sent.
spong-message uses the %HUMANS entries defined in the contacts attributes of the messaging rules of the spong.message manpage to determine who is to be contacted. A list of contacts is generated from all of the message rules that are matched. (See the the spong.message manpage and the spong.hosts manpage documentation for information on the file formats.)
Notification messages are formatted by message templates in the %TEMPLATES
configuration variable in the spong.message
file. The 'DEFAULT' template
is use is no other template is found. Templates override can be defined for any
contact, message module, or a combination of the two. See
the section on MESSAGE TEMPLATES in the spong.message manpage for information on the file format.
spong-message alerts people via the messaging modules that are installed. New messaging functions can be easily created. See the the Message Modules|developer-guide/"MESSAGE MODULES" entry elsewhere in this document section in the Developer Guide.
spong.hosts
defined attributes for two things of important to <spong-message>
1) the hosts that Spong is monitoring (%HOSTS), and 2) the contacts that
are responsible for the various hosts and how to contact them (%HUMANS).
See the spong.hosts manpage for a full description of all of the file formats.
spong.message
file 1) how the messaging rules are to be scanned
($RULES_MATCH), 2) the messaging rules
($MESSAGING_RULES), 3) how to format the
messages being sent (%TEMPLATES).
From spong.hosts
:
Each human that is defined should have name attribute associated with it. name is the name or description of the contact.
To send out any notifications at least messaging attribute must be define for the human. A messaging attribute consists of a message module name as a key and contact information as a value. See the section on EXAMPLES elsewhere in this document for a detailed %HUMANS example.
From spong.message
:
%TEMPLATES
determined how notification message are formatted. A template
format consists a subject and message template strings. Both strings are not
required as some message module will not require a subject or a body. See
$MESSAGING_RULES for the full rules syntax.
From spong.conf
:
spong.conf
,
spong.hosts
,
$SPONGTMP/message-db
,
spong.message
Here are some examples to show you possible configurations.
%HUMANS = ( 'unix-staff' => { 'name' => 'Midrange On-call Staff', 'email' => 'its-unix@school.edu' }, 'georgew' => { 'name' => 'George Wilson', 'email' => 'georgew@school.edu', 'skytel' => '1234567' }, ); %HOSTS = ( 'grad.cs.school.edu' => { services => 'ftp smtp http', 'down' => ["*:05:30-06:30", "0:00:00-04:00" ] }, 'www.school.edu' => { services => 'ftp smtp http' }, );
$RULES_MATCH = 'FIRST-MATCH'; $MESSAGING_RULES = [ { hosts => [ 'gard.cs.school.edu' ], contacts => [ 'unix-staff'], exclude_colors => ['green','yellow'], }, { hosts => ['www.school.edu'], contacts => [ 'georgew:email', { rcpt=>'georgew:skytel', repeat=>900, }, ] }, ]; %TEMPLATES = ( 'DEFAULT' => { subject => 'spong - !!COLOR!! !!HOST!! !!SERVICE!!', body => '!!DATETIME!! !!COLOR!! !!HOST!! !!SERVICE!! !!SUMMARY!!', }, 'email' => { subject => 'spong - !!COLOR!! !!HOST!! !!SERVICE!!', body => 'Host !!HOST!! service has been reported !!COLOR!!. Summary: !!SUMMARY!! Spong Web Page: !!WWWSPONG!! Service Detail Page: !!WWWSPONG!!/service/!!HOST!!/!!SERVICE!! Status event details: !!DETAILED!! ', }, );
To receive pages, you currently must have a pager that can be contacted electronically (via email or web interface).
No know bugs.
the spong-server entry elsewhere in this document, the spong.hosts manpage, the spong.conf manpage, the spong.message manpage, the spong-message-mod-template entry elsewhere in this document, the strftime(3) entry elsewhere in this document
Ed Hill <ed-hill@uiowa.edu
>, Unix System Administrator, The University of
Iowa
Stephen L Johnson <sjohnson@monsters.org
>
Based on code/ideas from Sean MacGuire (BB), and Helen Harrison (Pong). Ed Hill original converted Big Brother (http://www.bb4.com) into Perl which diverged from Big Brother to become Spong. Ed Hill continued Spong development until version 2.1. Stephen L Johnson took over development in October, 1999 with his changes which became Spong 2.5.