NAME
Wubot::Check - perform checks for an instance of a monitor
VERSION
version 0.2_001
SYNOPSIS
use Wubot::Check
DESCRIPTION
This class managed a single instance of a monitor. It initializes the instance of the monitor and performs the check() method. It handles any configuration for the monitor, messages sent by the monitor, and monitor cache data. It also sends any messages produces by the instance through the reactor.
SUBROUTINES/METHODS
- $obj->init( $config );
-
Initialize an instance of a monitor. This is only done once, when the monitoring engine starts up.
Any persisted cache data for the monitor will be read in.
If the monitor plugin defines the 'init' method, that method will be called for the instance.
If the init method produces any messages, they will be sent through the reactor.
The cache data will be written back out after the init() method is called.
- $obj->check( $config )
-
Performs a single check of the monitor instance.
Any updated cache data will first be read in.
The check() method will then be called on the monitor instance. Both the instance configuration and cache data will be passed to the check() method.
An alarm will be set before the check() method is called to cancel the check if it runs longer than the expected time limit. The default timeout is 30 seconds, although this may be configured by setting the 'timeout' parameter in the check config.
If any messages are generated by the check() method, they will be passed through the reactor.
The cache will only be written back out after the check() method completes and the reactor has processed any messages.
- $obj->enqueue_results( $results )
-
Add any messages generated by monitor instances to the reactor queue.
The reactor queue is for use by the separate reactor process. Note that this happens after any reactor rules defined directly on the monitor instance have been run.
The instance plugin class and key field will be added to any messages before adding them to the queue. Each unique monitor instance is defined by the combination of the 'plugin' plus 'key' field. If either 'plugin' or 'key' is already defined, they will not be overwritten. This ensures that results that are produced by one plugin and then collected by another plugin (e.g. on a remote host).
BUGS AND LIMITATIONS
There are no known bugs in this module. Please report problems to VVu@geekfarm.org
Patches are welcome.
AUTHOR
VVu@geekfarm.org
LICENCE AND COPYRIGHT
Copyright (c) 2008, VVu@geekfarm.org All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 356:
You forgot a '=back' before '=head1'