torrus_action_notify(7)

torrus_action_notify7

Generic notification handler for torrus monitor

Usage

 <action name="notify">
   <param name="action-type" value="exec" />
   <param name="command">
     $TORRUS_BIN/action_notify
   </param>
   <param name="launch-when" value="set" />
 </action>

Overview

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:[email protected]',
                      'mailto:[email protected]' ],
             '5' => [ 'page:1234', 'mailto:[email protected]' ] } } );

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, [email protected] and [email protected] 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

Notes

See more documentation at Torrus home page: http://torrus.org

Releases

10 releases since Debian 4.0 (Etch); the text changed 8 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12–13

Author

Stanislav Sinyagin <[email protected]>

From torrus-common 3.00-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.