check_apache_balancer_members: Update to cfa70e2

This commit is contained in:
Jan Wagner 2018-03-15 15:10:56 +01:00
parent 2b07b2053d
commit 36649d7285
4 changed files with 13 additions and 12 deletions

View file

@ -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;

View file

@ -1,6 +1,6 @@
Homepage: https://raw.github.com/mintsoft/check_apache_balancer_members/master/check_apache_balancer_members.pl
Watch: https://github.com/mintsoft/check_apache_balancer_members <a class="commit-tease-sha"[^>]*>\s+([0-9a-f]+)\s+</a>
Recommends: libdata-dump-perl, libweb-scraper-perl, libmonitoring-plugin-perl | libnagios-plugin-perl
Version: a9827f1
Version: cfa70e2
Uploaders: Jan Wagner <waja@cyconet.org>
Description: plugin to monitor Apache2 balancer_manager

View file

@ -7,18 +7,15 @@ Subject: [PATCH] Adding support for Monitoring::Plugin
check_apache_balancer_members.pl | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/check_apache_balancer_members/check_apache_balancer_members b/check_apache_balancer_members/check_apache_balancer_members
index e83ff68..3c811fd 100644
--- a/check_apache_balancer_members/check_apache_balancer_members
+++ b/check_apache_balancer_members/check_apache_balancer_members
@@ -3,10 +3,31 @@
use warnings;
@@ -4,9 +4,30 @@
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(
+sub load_module {
+ my @names = @_;
+ my $module;

View file

@ -1,4 +1,4 @@
check_apache_balancer_members/MonitoringPlugin
check_apache_balancer_members/NagiosPlugins
check_apache_balancer_members/epn
check_ipsec/10_pathes
check_ipsec/15_fix_syntax