NOCpulse::Gritch.3pm

Langue: en

Version: 2009-02-24 (fedora - 06/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

NOCpulse::Gritch - Throttled email notification for satellites

SYNOPSIS

   use NOCpulse::Gritch;
 
   my $soapbox = new NOCpulse::Gritch("/var/adm/gripes.db");
 
   # ... Something Bad Happens
 
   $soapbox->gritch($subject, $body);
 
 

DESCRIPTION

This module provides the ability to send time- and count-throttled email.

The module uses three parameters to send notifications: a recipient, a time interval, and a count interval. The first instance of a message is sent immediately, but subsequent instances of the same message are filtered until (1) the configured time interval passes, or (2) the number of filtered messages reaches the configured count interval. (The $subject is used to determine whether a message is ``the same''; differences in the body are ignored.)

SYNTAX

The constructor takes a single argument, the name of a database file to use for keeping track of message counts and the last send time. (The database will be created if it doesn't exist.)

Gritch takes its default configuration parameters from /etc/NOCpulse.ini. The defaults can be overridden with the following methods:

$soapbox->countinterval($count);
Sets the count interval.
$soapbox->timeinterval($time);
Sets the time interval.
$soapbox->recipient($recipient);
Sets the email recipient. $recipient may be an email address, a comma-separated list of email addresses, or an open filehandle.

ESOTERICA

To select a debug level, use $soapbox->setDebug($level). You can print your own debugging statements to the Gritch object's debug stream by using
   $soapbox->dprint($level, $message);
 
 

If you want more control, $soapbox->debug() gives you direct access to the NOCpulse::Debug object.

To inspect the database, use:

   my($lasttime, $count) = $self->get_last($subject);
 
 

Use clear_last() and increment_count() to poke the database.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:
Around line 533:
You forgot a '=back' before '=head1'