Permalink
Browse files

CHG: Version to 0.9

CHG: Detect text/html response and exit on CRITICAL (not the good response)
  • Loading branch information...
Régis Leroy
Régis Leroy committed Feb 6, 2012
1 parent c08497b commit 0b70d916d2fd339d39d7d3cddc9ad47cf48d1967
Showing with 10 additions and 2 deletions.
  1. +4 −0 CHANGELOG
  2. +6 −2 check_phpfpm_status.pl
View
@@ -1,3 +1,7 @@
+version 0.9 Beta
+* Added -S/--ssl option
+* Detect text/html response and exit on CRITICAL (not the good response)
+
Version 0.3
* warn and critical thresolds now contains 3 values (minimum idle process, max processes reached, max queue reached)
* fixed max queue reached
View
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
# check_phpfpm_status.pl
-# Version : 0.3
+# Version : 0.9
# 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
@@ -25,7 +25,7 @@
use utils qw($TIMEOUT);
# Globals
-my $Version='0.3';
+my $Version='0.9';
my $Name=$0;
my $o_host = undef; # hostname
@@ -287,9 +287,13 @@ sub check_options {
if (defined ($o_debug)) {
print "\nDEBUG: HTTP response:";
print $response->status_line;
+ print "\n".$response->header('Content-Type');
print "\n";
print $webcontent;
}
+ if ($response->header('Content-Type') =~ m/text\/html/) {
+ nagios_exit($phpfpm,"CRITICAL", "We have a response page for our request, but it's an HTML page, quite certainly not the status report of php-fpm");
+ }
# example of response content expected:
#pool: foobar
#process manager: dynamic

0 comments on commit 0b70d91

Please sign in to comment.