default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / torrus / doc / manpages / torrus_action_notify.pod.in
1 #  Copyright (C) 2006  Stanislav Sinyagin
2 #
3 #  This program is free software; you can redistribute it and/or modify
4 #  it under the terms of the GNU General Public License as published by
5 #  the Free Software Foundation; either version 2 of the License, or
6 #  (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software
15 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
16
17 # $Id: torrus_action_notify.pod.in,v 1.1 2010-12-27 00:04:39 ivan Exp $
18 # Stanislav Sinyagin <ssinyagin@yahoo.com>
19 #
20 #
21
22 =head1 NAME
23
24 action_notify - Generic notification handler for Torrus monitor
25
26 =head1 SYNOPSIS
27
28  <action name="notify">
29    <param name="action-type" value="exec" />
30    <param name="command">
31      $TORRUS_BIN/action_notify
32    </param>
33    <param name="launch-when" value="set" />
34  </action>
35
36 =head1 DESCRIPTION
37
38 This program is designed for usage from a monitor action only. It takes
39 the arguments from environment variables, as described in action-type
40 C<exec> in B<Torrus XML Configuration Guide>. 
41
42 The handler reads its configuration from <notify-siteconfig.pl>, a small
43 Perl file which defines the notification paths for various conditions.
44
45 Example:
46
47   %Torrus::Notify::programs =
48     (
49      'mailto' => '$TORRUS_BIN/action_printemail | /usr/bin/mail $ARG1',
50      'page' => '/usr/bin/echo $TORRUS_NODEPATH:$TORRUS_MONITOR ' .
51      '>> /tmp/monitor.$ARG1.log'
52      );
53
54   %Torrus::Notify::policies =
55     (
56      'CUST_A' => {
57          'match' => sub { $ENV{'TORRUS_P_notify_policy'} eq 'A' },
58          'severity' => {
59              '3' => [ 'mailto:aaa@domain.com',
60                       'mailto:bbb@domain.com' ],
61              '5' => [ 'page:1234', 'mailto:boss@domain.com' ] } } );
62      
63
64 In this example, we define two message handlers: e-mail sender and
65 a dummy replacement for a pager program. Then we define the notification
66 policies. For the customer I<A>, we define the policy so that
67 the parameter C<notify-policy> should match the name C<A>. The parameter
68 is defined in the datasource tree and marks only those leaves
69 that belong to this customer.
70 Then, depending on the monitor severity, different notification
71 paths are defined. For severity values higher or equal 3, aaa@domain.com and
72 bbb@domain.com will receive the email notifications, and for severity
73 higher than or equal 5 all recipients will receive the notification.
74
75 The C<match> argument is a Perl subroutine, and can depend on various
76 parameters, such as time of day or day of the week, the tree name, and so on.
77
78
79 =head1 FILES
80
81 =over 4
82
83 =item F<@siteconfdir@/notify-siteconfig.pl>
84
85 Notification policies configuration
86
87
88 =back
89
90 =head1 SEE ALSO
91
92 L<torrus(@mansec_usercmd@)>
93
94 =head1 NOTES
95
96 See more documentation at Torrus home page: http://torrus.org
97
98 =head1 AUTHOR
99
100 Stanislav Sinyagin E<lt>ssinyagin@yahoo.comE<gt>