check_phpfpm_status: Update to 0.11

This commit is contained in:
Jan Wagner 2016-06-12 15:58:36 +02:00
parent 7eb6cc05d9
commit f7e67c0f74
2 changed files with 18 additions and 11 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl -w
# check_phpfpm_status.pl
# Version : 0.10
# Version : 0.11
# Author : regis.leroy at makina-corpus.com
# based on previous apache status work by Dennis D. Spreen (dennis at spreendigital.de)
# Based on check_apachestatus.pl v1.4 by
@ -23,6 +23,8 @@ use Digest::MD5 qw(md5 md5_hex);
# Nagios specific
# Update Nagios Plugin path according to your platform/installation
use lib "/usr/local/nagios/libexec";
use lib "/usr/local/icinga/libexec";
use lib "/usr/lib/nagios/plugins";
use utils qw($TIMEOUT);
# Globals
@ -49,6 +51,7 @@ my $o_crit_thresold=undef; # critical thresolds entry
my $o_debug= undef; # debug mode
my $o_servername= undef; # ServerName (host header in http request)
my $o_https= undef; # SSL (HTTPS) mode
my $o_verify_hostname= 0; # SSL Hostname verification, False by default
my $TempPath = '/tmp/'; # temp path
my $MaxUptimeDif = 60*30; # Maximum uptime difference (seconds), default 30 minutes
@ -122,6 +125,8 @@ sub help {
-1 for no CRITICAL
-V, --version
prints version number
-x, --verifyhostname
verify hostname from ssl cert, set it to 0 to ignore bad hostname from cert
Note :
3 items can be managed on this check, this is why -w and -c parameters are using 3 values thresolds
@ -163,11 +168,12 @@ sub check_options {
'U:s' => \$o_user, 'user:s' => \$o_user,
'P:s' => \$o_pass, 'pass:s' => \$o_pass,
'r:s' => \$o_realm, 'realm:s' => \$o_realm,
'p:i' => \$o_port, 'port:i' => \$o_port,
'V' => \$o_version, 'version' => \$o_version,
'w=s' => \$o_warn_thresold,'warn=s' => \$o_warn_thresold,
'c=s' => \$o_crit_thresold,'critical=s' => \$o_crit_thresold,
't:i' => \$o_timeout, 'timeout:i' => \$o_timeout,
'p:i' => \$o_port, 'port:i' => \$o_port,
'V' => \$o_version, 'version' => \$o_version,
'w=s' => \$o_warn_thresold, 'warn=s' => \$o_warn_thresold,
'c=s' => \$o_crit_thresold, 'critical=s' => \$o_crit_thresold,
't:i' => \$o_timeout, 'timeout:i' => \$o_timeout,
'x:i' => \$o_verify_hostname, 'verifyhostname:i' => \$o_verify_hostname,
);
if (defined ($o_help)) {
@ -215,7 +221,8 @@ check_options();
my $override_ip = $o_host;
my $ua = LWP::UserAgent->new(
protocols_allowed => ['http', 'https'],
timeout => $o_timeout
timeout => $o_timeout,
ssl_opts => { verify_hostname => $o_verify_hostname }
);
# we need to enforce the HTTP request is made on the Nagios Host IP and
# not on the DNS related IP for that domain
@ -282,7 +289,7 @@ my $PerfData = '';
my $webcontent = undef;
if ($response->is_success) {
$webcontent=$response->decoded_content;
$webcontent=$response->decoded_content( charset_strict=>1, raise_error => 1, alt_charset => 'none' );
if (defined ($o_debug)) {
print "\nDEBUG: HTTP response:";
print $response->status_line;
@ -432,8 +439,8 @@ if ($response->is_success) {
,$MaxActiveProcesses,$MaxChildrenReachedNew
,$ReqPerSec,$ListenQueue,$ListenQueueLen,$MaxListenQueueNew);
$PerfData = sprintf ("Idle=%d;Busy=%d;MaxProcesses=%d;MaxProcessesReach=%d;"
."Queue=%d;MaxQueueReach=%d;QueueLen=%d;ReqPerSec=%f"
$PerfData = sprintf ("Idle=%d Busy=%d MaxProcesses=%d MaxProcessesReach=%d "
."Queue=%d MaxQueueReach=%d QueueLen=%d ReqPerSec=%f"
,($IdleProcesses),($ActiveProcesses),($MaxActiveProcesses)
,($MaxChildrenReachedNew),($ListenQueue),($MaxListenQueueNew)
,($ListenQueueLen),$ReqPerSec);

View file

@ -1,6 +1,6 @@
Homepage: https://raw.github.com/regilero/check_phpfpm_status/master/check_phpfpm_status.pl
Watch: https://raw.github.com/regilero/check_phpfpm_status/master/check_phpfpm_status.pl Version\ :\ ([0-9.]+)
Recommends: libwww-perl, monitoring-plugins-common | nagios-plugins-common
Version: 0.10
Version: 0.11
Uploaders: Jan Wagner <waja@cyconet.org>
Description: plugin to check the fpm-status page report from php-fpm