Next: todo | Previous: spong.message | [Table of Contents] | [Index] |
spongfaq - frequently asked questions about Spong ($Revision: 1.4 $, $Date: 2001/01/05 20:50:01 $)
This document contains a list of the most Frequently Asked Questions (FAQ) about Spong. It is really not a HOWTO, but is in a classical Question / Answer form.
This is hopefully a simple tool. It does not compete with Tivoli, OpenView, UniCenter, or any other commercial packages, and I have no intention of trying to turn it into one. It is not SNMP based, it communicates via simple TCP based messages. It is written in Perl, so hopefully it can be run on multiple systems
It has the following features:
The spong-server has a bit of security for status update messages. The host name in the status message must match a host name defined in the spong.hosts files. spong-client uses the gethostbyname() function to try to resolve the host's full name. If it just gets the host name without the domain, spong-server will quietly reject and drop the message.
You can run the perl snippet below to determine what host name that spong-client is resolving for the machine it is running on. perl -MSys::Hostname -e \ '($h) = (gethostbyname(Sys::Hostname::hostname()))[0]; print "$h\n"'
It should print out you the fully qualified domain name of your system. This should match the hostname configured in the song.hosts file on the spong-server machine. If they don't match then you can do 1 of 2 things.
In your hosts file make use that the full domain name is the first name of your host's line. i.e. 192.168.2.34 my-host.inkcom.com my-host
Or put if your system is in your DNS server properly, make sure that 'dns' is in front of 'file' on the hosts: line of the /etc/nsswitch.conf file.
There a utility gethost-test in the /utils/
directory of
the Spong distribution. You can run it on a machine to make sure that it
is setup correctly to resolve it's full quality domain name. The utility
is run by enter the following command perl gethost-test
.
If none of the above works or can't make the changes, you still have one last
resort. The spong.conf
and spong.conf.<hostname>
file are loaded
after the $HOST variable is assigned. That mean that you can override the
calculated $HOST hostname. Just added at '$HOST = "desired host name";'
statement in either of the spong.conf
or spong.conf.<hostname>
files.
The most important thing is to go through the the spong.conf manpage, the spong.hosts manpage, and the spong.message manpage configuration files. And be sure to read the documentation for the spong.conf manpage, the spong.hosts manpage the spong.message manpage, configuration files and the the spong-message entry elsewhere in this document and the spong-server entry elsewhere in this document programs.
If you are still having problems, follow the check list below to help resolve your problem.
$MESSAGING_RULES = [ { contacts => [ 'sjohnson' ] }, ];
This will send everything to the 'sjohnson' contact.
%HUMANS = ( 'sjohnson' => { name => 'Stephen Johnson', email => 'stephen.johnson@mailhost.at.my.com', }, );
Run the spong-message program from a command line as follows: spong-message --debug --test color host service `perl -e "print time()"` \ 'This is a test.'
The --debug flag will output a large amount of detailed output about what the program is doing. The --test flag if the test mode flag. Spong-message will do everyting but send out the notifications.
color = status color - green, yellow, or red hostname = a hostname from your spong.hosts file service = a service name that you are testing.
The back-ticked perl expression just prints the current system time in epoch format. And the "The is a test." field is the summary message from a status update message.
The --debug output is very detailed about every step that the spong-message program is doing. You may need to redirect the output to a file in order to look at.
Spong Message will detail step-by-step all of the matched it attempts and the resultsand actions of those matches. It will refer to rules by an index number starting with the number zero (0) for the first rule.
To test days and times ranges your will need to caculate a specific date/time into an epoc or calender time format to feed it to spong-message. You can use this short perl code snippet to do it. perl -MPOSIX -e 'print mktime( sec, min, hour, day, (month - 1) , \ (year - 1900) ), "\n"'
The time is in 24 hour format and the year is the 4 digit year. This will print a large number. Use the number in place of the back-ticked perl expression on spong-message command.
Once you have your single contact / single messaging rule configuration working. Change $SEND_MESSAGE to what you desire. And then start adding in more messaging rules and contacts. But continue testing your spong.message config file as described above (see "Testing Messaging Rules").
Copyright (c) 1999-2000 Stephen L Johnson