check_apache_balancer_members: Update to cfa70e2
This commit is contained in:
parent
2b07b2053d
commit
36649d7285
4 changed files with 13 additions and 12 deletions
|
@ -3,10 +3,10 @@ use strict;
|
|||
use warnings;
|
||||
use LWP::Simple;
|
||||
use Data::Dump qw(dump); #libdata-dump-perl
|
||||
use Nagios::Plugin; #libnagios-plugin-perl
|
||||
use Web::Scraper; #libweb-scraper-perl
|
||||
use Monitoring::Plugin; #libmonitoring-plugin-perl
|
||||
|
||||
my $np = Nagios::Plugin->new(
|
||||
my $np = Monitoring::Plugin->new(
|
||||
usage => '',
|
||||
plugin => $0,
|
||||
shortname => "Balancer Members",
|
||||
|
@ -34,8 +34,10 @@ my $s = scraper {
|
|||
process 'td:nth-of-type(1)', 'worker' => 'TEXT';
|
||||
process 'td:nth-of-type(6)', 'status' => 'TEXT';
|
||||
process 'td:nth-of-type(7)', 'elected' => 'TEXT';
|
||||
process 'td:nth-of-type(8)', 'to' => 'TEXT';
|
||||
process 'td:nth-of-type(9)', 'from' => 'TEXT';
|
||||
process 'td:nth-of-type(8)', 'busy' => 'TEXT';
|
||||
process 'td:nth-of-type(9)', 'load' => 'TEXT';
|
||||
process 'td:nth-of-type(10)', 'to' => 'TEXT';
|
||||
process 'td:nth-of-type(11)', 'from' => 'TEXT';
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -48,6 +50,8 @@ foreach my $member (@{$results->{'members'}})
|
|||
{
|
||||
push @problemMembers, $member->{'worker'} if $member->{'status'} =~ /Err/i;
|
||||
$at_least_one_is_ok = 1 if $member->{'status'} =~ /Ok\s?$/;
|
||||
$np->add_perfdata(label => "elected-$member->{'worker'}", value => $member->{'elected'}, uom => 'c');
|
||||
$np->add_perfdata(label => "busy-$member->{'worker'}", value => $member->{'busy'}, uom => 'rqts');
|
||||
}
|
||||
|
||||
$np->nagios_exit('CRITICAL', "No members are Ok; there is a problem") unless $at_least_one_is_ok;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue