* color color of the message (red, yellow, green) * host host having a problem * service service having a problem * time time (in time() format) of the problem * message summary of the problemThe following parameters are optional.
* duration duration of the event in seconds. Default to zero.When spong-message is called, the information passed in is run through a list of rules which determine who is contacted, when they are contactd and how often. the information is also run through a number of checks to determine if the message should be sent. It maintains a little database in the spong tmp directory so that it can keep track of 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 maintainence on a machine, or have standard down time for a machine, you can specify that down time in the spong.hosts file. If a problem is reported during the time indicated, spong-message will not send messages. spong-message also checks for acknowledgements created for a machine. If an active acknowledgement for a machine and service, no messages will be sent.
spong-message using the humans defined in the contact attributes of the messaging rules of spong.mesaage and spong.hosts to determed who is to be contacted. A of contacts is generated from all of the message rules that are matched. The format of thse files is described briefly below, and in more detail in spong.message and spong.hosts.
Currently, spong-message knows how to alert people via the messaging function modules that are installed. More messaging functions can be created. See Message Modules in the Developer Guide.
Each host has one ``human'' contact (actually the contact can be a group of people, or really anything you want). Each human has the following attributes:
Each human that is defined should have the following attributes associated with it:
* name name of the person to contactAnd one or more of the following attributes assigned to each human for messaging when there are problems
* email email address * skytel skytel pager number * alltelsms phone number of a phone subscribered to Alltel Communications SMS service. * teletouch teletouch pager number * teletouch_short teletouch pages numer for small alpha pagersThe messaging attributes are optional, but at least one must be provided in order to the spong-message program to contact the person. The format of the spong.hosts file is described in more detail in spong.hosts.
Each host also has attributes which are of interest to spong-message. Each host can have the following attribute:
* down a list of times the machine is down for repairs.If the spong-message gets told to send a message during this downtime the message will be ignored. This prevents you from being flooded with messages during routine system maintenence.
The spong.message hold the rules that determine who is to be contacted, when and how often.
Each rule should have more of more of the following matching criteria attributes:
* hosts a list of hosts to match* host_groups a list of host groups to match * services a list of services to match * exclude_hosts a list of hosts to exclude * exclude_host_groups a list of hosts groups to exclude * exclude_services a list of services to exclude * times a list of days/times to matchAnd each rule must have the following attributes:* contacts a list of contacts to notifyThe rule alow you to be quite flexible is how your notifications are created. The format if the spong.message if described in more detail in spong.message.
The /usr/local/etc/spong/spong.conf file is also read on startup. This file contains some variables specific to spong-message, and some OS specific variables that are required by spong-message. Here are the variables applicable to the spong-message program.
%HUMANS = ( 'unix-staff' => { name => 'Midrange On-call Staff', email => 'its-unix@school.edu' }, 'edhill' => { name => 'Ed Hill', email => 'ed-hill@school.edu', skytel => '1234567' }, ); %HOSTS = ( 'strobe.weeg.school.edu' => { services => 'ftp smtp http', down => [ "*:05:30-06:30", "0:00:00-04:00 ] }, 'www.school.edu' => { services => 'ftp smtp http', }, ); From spong.message:
$RULES_MATCH = 'FIRST-MATCH';
$MESSAGING_RULES = [
{ hosts => [ 'strobe.weeg.school.edu' ],
contacts => [ 'unix-staff'],
},
{ hosts => ['www.school.edu'],
contacts => [ 'edhill:email', { rcpt=>'edhill:pager', repeat=>900, }, ],
},
];
To receive pages, you currently must have a pager that can be contacted electronically (via email or web interface).
The $MESSAGES_PER_HOUR check does not always work correctly.
The syntax of the contact attribute in spong.message
has changed. The check logic will have to be enhance to be able to check
for mulitple forms of the contact.
Based on code/ideas from Sean MacGuire (BB), and Helen Harrison (Pong).