#!/usr/bin/perl
# ============================================================================
# Copyright (c) 2014 Kevin L. Esteb All Rights Reserved
#
#
# TITLE: xas-alert
#
# FACILITY: XAS
#
# ABSTRACT: This procedure will accept a message on the command line
# and create a XAS alert.
#
# ENVIRONMENT: The XAS Middleware Environment
#
# PARAMETERS:
# --log-type toggles the log type
# --log-facility changes the log facility to use
# --log-file name of the log file
# --help prints out a helpful help message
# --manual prints out the procedures manual
# --version prints out the procedures version
# --debug toggles debug output
# --alerts toggles alert notification
#
# RETURNS:
# 0 - success
# 1 - failure
#
# Version Author Date
# ------- ---------------------------------------------- -----------
# 0.01 Kevin Esteb 21-Dec-2015
#
# ============================================================================
#
use lib "../lib";
main: {
my $app = XAS::Apps::Alert->new(
-throws => 'xas-alert',
-facility => 'systems',
-priority => 'low',
);
exit $app->run();
}
__END__
=head1 NAME
xas-alert - send a XAS alert from the command line
=head1 SYNOPSIS
xas-alert "huston, there is a problem"
options:
--script defines a script name
--facility defines a facility for the message
--priority defined a priority for the message
--help outputs simple help text
--manual outputs the procedures manual
--version outputs the apps version
--debug toogles debugging output
--alerts toogles alert notifications
--log-file name of the log file
--log-type toggles the log type
--log-facility changes the log facility
=head1 DESCRIPTION
This procedure will send an XAS alert from the command line. Useful when you
want to send alerts from scripts.
=head1 OPTIONS AND ARGUMENTS
=over 4
=item B<--script>
Defines a script name. Defaults to 'xas-alert'.
=item B<--facility>
Defines a facility for the message. Defaults to 'low'.
=item B<--priority>
Defines a priority for the message. Defaults to 'systems'.
=item B<--help>
Displays a simple help message.
=item B<--debug>
Turns on debbuging.
=item B<--alerts>
Togggles alert notification.
=item B<--log-type>
Toggles the log type. Defaults to 'console'. Can be 'console', 'file',
'json' or 'syslog'.
=item B<--log-facility>
Toggles the log facilty. Defaults to 'local6'. This follows syslog
convention.
=item B<--log-file>
Optional logfile. When specified the log type is set to 'file'.
=item B<--manual>
The complete documentation.
=item B<--version>
Prints out the apps version
=back
=head1 EXIT CODES
0 - success
1 - failure
=head1 SEE ALSO
=over 4
=item L<XAS|XAS>
=back
=head1 AUTHOR
Kevin L. Esteb, E<lt>kevin@kesteb.usE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (c) 2012-2015 Kevin L. Esteb
This is free software; you can redistribute it and/or modify it under
the terms of the Artistic License 2.0. For details, see the full text
=cut