TORRUS_ACTION_PRINTEMAIL(7) torrus TORRUS_ACTION_PRINTEMAIL(7)NAME
action_printemail - A script for sending email from monitor action.
SYNOPSIS
<action name="report-email">
<param name="action-type" value="exec" />
<param name="command">
$TORRUS_BIN/action_printemail | mail alarms@example.com
</param>
<param name="launch-when" value="set, clear" />
</action>
DESCRIPTION
This program is designed for usage from a monitor action only. It takes the arguments from environment variables, as described in action-
type "exec" in Torrus XML Configuration Guide. In addition, some values may be supplied via command-line arguments (see section OPTIONS
below).
Site-specific variables must be specified in the file email-siteconfig.pl. Default values are installed by the first run of "make
install". Subsequent runs of "make install" do not override this file.
OPTIONS --url=GRAPHER-URL
Sets the URL of the grapher CGI script.
--template=TEMPLATE-FILE
Uses given file as a template. The template file must reside in /usr/share/torrus/templates directory. It must be a Template-toolkit
file, with the following variables defined:
tree Tree name
token Leaf token
path Leaf path
url URL for browsing this leaf
ncomment This leaf comment
npcomment Leaf's parent comment
event Event type
monitor Monitor name
mcomment Monitor comment
timestamp Time and date of the event
env(VAR) Environment variable VAR
FILES
/etc/torrus/conf/email-siteconfig.pl
Torrus site email configuration script.
/usr/share/torrus/templates
/etc/torrus/templates
Torrus template directories.
SEE ALSO torrus(8)NOTES
See more documentation at Torrus home page: http://torrus.org
AUTHOR
Stanislav Sinyagin <ssinyagin@yahoo.com>
torrus 2.03 2013-07-26 TORRUS_ACTION_PRINTEMAIL(7)
Check Out this Related Man Page
TORRUS_ACTION_NOTIFY(7) torrus TORRUS_ACTION_NOTIFY(7)NAME
action_notify - Generic notification handler for Torrus monitor
SYNOPSIS
<action name="notify">
<param name="action-type" value="exec" />
<param name="command">
$TORRUS_BIN/action_notify
</param>
<param name="launch-when" value="set" />
</action>
DESCRIPTION
This program is designed for usage from a monitor action only. It takes the arguments from environment variables, as described in action-
type "exec" in Torrus XML Configuration Guide.
The handler reads its configuration from <notify-siteconfig.pl>, a small Perl file which defines the notification paths for various
conditions.
Example:
%Torrus::Notify::programs =
(
'mailto' => '$TORRUS_BIN/action_printemail | /usr/bin/mail $ARG1',
'page' => '/usr/bin/echo $TORRUS_NODEPATH:$TORRUS_MONITOR ' .
'>> /tmp/monitor.$ARG1.log'
);
%Torrus::Notify::policies =
(
'CUST_A' => {
'match' => sub { $ENV{'TORRUS_P_notify_policy'} eq 'A' },
'severity' => {
'3' => [ 'mailto:aaa@domain.com',
'mailto:bbb@domain.com' ],
'5' => [ 'page:1234', 'mailto:boss@domain.com' ] } } );
In this example, we define two message handlers: e-mail sender and a dummy replacement for a pager program. Then we define the notification
policies. For the customer A, we define the policy so that the parameter "notify-policy" should match the name "A". The parameter is
defined in the datasource tree and marks only those leaves that belong to this customer. Then, depending on the monitor severity,
different notification paths are defined. For severity values higher or equal 3, aaa@domain.com and bbb@domain.com will receive the email
notifications, and for severity higher than or equal 5 all recipients will receive the notification.
The "match" argument is a Perl subroutine, and can depend on various parameters, such as time of day or day of the week, the tree name, and
so on.
FILES
/etc/torrus/conf/notify-siteconfig.pl
Notification policies configuration
SEE ALSO torrus(8)NOTES
See more documentation at Torrus home page: http://torrus.org
AUTHOR
Stanislav Sinyagin <ssinyagin@yahoo.com>
torrus 2.03 2013-07-26 TORRUS_ACTION_NOTIFY(7)