POE::Component::Client::BigBrother - a POE Component for sending Big Brother commands
Version 0.01
use strict; use POE qw< Component::Client::BigBrother >; POE::Session->create( inline_states => { _start => sub { POE::Component::Client::BigBrother->send( host => $bbhost, event => "_result", command_type => "status", command_fields => { host => "front01.domain.net", service => "cpu", color => "red", message => "load average is 105.45", }, ); }, _result => sub { my $result = $_[ARG0]; }, }, );
POE::Component::Client::BigBrother is a POE component which can be used to send commands to a Big Brother server.
This module tries to follow POE::Component::Client::NSCA API whenever possible.
Parameters
host
(mandatory) Big Brother server name
port
(optional) Big Brother server port, default 1984
timeout
(optional) number of seconds to wait for socket timeouts, default is 10
retry
(optional) number of times to retry connecting after an error, default is 2
event
(mandatory) the event handler in your session where the result should be sent
session
(optional) your session name, in case this component is from from within another session
command_type
(mandatory) command type, must be one of status, page, enable, disable, event
status
page
enable
disable
command_fields
(mandatory) command fields, must be a hash reference, with the appropriate fields; see "COMMANDS"
(mandatory) the host name this command applies to
service
(mandatory) the service name this command applies to
color
(mandatory) the color (result) of this command, must be one of: green, yellow, red
green
yellow
red
message
(mandatory) the message body of this command
offset
(optional) the offset of this command
duration
(mandatory) the period of time during which the service is to be disabled
id
(mandatory) the event message ID; should be unique
activation
(optional) the activation time as a Unix timestamp; defaults to the current time
expiration
(optional) the expiration time as a Unix timestamp
escalation
(optional) the escalation time as a Unix timestamp
(mandatory) the color of this event message
escalation_color
title
default
order
persistence
suppress
suppress_id
suppress_if_non_defaults
This event is generated by the component. ARG0 will be a hash reference with the following keys:
ARG0
the hostname given
the message that was sent
context
anything that you specified
success
indicates that the check was successfully sent to the NSCA daemon
error
only exists if something went wrong
(E) The caller did not provide the indicated field for the given command.
(E) The caller did not provide the indicated parameter to the component.
(E) The value of the given session parameter could not be resolved to a running POE session.
(E) An illegal value was given for the command_type parameter.
Sébastien Aperghis-Tramoni, <sebastien at aperghis.net>
<sebastien at aperghis.net>
Please report any bugs or feature requests to bug-poe-component-client-bigbrother at rt.cpan.org, or through the web interface at https://rt.cpan.org/Public/Dist/Display.html?Name=POE-Component-Client-BigBrother. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-poe-component-client-bigbrother at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc POE::Component::Client::BigBrother
You can also look for information at:
RT: CPAN's request tracker
https://rt.cpan.org/Public/Dist/Display.html?Name=POE-Component-Client-BigBrother
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/POE-Component-Client-BigBrother
CPAN Ratings
http://cpanratings.perl.org/d/POE-Component-Client-BigBrother
Search CPAN
http://search.cpan.org/dist/POE-Component-Client-BigBrother/
Copyright 2010 Sébastien Aperghis-Tramoni.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install POE::Component::Client::BigBrother, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::Client::BigBrother
CPAN shell
perl -MCPAN -e shell install POE::Component::Client::BigBrother
For more information on module installation, please visit the detailed CPAN module installation guide.