Net::Peep::Notification - A Peep notification
use Sys::Hostname; use Net::Peep::Notification; $notification = new Net::Peep::Notification; $notification->client($client); # e.g., logparser $notification->message($message); # the notification message $notification->status('info'); # or warn or crit $notification->datetime(time()); # the time in epoch seconds $notification->hostname(hostname()); # the host on which the client runs
This object contains attributes which define a notification. A notification is generated when criteria defined in the Peep configuration file is met, such as when load exceeds 2.5 or a syslog entry indicates a media failure.
None by default.
$LOGGER - A Net::Peep::Log object
new() - The constructor client() - A get/set method to store the name of the client (for example, logparser) which is generating the notification. message() - A get/set method to store the message associated with the notification (for example, "Load is 2.72"). datetime() - A get/set method to store the time at which the notification was generated. The time should be in epoch seconds, such as is returned by the time() function in Perl. status() - A get/set method. Stores one of 'info', 'warn', or 'crit'. hostname() - A get/set method to store the hostname of the client generating the notification.
Collin Starkweather <collin.starkweather@colorado.edu> Copyright (C) 2001
perl(1), Net::Peep, Net::Peep::Notifier
To install Net::Peep, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Peep
CPAN shell
perl -MCPAN -e shell install Net::Peep
For more information on module installation, please visit the detailed CPAN module installation guide.