Xymon::Plugin::Server::Dispatch - Xymon plugin dispatcher
use Xymon::Plugin::Server::Dispatch; use YourMonitor; # dispatch to class my $dispatch1 = Xymon::Plugin::Server::Dispatch ->new('test' => 'YourMonitor'); $dispatch1->run; # dispatch to method my $dispatch2 = Xymon::Plugin::Server::Dispatch ->new('test' => new YourMonitor()); $dispatch2->run; # dispatch to CODEREF my $dispatch3 = Xymon::Plugin::Server::Dispatch ->new('test' => sub { ... }); $dispatch3->run;
Create dispatch object for tests and modules.
If testName has wildcard character(like http:*), $test will be ARRAYREF when run method is called.
For every host listed in bb-hosts(Xymon 4.2) or hosts.cfg (Xymon 4.3), following operation is executed.
# if class name is given my $module = YourMonitor->new($host, $test); $module->run; # if object is given $module->run($host, $test); # if CODEREF is given &$code($host, $test);
To install Xymon::Plugin::Server, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Xymon::Plugin::Server
CPAN shell
perl -MCPAN -e shell install Xymon::Plugin::Server
For more information on module installation, please visit the detailed CPAN module installation guide.