check_apachestatus_auto.pl v1.2 released
A Nagios plugin that parses the status page of an apache or lighttpd server, the plugin returns the response time, the amount of idle, busy, open (apache only) and total slots. The perfdata returns the status of all slots including Requests/sec, Bytes/Request and Bytes/sec. Optionally you can specify how much slots should be available. Use http(s) and basic user authentication with non standard server-status urls. This is an enhanced version of an enhanced version of Lieven De Bodt’s check_apachestatus.pl.
Detailed info at http://www.spreendigital.de/blog/nagios/?#check_apachestatus_auto
Whats new
v1.1 Works with lighttpd server-status as well, added accesses perfdata (Lighttpd v1.4.19 tested)
v1.2 Updated perf data to be PNP compliant, added proxy option
Download
check_apachestatus_auto.tgz v1.2
check_apachestatus_auto.php.tgz (PNP template)
4 Comments to check_apachestatus_auto.pl v1.2 released
Hi there, I’ve been trying to set this up to monitor Lighttpd but I’ve been experiencing this weird issue where if I run the command locally as one user, I get the correct output. Any subsequent runs by other users get no output. What’s worse, trying to get the results through NRPE yields a “NRPE: Unable to read output” from check_nrpe.
Do you run this check locally or remotely?
July 27, 2010
Hi There,
I’ve tried to use the check_apachestatus_auto.pl Plugin, but it always fails.
The Check is:
./check_apachestatus_auto.pl –hostname “hostname” –url http://”hostname”/server-status?auto
If I tried it with user root and user nagios out of the bash, all works fine.
If i tried to check it via nrpe or online via nagios, I always becomes a failure:
(Service check did not exit properly)
My output in the bash is:
qsargos01:/opt/nagios/libexec # ./check_apachestatus_auto.pl –hostname qsargos01.total.hosting –url http://argos-test.total.hosting/server-status?auto
APACHE OK – 0.028 sec. response time, Busy/Idle 1/74, open 949/1024, ReqPerSec 0.1, BytesPerReq 1289, BytesPerSec 111|Idle=74 Busy=1 OpenSlots=949 Slots=1024 Starting=0 Reading=0 Sending=1 Keepalive=0 DNS=0 Closing=0 Logging=0 Finishing=0 ReqPerSec=0.086761 BytesPerReq=1289 BytesPerSec=111.918873 Accesses=154qsargos01:/opt/nagios/libexec #
It looks like there is a Problem with the output data. Why there is always this line “qsargos01:/opt/nagios/libexec #” directly behind the output?
Thanks in advance
August 5, 2010
Hello,
Thank you for this update. May I suggest a new change ?
*** mine.pl 2010-08-05 15:34:54.374819435 +0200
— check_apachestatus_auto.pl 2009-07-14 13:04:30.000000000 +0200
*************** use Digest::MD5 qw(md5 md5_hex);
*** 30,36 ****
# Nagios specific
use lib “/usr/local/nagios/libexec”;
- use lib “/usr/lib/nagios/plugins”;
use utils qw(%ERRORS $TIMEOUT);
#my %ERRORS=(‘OK’=>0,’WARNING’=>1,’CRITICAL’=>2,’UNKNOWN’=>3,’DEPENDENT’=>4);
— 30,35 —-
This patch allow your script to work on a debian installation, using debian packages.
August 6, 2010
Hello again,
For the lib, it’s not a problem – perl -I is a good friend.
But I checked how you get Server type… and, well, I think it can be done in a smarter way:
diff -u check_apachestatus_auto.pl check_webserver.pl
— check_apachestatus_auto.pl 2009-07-14 13:04:30.000000000 +0200
+++ check_webserver.pl 2010-08-06 08:58:17.000000000 +0200
@@ -190,6 +190,9 @@
my $webcontent = undef;
if ($response->is_success) {
$webcontent=$response->content;
+ my @t = split(‘/’, $response->header(’server’)) ;
+ $httpserver = $t[0];
+
my $Uptime = 0;
if($webcontent =~ m/Uptime: (.*?)\n/) {
@@ -212,11 +215,8 @@
}
my $BusyWorkers= 0;
- if($webcontent =~ m/(BusyWorkers|BusyServers): (.*?)\n/) {
- $BusyWorkers = $2;
- if ($1 eq ‘BusyServers’) {
- $httpserver = ‘LIGHTTPD’;
- }
+ if($webcontent =~ m/(:?BusyWorkers|BusyServers): (.*?)\n/) {
+ $BusyWorkers = $1;
}
my $IdleWorkers=0;
Leave a comment
About
Recent Posts
- Eclipse on Mac OS X – Workspace error on NFS mounts
- Lua 5.1 for Delphi 2010
- WordPress Plugin – QR Code Tag v1.0
- Favourite Android applications
- Hint: Blank Typo3 installation screen
- How to create an ESXi v4 Whitebox ISO with Windows Tools
- Ext: tt_news – no translation for name of months
- check_apachestatus_auto.pl v1.2 released
- Ext: indexed_search – Disable indexing of meta tags
- nagios_mdaemon_check.exe v1.0 released
Search
Categories
Tags
Archives
Blogroll
Delphi Feeds
- Ingenious!
- Visual Forms 2.0.1 – Delphi XE
- BlackFish SQL Gone in Delphi XE, What About a Replacement?
- Delphi XE Released
- SamplingProfiler v1.7.5
- Castalia 2010.3
- Download links for Delphi XE, C++Builder XE, RAD Studio XE, Delphi Prism XE and RadPHP XE
- Download links for Delphi XE, C++Builder XE, RAD Studio XE, Delphi Prism XE and RadPHP XE
- tMPlayer: a Delphi Video Player
- DelphiLive 2010 blog posts….
I'm an avid programmer working on a variety of platforms in a variety of languages with a wide technical interest.

May 14, 2010