exit(0);
}
-__END__
-
-=head1 OPTIONS
-
-=over
-
-=item B<--debug>
-
-Print debugging statements. This option can be specified while creating or deleting acks.
-
-=item B<--batch>
-
-Print the ack-id instead of the normal output. The primary use of this parameter
-is for scripts. An ack can be created when a job that runs causes a service to
-temporarily exceed it's normally limits, or if a service is taken down for an
-unknown or irregular length of time.
-
-=item B<--delete>
-
-Delete a previously created ack.
-
-=back
-
-Here is a descirption of the arguments for creating acks:
-
-=over
-
-=item host
-
-The host having the problem(s) you are acknowledging.
-
-=item service
-
-The service or services (seperated by ".") or I<all> services that your are
-acknowledging.
-
-=item time
-
-The that the acknowledgement will late. This can be an offet "+1h, +3a,d +1w" or
-an absolute date and/or time indicator "12/25/1997 14:00:00. The date needs to be
-a 4 digit year, and the time needs to be in 24 hour format.
-
-=item message
-
-An optional message that will appear to those viewing the state of the host with a
-spong display program. If the value is "-", then the message will read from STDIN.
-
-=back
-
-Here is a description of the arguments for deleting acks:
-
-=over
-
-=item ack-id
-
-The acknowledgment id to delete. The id can be obtained by using the B<--batch>
-parameter when creating the acknowledgment, or by using the L<spong> command
-with the B<--brief> and B<--ack> parameters.
-
-=over
-
-=head1 CONFIGURATION
-
-=head2 Configuration Files
-
-B<spong-cleanup> reads the standard spong.conf and spong.conf.E<lt>hostE<gt>
-configuration files.
-
-=head2 Configuration Variables
-
-=over
-
-=item $SPONGSERVER
-
-The host that at least the L<spong-server> and L<spong-message>
-programs are running on. Typically the L<spong-network> program runs on that
-host as well.
-
-=item $SPONG_UPDATE_PORT
-
-This variable defines the port that the L<spong-server> update process listens
-on. If this variable is not defined on the I<$SPONGSERVER> host, the
-L<spong-server> update process will not be started. The default value is 1998.
-
-=back
-
-=head1 FILES
-
-F<SPONGHOME/etc/spong.conf>, F<SPONGHOME/etc/spong.conf.E<lt>hostE<gt>>
-
-=head1 EXAMPLES
-
- spong-ack mailhub.my-inc.com all '05/27/2000 06:00:00' 'Server is being upgraded'
-
- spong-ack www5.my-inc.com http +1h 'Web server is randomly dying. Investigating.'
-
-In a shell script:
-
- ...
- HOST=`hostname`
- ACKID=`spong-ack --batch $HOST cpu +8h 'Database exports are running'`
- ...
- # Database exports are done here
- ...
- spong-ack --delete $ACKID
- ...
-
-=head1 DEPENDENCIES
-
-Perl v5.005_03 or greater is required.
-
-=head1 BUGS
-
-No know bugs.
-
-=head1 SEE ALSO
-
-L<spong-server>, L<spong.conf>, L<developer-guide>
-
-=head1 AUTHOR
-
-Stephen L Johnson <F<sjohnson@monsters.org>>
-
-=head1 HISTORY
-
-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.
-
-
}
}
-__END__
-
-The B<spong-cleanup> program should be run every night as a cronjob. This will
-ensure that database queries are speedy especially the History Log displays.
-
-=head1 CONFIGURATION
-
-=head2 Configuration Files
-
-B<spong-cleanup> reads the standard spong.conf and spong.conf.E<lt>host<Egt>
-configuration files.
-
-=head2 Configuration Variables
-
-=over
-
-=item $SPONGDB
-
-This defines the directory where the Spong database will be stored. Each host
-will have a subdirectory in this directory which is named for the host.
-
-=item $SPONG_ARCHIVE
-
-The directory where to put old history file entries for each host. Each host
-has it's own file in this directory.
-
-=item $OLD_HISTORY
-
-This is the number of days of history to keep for each host in the
-spong-server database. Any old history is append to the file for the host under
-the I<$SPONG_ARCHIVE> directory.
-
-=item $OLD_SERVICE
-
-This is the number of days to retain stale service status (i.e. purple
-status) entries in the spong-server database. Any service service status
-entries older than <$OLD_SERVICE> days old are deleted from the
-database.
-
-=back
-
-=head1 FILES
-
-F<spong.conf>, F<spong.conf.[hostname]>
-
-=head1 DEPENDENCIES
-
-Perl v5.005_03 or greater is required.
-
-=head1 BUGS
-
-None know bugs.
-
-=head1 SEE ALSO
-
-L<spong-server>, F<spong.conf>
-
-=head1 AUTHOR
-
-Ed Hill <F<ed-hill@uiowa.edu>>, Unix System Administrator, The University of
-Iowa
-
-Stephen L Johnson <F<sjohnson@monsters.org>>
-
-=head1 HISTORY
-
-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.
}
}
-__END__
-
-The checks are modular in nature. You can configure the number of checks
-to run and the order in which to run to them. The list of checks that are
-included are disk space, cpu load, running processes and log files.
-
-=head2 Format of update messages
-
-It sends a message for each check to the spong server and reports the
-following:
-
-=over
-
-=item * hostname (where is this report coming from)
-
-=item * service name ("disk", "cpu", "procs", "logs", "local")
-
-=item * color ("red", "yellow", "green")
-
-=item * a one line summary
-
-=item * a more detailed message providing additional detail.
-
-=back
-
-
-The color is determined by comparing the current status of that service
-against thresholds defined in the configuration file. If they are greater
-then the level you have defined for a warning, then the color is yellow.
-If they are greater then the critical level you have defined then the color
-is red.
-
-The one line summary provides information that might be useful at a
-glance when looking at the overall system status (such as a brief report
-on the load, number of users, and uptime).
-
-The more detailed message contains information such as the complete
-df output, or a listing of the top 10 processes sorted by CPU.
-
-=head2 Running the program
-
-You should start this program in your system startup file, and it should be
-running constantly. If no parameters are specified, B<spong-network> forks
-and detaches itself to run as a daemon.
-
-If you provide the B<--debug> I<n> flag, then debugging information will be
-printed to stdout, otherwise output will only be produced if there is a
-problem. Where I<n> is a number from 1 - 9. A higher number means more
-verbosity in the debugging output.
-
-If you provide the B<--restart> flag, a signal will be sent to the spong-client
-process that is currently running that will cause it to reload it's
-configuration files. If you provide the B<--kill> flag, a signal will be sent
-to the running spong-client process causing it to exit.
-
-The B<--nosleep> or B<--refresh> flag causes the program to cycle through all
-of the checks once then exit. These flags can be used to run spong-client as a
-cron job (B<depreciated>), this reduced the effectiveness of the L<check_logs>
-module.
-
-=head2 Client Checks
-
-The checks are actually a set of modules that are called in series by
-B<spong-client>. The list of modules to run are defined in the I<$CHECKS>
-configuration variable. Upon initialization, B<spong-client> will load the
-modules defined in I<$CHECKS> from the F<LIBDIR/Spong/Client/plugins/>
-directory. As each modules is initialized, it registers itself with the the
-plugins registery (see the L<Developer Guide|developer-guide>). Spong comes
-with a standard set of client checks, see L<client-modules> for more
-information.
-
-=head2 Extending Functionality
-
-B<Depreciated>, please refer to the L<Client Modules|developer-guide/"Client Modules"> section of the Developer Guide.
-
-If you want to check some service which is not being checked by spong-client,
-then you can define a C<&check_local()> function in your
-config file (either in your standard L<spong.conf> config file or your host specific L<spong.conf.hostname>
-file - but not both!). That function can do anything you want, but at the
-end needs to call the C<&status()> function to report
-what you have found to the spong server.
-
-=head1 CONFIGURATION
-
-=head2 Configuration Files
-
-By default this reads the L<spong.conf|spong.conf> file 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 F<spong.conf.[hostname]> file where [hostname] 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.
-
-=head2 Configuration Variables
-
-Here is a listing of the configuration variables applicable to the
-B<spong-client> program.
-
-=over
-
-=item $SPONGSLEEP, $SPONGSERVER, $SPONG_UPDATE_PORT
-
-Some basic spong configuration options that define how long to sleep (in
-seconds) before checking the status of a service again, the hostname of the
-spong server, and the port number that the spong server listens
-
-=item $SPONGSLEEP{'DEFAULT'}, $SPONGSLEEP{'spong-client'}
-
-This the new method for specifying the $SPONGSLEEP interval for Spong programs.
-If there is not $SPONGSLEEP{} entry for the program, it will use the
-I<$SPONGSLEEP{'DEFAULT'}> value. If no value is then found, B<spong-client>
-fall back to using $SPONGSLEEP.
-
-=item $SPONGTMP
-
-The directory that Spong programs use for temporary store and work files. It
-should be different directory than F</tmp> for operation and securiy reasons.
-
-=item $SPONG_LOG_FILE
-
-If set to I<1>, B<spong-client> will log errors to a log file in I<$SPONGTMP>
-named F<spong-client.log>.
-
-=item $SPONG_LOG_SYSLOG
-
-If set to I<1>, B<spong-client> will log errors to the syslog using the
-I<USER> facility and the B<ERR> priority.
-
-=item $CHECKS
-
-A string that has the list of client check modules to run. If I<$CHECKS> is
-missed or blank, spong-client defaults to "disk cpu processes logs". If the
-C<check_local()> function is present then 'local' is appended.
-
-=item $CPUWARN, $CPUCRIT
-
-A number indicating the CPU load that triggers a problem (I<$CPUWARN>
-triggers warnings - yellow, and I<$CPUCRIT> triggers alerts - red).
-
-=item @PROCSWARN, @PROCSCRIT
-
-A list of processes that should be running, if they are not running, then
-trigger a problem (processes in I<@PROCSWARN> trigger a warning - yellow, and
-processes in I<@PROCSCRIT> trigger an alert - red).
-
-=item $LOGCHECKS
-
-A list of hashes which defined checks to apply to log files. Each hash
-contains the fields:
-
-=over
-
-=item logfile
-
-which is the full path to the log file to check
-
-=item checks
-
-a list of check to apply to the log file.
-
-=back
-
-Each check is a hash that contains the fields:
-
-=over
-
-=item pattern
-
-a Perl regular expression to be scanned for
-
-=item status
-
-the status color to reported lines matching pattern
-
-=item duration
-
-the duration (in seconds) that each event is to be reported to the server
-
-=item text
-
-a string which is the the text to be reported
-back in the detailed message field of the status report (which can include
-match position variables from I<pattern>)
-
-=item id
-
-an optional key field to associated with each event generated. The default
-key is the evaluated I<text> field. An id key may be specified for the
-for a check pattern. All hits of the pattern will be consolidated into one
-event. The data of the last hit will be reported in the event.
-
-=back
-
-=item $DF, $UPTIME, $PS, $GREP
-
-These variables are OS specific variables, which are hopefully set
-correctly for your machine, if they are not - please send me email letting
-me know what OS you are running on, and what the correct value should be.
-
-=back
-
-
-=head1 FILES
-
-F<spong.conf>, F<spong.conf.[hostname]>
-
-=head1 EXAMPLES
-
- spong-client --debug 5 --nosleep
- spong-client --debug 5
- spong-client --restart
-
-=head1 DEPENDENCIES
-
-Perl v5.005_03 or greater is required.
-
-=head1 BUGS
-
-None know bugs.
-
-=head1 SEE ALSO
-
-L<spong-server>, F<spong.conf>, F<client-modules>, L<developer-guide>
-
-=head1 AUTHOR
-
-Ed Hill <F<ed-hill@uiowa.edu>>, Unix System Administrator, The University of
-Iowa
-
-Stephen L Johnson <F<sjohnson@monsters.org>>
-
-=head1 HISTORY
-
-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.
umask $umask;
}
-
-__END__
-
-=head2 Options
-
-=over
-
-=item B<--debug>
-
-Enables the printing of detailed debugging lines. Can be used in conjunction
-with B<--test> to test new messaging rules.
-
-=item B<--color|--status> I<color>
-
-Specified the status color of the event being reported. I<color> can be
-green, yellow or red.
-
-=item B<--host> I<hostname>
-
-The hostname of the server that is being reported on.
-
-=item B<--service> I<service>
-
-The name of the service that is being reported on.
-
-=item B<--time> I<time>
-
-The time of the event being reported in epoch format (i.e. time()).
-
-=item B<--summary> I<"summary text">
-
-This is the summary message field of the event being reported on.
-
-=item B<--file> I<filename>
-
-The name of a file to read the detailed message text from. If the I<filename> is S<'-'>, the text is read from stdin.
-
-=item B<--message> I<"message text">
-
-Detailed message text of the event being reported.
-
-=back
-
-The following parameters can be specifed on the command line with the
-accompanying command line parameters.
-
-=over
-
-=item color
-
-the status color of the message (B<red>, B<yellow>, or B<green>)
-
-=item host
-
-the hostname being of the alart
-
-=item service
-
-the name of the service of the alert
-
-=item time
-
-the date/time (in time() format) of the problem
-
-=item message
-
-a summary line of the problem
-
-=back
-
-=head2 Theory of Operation
-
-When B<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 L<$SPONGTMP|spong.conf/"$SPONGTMP"> directory is kept
-so that B<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 maintainence on a machine, or have standard
-down time for a machine, you can specify that down time in the spong.hosts file
-using the L<down|spong.hosts/"down"> attribute in a
-L<%HOSTS|spong.hosts/"%HOSTS"> variable. If a problem is reported during the
-time indicated, B<spong-message> will not send any messages.
-
-B<spong-message> also checks for any L<acknowledgementas|spong-acks> active for
-a machine. If there an active acknowledgement found for a machine and service,
-no messages will be sent.
-
-B<spong-message> uses the L<%HUMANS|spong.hosts/"%HUMANS"> entries defined in
-the L<contacts|spong.message/"contacts"> attributes of the messaging rules of
-L<spong.message> to determine who is to be contacted. A list of contacts is
-generated from all of the message rules that are matched. (See the
-L<spong.message> and L<spong.hosts> documentation for information on the file
-formats.)
-
-=head2 Message Templates
-
-Notification messages are formatted by message templates in the %TEMPLATES
-configuration variable in the F<spong.message> file. The 'DEFAULT' template
-is use is no other tempate is found. Templates override can be defined for any
-contact, message module, or a combination of the two. See
-L<spong.message|"MESSAGE TEMPLATES"> for information on the file format.
-
-=head2 Messaging Modules
-
-B<spong-message> alerts people via the messaging modules that are installed.
-New messaging functions can be easily created. See the L<Message
-Modules|developer-guide/"Messaging Modules"> section in the I<Developer Guide>.
-
-=head1 CONFIGURATION
-
-=head2 Configuration Files
-
-=over
-
-=item spong.hosts
-
-F<spong.hosts> defined attributes for two things of important to <spong-message>
-1) the hosts that B<Spong> is monitoring (I<%HOSTS>), and 2) the contacts that
-are responsible for the various hosts and how to contact them (I<%HUMANS>).
-
-See L<spong.hosts> for a full description of all of the file formats.
-
-=item spong.message
-
-This file hold the rules that determine who is to be contacted, when and how
-often. There are some of the important configuration variables in the
-F<spong.message> file 1) how the messaging rules are to be scanned
-(L<$RULES_MATCH|spong.message/"$RULES_MATCH">), 2) the messaging rules
-(L<$MESSAGING_RULES|spong.message/"$MESSAGING_RULES">), 3) how to format the
-messages being sent (L<%TEMPLATES|spong.message">).
-
-=back
-
-=head2 Configuration Varirables
-
-From F<spong.hosts>:
-
-=over
-
-=item %HUMANS
-
-The I<%HUMANS> configuration variable hold all of possible message recipients
-(the humans) and the information necessary on how to contact them. Each
-I<human> contact can be a person, a group of people, or really anything you
-want.
-
-Each I<human> that is defined should have I<name> attribute associated
-with it. I<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 L<"EXAMPLES"> for a
-detailed I<%HUMANS> example.
-
-=item %HOSTS
-
-The I<%HOSTS> configuration variables can hold a list of regularly scheduled
-maintenance periods (I<down>) for each host. Any alerts that are generated
-during a maintenance period will be silently discarded.
-
-=back
-
-From F<spong.message>:
-
-=over
-
-=item $RULES_MATCH
-
-L<$RULES_MATCH|spong.message/"$RULES_MATCH"> determines how the rules in
-L<$MESSAGING_RULES|spong.message/"$MESSAGING_RULES"> are scanned. If it is
-I<FIRST_MATCH> the rules will be scanned until the first rule that matches the
-messaging criteria. A value of I<ALL> means that all of the rules are scan with
-the contacts of all matching rules being adding into the list of contacts to
-notify. If the value is I<OLD>, then spong-message will fall back to the
-messaging code used in Spong versions 2.0 - 2.1 for compatibility.
-
-=item $MESSAGING_RULES
-
-L<$MESSAGING_RULES|spong.message/"$MESSAGING_RULES"> contains the rules that
-how, who and how often contacts are notified. See
-L<$MESSAGING_RULES|spong.message/"$MESSAGING_RULES"> for the full rules syntax.
-
-=item %TEMPLATES
-
-C<%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
-L<$MESSAGING_RULES|spong.message/"$MESSAGING_RULES"> for the full rules syntax.
-
-=back
-
-From F<spong.conf>:
-
-=item $SEND_MESSAGE
-
-L<$SEND_MESSAGE|spong.conf/"$SEND_MESSAGE">
-defines when spong-message is called by spong-server. It is not really
-specific to spong-message, but I think it is useful to describe its behavior
-here. This variable can contain one of four valid values. If it is I<RED>,
-then B<spong-message> is called for every time a system or service
-reports a problem. If its value is I<CHANGE>, then B<spong-message> is only
-called when there is a change of state . If this values is I<RED-CHANGE>, then
-B<spong-message> is called everytime a service or service reports a problem and
-when the condition is cleared. (going from green/yellow to red, and then again
-going from red to green/yellow). If its value is I<NONE>, then B<spong-message>
-is never called.
-
-=item $MESSAGES_PER_HOUR
-
-L<$MESSAGES_PER_HOUR|spong.conf/"$MESSAGES_PER_HOUR"> is the maximum number of
-messages that are sent to the same person in an hour. All message past this
-number are just logged to the history file, but are not sent. This helps to
-prevent against message overload such as when you have a networking problem,
-and everything appears to go red at once. The default value is 5.
-
-=item $IDENT_MESSAGES_PER_HOUR
-
-L<$IDENT_MESSAGES_PER_HOUR|spong.conf/"$IDENT_MESSAGES_PER_HOUR"> is the
-maximum number of identical messages that are sent to the same person in an
-hour. The default value is 3.
-
-=back
-
-=head1 FILES
-
-=over
-
-F<spong.conf>,
-F<spong.hosts>,
-F<$SPOMGTMP/message-db>,
-F<spong.message>
-
-=head1 EXAMPLES
-
-Here are some examples to show you possible configurations.
-
-=over
-
-=item spong.conf
-
- %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' },
-
- );
-
-
-=item 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: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!!
- ',
- },
- );
-
-=back
-
-
-=head1 DEPENDENCIES</h1>
-
-Perl v5.003 or greater is required.
-
-To receive pages, you currently must have a pager that can be contacted
-electronically (via email or web interface).
-
-
-=head1 BUGS
-
-No know bugs.
-
-=head1 SEE ALSO
-
-L<spong-server>, L<spong.hosts>, L<spong.conf>, L<spong.message>,
-L<messaging-modules>, L<strftime(3)>
-
-=head1 AUTHOR
-
-Ed Hill <F<ed-hill@uiowa.edu>>, Unix System Administrator, The University of
-Iowa
-
-Stephen L Johnson <F<sjohnson@monsters.org>>
-
-=head1 HISTORY
-
-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.
}
}
-__END__
-
-The program checks a series of network services that are configured serparately
-for each host. B<spong-network> also can be very agressive in checking for
-network service that are down. You can configure multiple rechecks to guard
-against transistional failues.
-
-=head2 Running the program
-
-You should start this program in your system startup file, and it should be
-running constantly. If no parameters are specified, B<spong-network> forks
-and detaches itself to run as a daemon.
-
-If you provide the B<--debug> I<n> flag, then debugging information will be
-printed to stdout, otherwise output will only be produced if there is a
-problem. Where I<n> is a number from 1 - 9. A higher number means more
-verbosity in the debugging output.
-
-If you provide the B<--restart> flag, a signal will be sent to the B<spong-network>
-process that is currently running that will cause it to reload it's
-configuration files. If you provide the B<--kill> flag, a signal will be sent
-to the running spong-client process causing it to exit.
-
-The B<--nosleep> or B<--refresh> flag causes the program to cycle through all
-of the checks once then exit. These flags can be used to run spong-client as a
-cron job (B<depreciated>), but it recommended that you run the program
-continuously.
-
-
-=head2 Format of update messages
-
-It sends a message for each check to the spong server and reports the
-following:
-
-=over 4
-
-=item * hostname (where is this report coming from)
-
-=item * service name ("disk", "cpu", "procs", "logs", "local")
-
-=item * color ("red", "yellow", "green")
-
-=item * a one line summary
-
-=item * a more detailed message providing additional detail.
-
-=back
-
-The color is determined by comparing the current status of that
-service against thresholds defined in the configuration file. If
-they are greater then the level you have defined for a warning, then the color
-is yellow. If they are greater then the critical level you have defined then
-the color is red.
-
-The one line summary provides information that might be useful at a glance when
-looking at the overall system status (such as a brief report on the load,
-number of users, and uptime).
-
-The more detailed message contains information such as the output of
-the ping command from the check ping module or the data read after testing
-a network service.
-
-=head2 Network Checks
-
-The check are actually a setup of modules that are called in series by
-B<spong-network>. Upon initialization, B<spong-network> will load the all of
-the modules that will be used from the F<LIBDIR/Spong/Network/plugins>
-directory. As each module is initialized, it registers itself with the plugins
-registry (see the L<Developer Guide|developer-guide>). Spong comes with a
-standard set of network check modules, see L<"network-modules> for more
-information.
-
-The list of network checks and the order the are performed that are performed
-for a host are defined in the I<services> attribute of the host's entry in the
-L<%HOST|spong.hosts/"%HOSTS"> variable. The I<ping> service is appended by
-default to all of the lists of services to be check for a host. If the
-metaservice name of I<noping> is defined for a host, the ping check will no be
-done for the host.
-
-=head1 CONFIGURATION
-
-=head2 Configuration Files
-
-=over
-
-=item spong.conf
-
-By default this reads the L<spong.conf|spong.conf> file 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.
-
-=item spong.conf.[hostname]
-
-After reading the configuration file that you specify (or the default),
-it then reads the F<spong.conf.[hostname]> file where [hostname] 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.
-
-=item spong.hosts
-
-B<spong-network> reads all of the host that are to be check from the
-L<%HOSTS|spong.hosts/"%HOSTS"> variable in the L<spong.hosts> file. The
-list of services to be check for each host is alread read from F<spong.hosts>.
-
-=back
-
-=head2 Configuration Variables
-
-From F<spong.conf>:
-
-=over
-
-=item $SPONGSLEEP, $SPONGSERVER, $SPONG_UPDATE_PORT
-
-Some basic spong configuration options that define how long to sleep (in
-seconds) before checking the status of a service again, the hostname of the
-spong server, and the port number that the spong server listens
-
-=item $SPONGSLEEP{'DEFAULT'}, $SPONGSLEEP{'spong-network'}
-
-This the new method for specifying the $SPONGSLEEP interval for Spong programs.
-If there is not $SPONGSLEEP{} entry for the program, it will use the
-I<$SPONGSLEEP{'DEFAULT'}> value. If no value is then found, B<spong-client>
-fall back to using $SPONGSLEEP.
-
-=item $SPONGTMP
-
-The directory that Spong programs use for temporary store and work files. It
-should be different a directory than F</tmp> for operation and securiy reasons.
-
-=item $SPONG_LOG_FILE
-
-If set to I<1>, B<spong-network> will log errors to a log file in I<$SPONGTMP>
-named F<spong-network.log>.
-
-=item $SPONG_LOG_SYSLOG
-
-If set to I<1>, B<spong-network> will log errors to the syslog using the
-I<USER> facility and the I<ERR> priority.
-
-=back
-
-From F<spong.hosts>:
-
-=over
-
-=item %HOSTS
-
-All of the host names defined in %HOSTS are the list of hosts that
-B<spong-network> will check. The services defined in the I<services> attribute
-are the list of services that will be check for each host. The I<ping> service
-is prependied to the list of services unless 'noping' is defined.
-
-=back
-
-=head1 FILES
-
-F<spong.conf>, F<spong.conf.hostname>, F<spong.hosts>
-
-=head1 DEPENDENCIES
-
-Perl v5.005_03 or greater is required.
-
-=head1 BUGS
-
-The check_dns module uses the Net::DNS Perl module. On some systems the
-Net::DNS module will fail and start reporting false DNS lookup failures. The
-cause is unknown at present. This will cause dns check for all hosts to fail
-and be reported as a critical status. The fix is to restart B<spong-network>
-(i.e. B<spong-network --restart> ),
-
-A work-around is to regularly do restart B<spong-network>, such as from a
-cron job.
-
-=head1 SEE ALSO
-
-L<spong-server>, L<spong.conf>, L<spong.hosts>, L<network-modules>,
-L<developer-guide>
-
-=head1 AUTHOR
-
-Ed Hill <F<ed-hill@uiowa.edu>>, Unix System Administrator, The University of
-Iowa
-
-Stephen L Johnson <F<sjohnson@monsters.org>>
-
-=head1 HISTORY
-
-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.
-
-
# There are one or more update processes that listen for status updates
# from client programs.
-# $Id: spong-server.pl,v 1.27 2000/09/13 18:15:20 sljohnson Exp $
+# $Id: spong-server.pl,v 1.28 2000/09/27 03:57:38 sljohnson Exp $
use lib "@@LIBDIR@@";
}
-__END__
-
-=head2 Running the program
-
-You should start this program in you system startup file, and it should be
-running constantly. If no parameters are provided, B<spong-server> will
-fork and detach itself from the console to run as a daemon.
-
-If you provide the B<--debug> I<n> flag then debugging information will be
-printed to stderr. The I<n> is an integer from 1 to 9. A higher number means
-more verbosity in the debugging output.
-
-If you provide the B<--restart> flag, a signal will be sent to the
-B<spong-server> process that is currently running. It will release reload it's
-configuration and restart. If the B<--kill> flag if provided, a signal will
-be sent to the running B<spong-server> process causing it to exit.
-
-An alternate configuration file can be specified on the command line. This
-file will be read instead of the default F<spong.conf> configuration file.
-
-=head2 Theory of Operation
-
-The B<spong-server> has a main process that spawns a number of child processes
-to handle all of the work. There are a query process which handles queries into
-the Spong database, an update process which handles Spong formatted update
-messages (see L<developer-guide/"Spong Update Message Format">), a BBSERVER
-update process which handled Big Brother client update messages, and possibly
-other process are more feature are added in the future. The main process
-monitors each of the child processes. It will restart any child process that
-dies for any reason.
-
-Each time a connection comes in, the child process is forks off to handle the
-the above tasks. The main child process goes back to waiting for more
-connections.
-
-=head2 Data Modules
-
-The B<spong-server> has a plugin module facility similar to the other
-Spong programs. One or more modules can be installed in the
-F<LIBDIR/Spong/plugins/> directory. The modules are loaded are run-time by
-B<spong-server>. As each module is initialized is registers itself with
-the plugins registry.
-
-Each module is called in turn after all of the normal processing is done for
-incoming status messages. This allows you access to data of a status message
-tht will eventually be discarded. Data modules can do virtually anything that
-you desire with the incoming data. The data can be written to a log or
-database or feed to another application for further filter or processing.
-
-Two sample data modiules are located in the F<contrib/plugins/spong-server>
-directory of the Spong distribution. The two modules (B<data_rrd_disk> and
-B<data_rrd_la> work in conjunction with a software package named RRD Tool to
-log disk and cpu information into Round Robin Databases. The modules are
-included as examples. They are not of must use by themselves. See the
-B<Spong-RRD> package (http://spong.sourceforge.net/downloads.html) for a
-complete package that utilizes data modules.
-
-=head2 Big Brother (BBSERVER) Emulation
-
-=head1 CONFIGURATION
-
-=head2 Configuration Files
-
-=over
-
-=item spong.conf
-
-By default this reads the L<spong.conf|spong.conf> file 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.
-
-=item spong.conf.[hostname]
-
-After reading the configuration file that you specify (or the default),
-it then reads the F<spong.conf.[hostname]> file where [hostname] 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.
-
-=item spong.hosts
-
-B<spong-server> reads all of the host that are idefined in the
-L<%HOSTS|spong.hosts/"%HOSTS"> variable in the L<spong.hosts> file.
-B<spong-server> uses this list of servers to validate incoming status and
-control messages. And the list is used in format of database queries.
-
-=item spong.groups
-
-The L<spong.groups> file defines groups of hosts. B<spong-server> uses these
-host groups to filter and format the data returned in database queries.
-
-=back
-
-From F<spong.conf>:
-
-
-Yes there are a lot of variables. But all of the variables have defined
-default values. Most of these variables are used customizing the client
-web and text interfaces.
-
-=over
-
-=item $SPONG_UPDATE_PORT
-
-This variable defines the port that the Spong update process listens on. If
-This variable is not defined the Spong update process will not be started.
-The default value is 1998.
-
-=item $SPONG_UPDATE_PORT
-
-This varirable defines the port that the Spong query process listens on. If
-this varirable is not defined the Spong query process will not be started. The
-default value is 1999.
-
-=item $SPONG_BB_UPDATE_PORT
-
-This variable defines the port that the Big Brother BBSERVER emulation
-process listens on. If this variable is not defined the Big Brother BBSERVER
-emluation process will not be started. The default value is 1984.
-
-=item $SPONGSLEEP (Depreciated)
-
-This variable is used by B<spong-server> to determine how old a service's
-status can be before it is considered stale. It's status will be reported
-as 'purple'. The exact time to live a message is 2 * $SPONGSLEEP. (This
-variable is depreciated in favor of the new $SPONGSLEEP{} variables.)
-
-=item $SPONGSLEEP{'DEFAULT'}, $SPONGSLEEP{'spong-server'}
-
-This the new method for specifying the $SPONGSLEEP interval for Spong programs.
-If there is not $SPONGSLEEP{} entry for the program, it will use the
-I<$SPONGSLEEP{'DEFAULT'}> value. If no value is then found, B<spong-client>
-fall back to using $SPONGSLEEP.
-
-=item $SPONGDB
-
-This defined the directory where the Spong database will be stored. Each host
-will have a subdirectory in this directory which is named for the host.
-
-=item $SPONGTMP
-
-The directory that Spong programs use for temporary store and work files. It
-should be different a directory than F</tmp> for operation and securiy reasons.
-
-=item $SPONGSTATUS
-
-If this variable is set to 1, it will enable the storing of the update
-status message information for each event that is generated in the history
-log. This status message information is access via the web interface by
-click on the status color or icon link of an event in a History Listing.
-
-=item $SPONG_LOG_FILE
-
-If set to I<1>, B<spong-network> will log errors to a log file in I<$SPONGTMP>
-named F<spong-network.log>.
-
-=item $SPONG_LOG_SYSLOG
-
-If set to I<1>, B<spong-network> will log errors to the syslog using the
-I<USER> facility and the I<ERR> priority.
-
-=item $SPONG_SERVER_ALARM
-
-This variable defined the maximum amount of time (in seconds) that a incoming
-connection of a status message can last. Once the time limit is exceeded
-B<spong-server> will terminated the connection. This action can be disables
-by setting the variable to zero (0).
-
-=item $WWW_FQDN
-
-Set this variable to 1 to display the fully qualified domain name (FQDN) of
-hosts in Spong client displays. Otherwise only the first element of the FQDN
-will be displayed.
-
-=back
-
-From F<spong.hosts>:
-
-=over
-
-=item %HOSTS
-
-All of the host names defined in %HOSTS are the list of hosts that
-B<spong-server> will accept status messages for. Any status messsage for an
-unknown host will be logged as an error and discarded.
-
-= back
-
-From F<spong.groups>:
-
-=over
-
-=item %GROUPS
-
-The host groups that are defined in this variable are used to filter and
-format data queries of the Spong database.
-
-=back
-
-=head1 FILES
-
-F<spong.conf>, F<spong.conf.hostname>, F<spong.hosts>, F<spong.groups>
-
-=head1 DEPENDENCIES
-
-Perl v5.005_03 or greater is required.
-
-=head1 BUGS
-
-No know bugs.
-
-=head1 SEE ALSO
-
-L<spong.conf>, L<spong.hosts>, L<spong.groups>, L<data-modules>,
-L<developer-guide>
-
-=head1 AUTHOR
-
-Ed Hill <F<ed-hill@uiowa.edu>>, Unix System Administrator, The University of
-Iowa
-
-Stephen L Johnson <F<sjohnson@monsters.org>>
-
-=head1 HISTORY
-
-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.
-
-
}
}
-__END__
-
-=head1 OPTIONS
-
-=over
-
-=item B<--summary> [I<HOSTLIST>]
-
-Summarize the status of hosts, in HOSTLIST, in a table that lists
-the hosts and services, and the current status is a single letter with
-the meaning defined in the ledgend at the top of the display. If I<HOSTLIST>
-if not specified all hosts defined in F<spong.hosts> are displayed.
-
-=item B<--problems> [I<HOSTLIST>]
-
-Shows a summary of all the problems (services that are red) for the all
-the hosts in <HOSTLIST>. If I<HOSTLIST> is not specified, all hosts defined
-in F<spong.hosts> are displayed.
-
-=item B<--history> [I<HOSTLIST>]
-
-Show history information for the the list of hosts in I<HOSTLIST>. If
-I<HOSTLIST> is not specified, all hosts defined in F<spong.hosts> are
-displayed.
-
-=item B<--host> I<HOST>
-
-Shows all information availiable for the given I<HOST>
-
-=item B<--services> I<host>
-
-Shows detailed service information for the given I<HOST>.
-
-=item B<--stats> I<HOST>
-
-Show statistical information for the given I<HOST>. (Not currently
-implemented.)
-
-=item B<--config> I<HOST>
-
-Shows configuration information for the given I<HOST>. (Not currenly
-implemented.)
-
-=item B<--info> I<HOST<
-
-Shows admin supplied text for the given I<HOST>.
-
-=item B<--service> I<HOST:SERVICE>
-
-Shows detailed information for the given HOST/SERVICE.
-
-=item B<--brief>
-
-Display output in a brief format.
-
-=item B<--standard>
-
-Display output in standard format (the default)
-
-=item B<--full>
-
-Display the maximum amount of information possible.
-
-=head1 CONFIGURATION
-
-=head2 Configuration Files
-
-By default the L<spong.conf> file is read on startup. It defines some specific
-variable that you probably don't need to override.
-
-After reading the configuration file, then reads the
-F<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.
-
-=head2 Configuration Variables
-
-Here are a list of variables in the spong.conf file that are applicable
-to the spong-server program:
-
-=over
-
-=item $SPONGSERVER
-
-The make of the server that spong-server is running on.
-
-=item $SPONG_QUERY_PORT
-
-The port number that spong-server listens at for database queries.
-
-=back
-
-=head1 FILES
-
-=over
-
-=item spong.conf
-
-Configuration file. This contains variables that detail spong and OS specific
-definitions used by spong-server.
-
-=back
-
-=head1 DEPENDENCIES
-
-Perl v5.005_03 or greater is required.
-
-=head1 BUGS
-
-The B<--stats>, B<--config>, and B<--info> parameters are currently
-not implemented in the spong-server. When specified they will just generate
-a blank HTML page.
-
-=head1 SEE ALSO
-
-L<spong.hosts, L<spong.conf>
-
- http://spong.sourceforge.net/ the Spong Home Page
-
-
-=head1 AUTHOR
-
-Ed Hill <F<ed-hill@uiowa.edu>>, Unix System Administrator, The University of
-Iowa
-
-Stephen L Johnson <F<sjohnson@monsters.org>>
-
-=head1 HISTORY
-
-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.
-
return "can not connect to spong server" if ! $ok;
}
-__END__
-
-=head2 Theory of Operation
-
-The B<www-spong-ack> program is designed to interact with the L<www-spong>
-Spong display program, but it the program can be used if it is invoked directly.
-
-When the program is initially invoked it will list all of the acknowledments at
-the top of the page in the "Current Acknowledgments" section. The host/service
-and the expiration date/time of the acks are displayed. A I<Delete> link is
-provided for every ack. that will delete that particular ack. when selected.
-
-Below in the "New Acknowledgment" section is a form form for creating a new
-acknowledgment. The hostname is selected from the drop-down box. The service(s)
-to be acknowledged is entered in service field. The duration of the event is
-entered in one of serveral formats into the duration field. Your e-mail addres
-should be entered into the e-mail address field. It is only used to show who
-created the ack. And a message about the aknowledgement can be entered. Once
-all of the infomation is entered, press the 'Create' button to create the
-acknowledgement.
-
-=head1 CONFIGURATION
-
-=head2 Configuration Files
-
-B<spong-cleanup> reads the standard spong.conf and spong.conf.E<lt>hostE<gt>
-configuration files.
-
-=head2 Configuration Variables
-
-=over
-
-=item $SPONGSERVER
-
-The host that at least the L<spong-server> and L<spong-message>
-programs are running on. Typically the L<spong-network> program runs on that
-host as well.
-
-=item $SPONG_UPDATE_PORT
-
-This variable defines the port that the L<spong-server> update process listens
-on. If this variable is not defined on the I<$SPONGSERVER> host, the
-L<spong-server> update process will not be started. The default value is 1998.
-
-=back
-
-=head1 FILES
-
-F<SPONGHOME/etc/spong.conf>, F<SPONGHOME/etc/spong.conf.E<lt>hostE<gt>>
-
-=head1 DEPENDENCIES
-
-Perl v5.005_03 or greater is required.
-
-A working web server that can run CGI programs.
-
-=head1 BUGS
-
-No know bugs.
-
-=head1 SEE ALSO
-
-L<spong-server>, L<spong-ack>, L<spong.conf>, L<user-guide>
-
-=head1 AUTHOR
-
-Stephen L Johnson <F<sjohnson@monsters.org>>
-
-=head1 HISTORY
-
-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.
-
return "<font color=red><b>Can't connect to spong server!</b></font>";
}
-__END__
-
-=head1 OPTIONS
-
-=over
-
-=item B<--summary> [I<hostlist>]
-
-Summarize the status of hosts, in hostlist, in a table that lists
-the hosts and services, and the current status is a colored block or an
-icon depending on how spong-server is configured. If hostlist if not specified
-all hosts defined in spong.hosts are displayed.
-
-=item B<--grp-summary>
-
-Summary the status of all by Host Groups defined in the L<spong.groups> file.
-Each Host Group is displayed in a table that lists the hosts and services, and
-the current status is a colored block or an icon depending on how spng-server
-is configured.
-
-=item B<--problems> [I<hostlist>]
-
-Shows a summary of all the problems (services that are red) for the all
-the hosts in hostlist. If hostlist is not specified, all hosts defined
-in spong.hosts are displayed.
-
-=item B<--grp-problems>
-
-Shows a summary of all of the problems (services that are red) for all Host Groups
-defined in the L<spong.groups> file.
-
-=item B<--history> [I<hostlist>]
-
-Show history information for the the list of hosts in hostlist. If host
-list is not specified, all hosts defined in spong.hosts are displayed.
-
-=item B<--host> I<host>
-
-Shows all information availiable for the given host.
-
-=item B<--services> I<host>
-
-Shows detailed service information for the given host.
-
-
-=item B<--stats> I<host>
-
-Show statistical information for the given host.
-
-=item B<--config> I<host>
-
-Shows configuration information for the given host.
-
-=item B<--info> I<host>
-
-Shows admin supplied text for the given host.
-
-=item B<--service> I<host:service>
-
-Shows detailed information for the given host/service.
-
-=item B<--brief>
-
-Display output in a brief format.
-
-=item B<--standard>
-
-Display output in standard format (the default).
-
-=item B<--full>
-
-Display the maximum amount of information possible.
-
-=back
-
-=head1 CONFIGURATION
-
-=head2 Configuration Files
-
-By default the L<spong.conf> file is read on startup. It defines some specific
-variable that you probably don't need to override.
-
-After reading the configuration file, then reads the
-F<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.
-
-=head2 Configuration Variables
-
-Here are a list of variables in the spong.conf file that are applicable
-to the spong-server program:
-
-=over
-
-=item $SPONGSERVER
-
-The make of the server that spong-server is running on.
-
-=item $SPONG_QUERY_PORT
-
-The port number that spong-server listens at for database queries.
-
-=back
-
-=head1 FILES
-
-=over
-
-=item spong.conf
-
-Configuration file. This contains variables that detail spong and OS specific
-definitions used by spong-server.
-
-=back
-
-=head1 DEPENDENCIES
-
-Perl v5.005_03 or greater is required.
-
-=head1 BUGS
-
-The B<--stats>, B<--config>, and B<--info> parameters are currently
-not implemented in the spong-server. When specified they will just generate
-a blank HTML page.
-
-=head1 SEE ALSO
-
-L<spong.hosts>, L<spong.conf>, L<user-guide>
-
- http://spong.sourceforge.net/ the Spong Home Page
-
-=head1 AUTHOR
-
-Ed Hill <F<ed-hill@uiowa.edu>>, Unix System Administrator, The University of
-Iowa
-
-Stephen L Johnson <F<sjohnson@monsters.org>>
-
-=head1 HISTORY
-
-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.
-