Besides checking connectivity (first using tcp echo, and then ICMP ping if that fails), the following TCP/UDP based services can be checked.
* dns (asks the bind server to resolve its own name) * ftp (checks for a 220 return code) * pop3 (checks for a "OK" return string) * smtp (checks for a 220 return code) * nntp (checks for a 200 return code) * imap (checks for a "OK" return string) * http (checks for a 200-300 return code) * ssh (checks for "SSH" in return string)The DNS check will only be performed if you have the Perl Net::DNS module installed on your system. This module does not come with spong, but can be downloaded at http://www.perl.com/CPAN/.
For each of these network services, the following information is reported to the spong server.
* hostname (the host the service is running on) * service name ("ftp", "pop3", "smtp", ...) * color ("red", "yellow", "green") * a one line summary * a more detailed message providing additional detail.These checks are modular in nature.New checks can be added or old checks replaced with newer versions. See Client Modules in the Developers Guide.
For most services, the color is determined by comparing the return value of the service against an expected string. For some services (like http) there are some additional smarts built in to determine the status of the service.
The spong-network program can also check multiple interfaces on a given host. See spong.hosts for instructions on how to set this up in your spong.hosts file.
The one line summary provides information that might be useful at a glance when looking at the overall system status (such as the response time of the service). The more detailed message contains information such as the output of the service.
You should start this program in your system startup file, and it should be running constantly. The program will daemonize by default unless one of the flags below is given.
If you provide the --debug flag, then debugging information will be printed to stdout and the program will be forced to run in the fore ground, otherwise output will only be produced if there is a problem.
If you provide the --restart flag, a signal will be sent to the spong-network
process that is currently running that will cause it to reload it's configuration
files. If you provide the --kill flag, a signal will be sent to the running
spong-network process causing it to exit. The --nosleep and --refresh flags
caus the program to cycle through all of the checks one
and then exit. These flags can be used to run spong-network
from cron.
The second part of the configuration is the /usr/local/etc/spong/spong.conf file which defines some specific variables that you probably don't need to override. By default the /usr/local/etc/spong/spong.conf file is read on startup. You can specify an alternate config file via a command line option and it will read that file instead. If you change values in the configuration file you will need to restart this program for those changes to be re-read.
After reading the configuration file that you specify (or the default), it then reads the /usr/local/etc/spong/spong.conf.[host] file where [host] is the hostname of the machine that you are running on. Since these configuration files are just standard perl code that gets imported, the variables that you define in the host specific config file will take precedence over the standard configuration settings.
Here are a list of variables in the spong.conf file that are applicable to the spong-network program:
I should check connectivity a little better, check it once and then back off, and keep backing off little by little until the host is reachable again - like pong does...
The http check is not configurable enough.
Based on code/ideas from Sean MacGuire (BB), and Helen Harrison (Pong).