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).
$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
}
}
-__END__
+# Output functions
-=head1 OPTIONS
-
-=item B<--help>
-
-Print the help text
-
-=item B<--cmd> I<status|page>
-
-Command type being sent to B<spong-server>. Defaults to 'status'.
-
-=item B<--host> I<NAME>
-
-Name of the host being reported.
-
-=item B<--service> I<NAME>
-
-Name of the service being reported.
-
-=item B<--color> <COLOR>
-
-Status color being reported. COLOR may be ``green'', ``yellow'', or ``red''.
-
-=item B<--summary> I<TEXT>
-
-Summary text to be reported.
-
-
-=item B<--ttl> I<SECONDS>
-
-Time to live of status report in seconds.
-
-=item B<--message> I<TEXT>
-
-Detailed message text being reported.
-
-=item B<--file> I<FILENAME>
-
-Detailed message info read from file FILENAME. If FILENAME is S<'-'>, text is
-read from stdin.
-
-=back
-
-=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-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<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.
+sub error { print STDERR scalar localtime,": $_\n"; }