From: Stephen L Johnson Date: Fri, 15 Sep 2000 18:13:56 +0000 (+0000) Subject: added missing main::error() func that new Spong::Status needs. X-Git-Tag: spong-2_7_0-beta1~43 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=628ff1f71315157ec7ebd0312266cd87dea7b689;p=spong.git added missing main::error() func that new Spong::Status needs. --- diff --git a/src/spong-status.pl b/src/spong-status.pl index bbece4c..1cce191 100755 --- a/src/spong-status.pl +++ b/src/spong-status.pl @@ -11,6 +11,7 @@ use FileHandle; use lib "@@LIBDIR@@"; use Spong::Status; +use Spong::Log; # Load our configuration variables, including the user specified configuration # information (spong.conf, spong.hosts, and spong.groups files). @@ -19,6 +20,7 @@ $|++; $conf_file = "@@ETCDIR@@/spong.conf"; &load_config_files(); # Loads the user specified configuration information +init_logging(); # Initialize the logging for the command # Get the user options and spit back a usage message if they do something silly @@ -138,109 +140,7 @@ sub load_config_files { } } -__END__ +# Output functions -=head1 OPTIONS - -=item B<--help> - -Print the help text - -=item B<--cmd> I - -Command type being sent to B. Defaults to 'status'. - -=item B<--host> I - -Name of the host being reported. - -=item B<--service> I - -Name of the service being reported. - -=item B<--color> - -Status color being reported. COLOR may be ``green'', ``yellow'', or ``red''. - -=item B<--summary> I - -Summary text to be reported. - - -=item B<--ttl> I - -Time to live of status report in seconds. - -=item B<--message> I - -Detailed message text being reported. - -=item B<--file> I - -Detailed message info read from file FILENAME. If FILENAME is S<'-'>, text is -read from stdin. - -=back - -=head1 CONFIGURATION - -=head2 Configuration Files - -B reads the standard spong.conf and spong.conf.EhostE -configuration files. - -=head2 Configuration Variables - -=over - -=item $SPONGSERVER - -The host that at least the L and L -programs are running on. Typically the L program runs on that -host as well. - -=item $SPONG_UPDATE_PORT - -This variable defines the port that the L update process listens -on. If this variable is not defined on the I<$SPONGSERVER> host, the -L update process will not be started. The default value is 1998. - -=back - -=head1 FILES - -F, FhostE> - -=head1 EXAMPLES - - spong-status --cmd status --host www.my-inc.com --service fping --color yellow - --summary "Host contacted. Response time more then 30 ms" - --file /tmp/fping.out - - spong-status --tttl 86400 --message "Backup failed for /usr,/var" page - www.my-inc.com red backup "Backup failed" - -=head1 DEPENDENCIES - -Perl v5.005_03 or greater is required. - -=head1 BUGS - -No know bugs. - -=head1 SEE ALSO - -L, L, L - -=head1 AUTHOR - -Stephen L Johnson > - -=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. +sub error { print STDERR scalar localtime,": $_\n"; }