<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: check_apachestatus_auto.pl v1.2 released</title>
	<atom:link href="http://www.spreendigital.de/blog/2009/07/14/check_apachestatus_auto-pl-v1-2-released/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.spreendigital.de/blog/2009/07/14/check_apachestatus_auto-pl-v1-2-released/</link>
	<description>A blog about Delphi programming, web and other technical stuff</description>
	<lastBuildDate>Sat, 04 Sep 2010 13:44:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Cjeanneret</title>
		<link>http://www.spreendigital.de/blog/2009/07/14/check_apachestatus_auto-pl-v1-2-released/comment-page-1/#comment-4371</link>
		<dc:creator>Cjeanneret</dc:creator>
		<pubDate>Fri, 06 Aug 2010 07:01:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.spreendigital.de/blog/?p=245#comment-4371</guid>
		<description>Hello again,

For the lib, it&#039;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-&gt;is_success) {
   $webcontent=$response-&gt;content;
+  my @t = split(&#039;/&#039;, $response-&gt;header(&#039;server&#039;)) ;
+  $httpserver = $t[0];
+
 
   my $Uptime = 0;
        if($webcontent =~ m/Uptime: (.*?)\n/) {
@@ -212,11 +215,8 @@
   }
   
   my $BusyWorkers= 0;
-       if($webcontent =~ m/(BusyWorkers&#124;BusyServers): (.*?)\n/) {
-        $BusyWorkers = $2;
-        if ($1 eq &#039;BusyServers&#039;) {
-                $httpserver = &#039;LIGHTTPD&#039;;
-        }
+       if($webcontent =~ m/(:?BusyWorkers&#124;BusyServers): (.*?)\n/) {
+        $BusyWorkers = $1;
   }
   
   my $IdleWorkers=0;</description>
		<content:encoded><![CDATA[<p>Hello again,</p>
<p>For the lib, it&#8217;s not a problem &#8211; perl -I is a good friend.</p>
<p>But I checked how you get Server type&#8230; and, well, I think it can be done in a smarter way:</p>
<p>diff -u check_apachestatus_auto.pl check_webserver.pl<br />
&#8212; check_apachestatus_auto.pl  2009-07-14 13:04:30.000000000 +0200<br />
+++ check_webserver.pl  2010-08-06 08:58:17.000000000 +0200<br />
@@ -190,6 +190,9 @@<br />
 my $webcontent = undef;<br />
 if ($response-&gt;is_success) {<br />
   $webcontent=$response-&gt;content;<br />
+  my @t = split(&#8216;/&#8217;, $response-&gt;header(&#8217;server&#8217;)) ;<br />
+  $httpserver = $t[0];<br />
+</p>
<p>   my $Uptime = 0;<br />
        if($webcontent =~ m/Uptime: (.*?)\n/) {<br />
@@ -212,11 +215,8 @@<br />
   }</p>
<p>   my $BusyWorkers= 0;<br />
-       if($webcontent =~ m/(BusyWorkers|BusyServers): (.*?)\n/) {<br />
-        $BusyWorkers = $2;<br />
-        if ($1 eq &#8216;BusyServers&#8217;) {<br />
-                $httpserver = &#8216;LIGHTTPD&#8217;;<br />
-        }<br />
+       if($webcontent =~ m/(:?BusyWorkers|BusyServers): (.*?)\n/) {<br />
+        $BusyWorkers = $1;<br />
   }</p>
<p>   my $IdleWorkers=0;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cjeanneret</title>
		<link>http://www.spreendigital.de/blog/2009/07/14/check_apachestatus_auto-pl-v1-2-released/comment-page-1/#comment-4366</link>
		<dc:creator>Cjeanneret</dc:creator>
		<pubDate>Thu, 05 Aug 2010 13:35:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.spreendigital.de/blog/?p=245#comment-4366</guid>
		<description>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 &quot;/usr/local/nagios/libexec&quot;;
- use lib &quot;/usr/lib/nagios/plugins&quot;;
  use utils qw(%ERRORS $TIMEOUT);
  #my %ERRORS=(&#039;OK&#039;=&gt;0,&#039;WARNING&#039;=&gt;1,&#039;CRITICAL&#039;=&gt;2,&#039;UNKNOWN&#039;=&gt;3,&#039;DEPENDENT&#039;=&gt;4);
  
--- 30,35 ----


This patch allow your script to work on a debian installation, using debian packages.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Thank you for this update. May I suggest a new change ?</p>
<p>*** mine.pl     2010-08-05 15:34:54.374819435 +0200<br />
&#8212; check_apachestatus_auto.pl  2009-07-14 13:04:30.000000000 +0200<br />
*************** use Digest::MD5 qw(md5 md5_hex);<br />
*** 30,36 ****<br />
  # Nagios specific</p>
<p>  use lib &#8220;/usr/local/nagios/libexec&#8221;;<br />
- use lib &#8220;/usr/lib/nagios/plugins&#8221;;<br />
  use utils qw(%ERRORS $TIMEOUT);<br />
  #my %ERRORS=(&#8216;OK&#8217;=&gt;0,&#8217;WARNING&#8217;=&gt;1,&#8217;CRITICAL&#8217;=&gt;2,&#8217;UNKNOWN&#8217;=&gt;3,&#8217;DEPENDENT&#8217;=&gt;4);</p>
<p>&#8212; 30,35 &#8212;-</p>
<p>This patch allow your script to work on a debian installation, using debian packages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://www.spreendigital.de/blog/2009/07/14/check_apachestatus_auto-pl-v1-2-released/comment-page-1/#comment-4274</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Tue, 27 Jul 2010 16:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.spreendigital.de/blog/?p=245#comment-4274</guid>
		<description>Hi There,
I&#039;ve tried to use the check_apachestatus_auto.pl Plugin, but it always fails. 
The Check is:
 ./check_apachestatus_auto.pl --hostname &quot;hostname&quot; --url http://&quot;hostname&quot;/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&#124;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 &quot;qsargos01:/opt/nagios/libexec #&quot; directly behind the output?

Thanks in advance</description>
		<content:encoded><![CDATA[<p>Hi There,<br />
I&#8217;ve tried to use the check_apachestatus_auto.pl Plugin, but it always fails.<br />
The Check is:<br />
 ./check_apachestatus_auto.pl &#8211;hostname &#8220;hostname&#8221; &#8211;url http://&#8221;hostname&#8221;/server-status?auto<br />
If I tried it with user root and user nagios out of the bash, all works fine. </p>
<p>If i tried to check it via nrpe or online via nagios, I always becomes a failure:</p>
<p>(Service check did not exit properly)</p>
<p>My output in the bash is:<br />
qsargos01:/opt/nagios/libexec # ./check_apachestatus_auto.pl &#8211;hostname qsargos01.total.hosting &#8211;url <a href="http://argos-test.total.hosting/server-status?auto" rel="nofollow">http://argos-test.total.hosting/server-status?auto</a><br />
APACHE OK &#8211; 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 #</p>
<p>It looks like there is a Problem with the output data. Why there is always this line &#8220;qsargos01:/opt/nagios/libexec #&#8221; directly behind the output?</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: magu</title>
		<link>http://www.spreendigital.de/blog/2009/07/14/check_apachestatus_auto-pl-v1-2-released/comment-page-1/#comment-3727</link>
		<dc:creator>magu</dc:creator>
		<pubDate>Fri, 14 May 2010 02:37:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.spreendigital.de/blog/?p=245#comment-3727</guid>
		<description>Hi there, I&#039;ve been trying to set this up to monitor Lighttpd but I&#039;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&#039;s worse, trying to get the results through NRPE yields a &quot;NRPE: Unable to read output&quot; from check_nrpe.

Do you run this check locally or remotely?</description>
		<content:encoded><![CDATA[<p>Hi there, I&#8217;ve been trying to set this up to monitor Lighttpd but I&#8217;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&#8217;s worse, trying to get the results through NRPE yields a &#8220;NRPE: Unable to read output&#8221; from check_nrpe.</p>
<p>Do you run this check locally or remotely?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
