<?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: Update 1.3: Apache check plugin for Nagios</title>
	<atom:link href="http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/</link>
	<description>"Look behind you, a Three-Headed Monkey!"</description>
	<lastBuildDate>Tue, 25 May 2010 09:39:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: minzel</title>
		<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/comment-page-1/#comment-6117</link>
		<dc:creator>minzel</dc:creator>
		<pubDate>Sun, 21 Mar 2010 02:14:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.matejunkie.com/?p=1240#comment-6117</guid>
		<description>following should set for httpd.conf:

&lt;code&gt;
ExtendedStatus On

  SetHandler server-status
  Order deny,allow
  Deny from all
  Allow from 127.0.0.1

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>following should set for httpd.conf:</p>
<p><code><br />
ExtendedStatus On</p>
<p>  SetHandler server-status<br />
  Order deny,allow<br />
  Deny from all<br />
  Allow from 127.0.0.1</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Jones</title>
		<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/comment-page-1/#comment-6084</link>
		<dc:creator>Andrew Jones</dc:creator>
		<pubDate>Mon, 15 Mar 2010 10:09:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.matejunkie.com/?p=1240#comment-6084</guid>
		<description>Hi I&#039;m getting something of a similar problem. I get the following error when running : ./check_apache2.sh -H xx.xx.xx -P 80 -t 3 -b /usr/sbin -p /var/run -n httpd.pid -s server-status -S -R -wr 100 -cr 250 

(standard_in) 2: parse error
./check_apache2.sh: line 277: [: too many arguments
./check_apache2.sh: line 281: [: -ge: unary operator expected
OK - Apache serves  Requests per second with an average CPU utilization of 0%. Busy workers: , idle:  &#124; &#039;cpu_load&#039;=0 &#039;req_psec&#039;= &#039;bytes_psec&#039;= &#039;bytes_preq&#039;= &#039;workers_busy&#039;= &#039;workers_idle&#039;=

The output from an sh -x is as follows:

++ basename ./check_apache2.sh
+ PROGNAME=check_apache2.sh
+ VERSION=&#039;Version 1.3,&#039;
+ AUTHOR=&#039;2009, Mike Adolphs (http://www.matejunkie.com/)&#039;
+ ST_OK=0
+ ST_WR=1
+ ST_CR=2
+ ST_UK=3
+ hostname=localhost
+ port=80
+ remote_srv=0
+ path_binary=/usr/sbin
+ path_pid=/var/run
+ name_pid=apache2.pid
+ status_page=server-status
+ timeout=3
+ secure=0
+ running=0
+ wcdiff_req=0
+ wclvls_req=0
+ test -n -H
+ case &quot;$1&quot; in
+ hostname=xx.xx.xx
+ shift
+ shift
+ test -n -P
+ case &quot;$1&quot; in
+ port=80
+ shift
+ shift
+ test -n -t
+ case &quot;$1&quot; in
+ timeout=3
+ shift
+ shift
+ test -n -b
+ case &quot;$1&quot; in
+ path_binary=/usr/sbin
+ shift
+ shift
+ test -n -p
+ case &quot;$1&quot; in
+ path_pid=/var/run
+ shift
+ shift
+ test -n -n
+ case &quot;$1&quot; in
+ name_pid=httpd.pid
+ shift
+ shift
+ test -n -s
+ case &quot;$1&quot; in
+ status_page=server-status
+ shift
+ shift
+ test -n -S
+ case &quot;$1&quot; in
+ secure=1
+ shift
+ test -n -R
+ case &quot;$1&quot; in
+ remote_srv=1
+ shift
+ test -n -wr
+ case &quot;$1&quot; in
+ warn_req=100
+ shift
+ shift
+ test -n -cr
+ case &quot;$1&quot; in
+ crit_req=250
+ shift
+ shift
+ test -n &#039;&#039;
+ val_wcdiff_req
+ &#039;[&#039; &#039;!&#039; -z 100 -a &#039;!&#039; -z 250 &#039;]&#039;
+ wclvls_req=1
+ &#039;[&#039; 100 -gt 250 &#039;]&#039;
+ &#039;[&#039; 0 = 1 &#039;]&#039;
+ &#039;[&#039; 0 = 2 &#039;]&#039;
+ &#039;[&#039; 0 = 3 &#039;]&#039;
+ &#039;[&#039; 1 = 0 &#039;]&#039;
+ get_status
+ &#039;[&#039; 1 = 1 &#039;]&#039;
++ wget -qO- --no-check-certificate -t 3 -T 3 &#039;https://xx.xx.xx:80/server-status?auto&#039;
+ server_status1=
+ sleep 1
++ wget -qO- --no-check-certificate -t 3 -T 3 &#039;https://xx.xx.xx:80/server-status?auto&#039;
+ server_status2=
+ get_vals
++ cpu_load=0
++ ps -Ao pcpu,args
++ grep /usr/sbin/apache2
++ awk &#039;{print $1}&#039;
++ read line
+++ echo &#039;scale=3; 0 + 0.0&#039;
+++ bc -l
++ cpu_load=0
++ echo 0
++ read line
+ cpu_load=0
++ echo 0
++ awk &#039;{print $NF}&#039;
++ sed &#039;s/^\./0./&#039;
+ cpu_load=0
++ echo
++ awk &#039;{print $3}&#039;
+ tmp1_req_psec=
++ echo
++ awk &#039;{print $3}&#039;
+ tmp2_req_psec=
++ echo &#039;scale=2;  - &#039;
++ bc -l
++ sed &#039;s/^\./0./&#039;
(standard_in) 2: parse error
+ req_psec=
++ echo
++ sed &#039;s/^\./0./&#039;
++ awk &#039;{print $14}&#039;
+ bytes_psec=
++ echo
++ awk &#039;{print $16}&#039;
++ sed &#039;s/^\./0./&#039;
+ bytes_preq=
++ echo
++ awk &#039;{print $18}&#039;
++ sed &#039;s/^\./0./&#039;
+ wkrs_busy=
++ echo
++ awk &#039;{print $20}&#039;
++ sed &#039;s/^\./0./&#039;
+ wkrs_idle=
+ do_output
+ output=&#039;Apache serves  Requests per second with an average CPU utilization of 0%. Busy workers: , idle: &#039;
+ do_perfdata
+ perfdata=&#039;&#039;\&#039;&#039;cpu_load&#039;\&#039;&#039;=0 &#039;\&#039;&#039;req_psec&#039;\&#039;&#039;= &#039;\&#039;&#039;bytes_psec&#039;\&#039;&#039;= &#039;\&#039;&#039;bytes_preq&#039;\&#039;&#039;= &#039;\&#039;&#039;workers_busy&#039;\&#039;&#039;= &#039;\&#039;&#039;workers_idle&#039;\&#039;&#039;=&#039;
+ &#039;[&#039; 1 = 1 &#039;]&#039;
+ &#039;[&#039; -ge 100 -a -lt 250 &#039;]&#039;
./check_apache2.sh: line 277: [: too many arguments
+ &#039;[&#039; -ge 250 &#039;]&#039;
./check_apache2.sh: line 281: [: -ge: unary operator expected
+ echo &#039;OK - Apache serves  Requests per second with an average CPU utilization of 0%. Busy workers: , idle:  &#124; &#039;\&#039;&#039;cpu_load&#039;\&#039;&#039;=0 &#039;\&#039;&#039;req_psec&#039;\&#039;&#039;= &#039;\&#039;&#039;bytes_psec&#039;\&#039;&#039;= &#039;\&#039;&#039;bytes_preq&#039;\&#039;&#039;= &#039;\&#039;&#039;workers_busy&#039;\&#039;&#039;= &#039;\&#039;&#039;workers_idle&#039;\&#039;&#039;=&#039;
+ exit 0</description>
		<content:encoded><![CDATA[<p>Hi I&#8217;m getting something of a similar problem. I get the following error when running : ./check_apache2.sh -H xx.xx.xx -P 80 -t 3 -b /usr/sbin -p /var/run -n httpd.pid -s server-status -S -R -wr 100 -cr 250 </p>
<p>(standard_in) 2: parse error<br />
./check_apache2.sh: line 277: [: too many arguments<br />
./check_apache2.sh: line 281: [: -ge: unary operator expected<br />
OK - Apache serves  Requests per second with an average CPU utilization of 0%. Busy workers: , idle:  | 'cpu_load'=0 'req_psec'= 'bytes_psec'= 'bytes_preq'= 'workers_busy'= 'workers_idle'=</p>
<p>The output from an sh -x is as follows:</p>
<p>++ basename ./check_apache2.sh<br />
+ PROGNAME=check_apache2.sh<br />
+ VERSION='Version 1.3,'<br />
+ AUTHOR='2009, Mike Adolphs (<a href="http://www.matejunkie.com/)" rel="nofollow">http://www.matejunkie.com/)</a>'<br />
+ ST_OK=0<br />
+ ST_WR=1<br />
+ ST_CR=2<br />
+ ST_UK=3<br />
+ hostname=localhost<br />
+ port=80<br />
+ remote_srv=0<br />
+ path_binary=/usr/sbin<br />
+ path_pid=/var/run<br />
+ name_pid=apache2.pid<br />
+ status_page=server-status<br />
+ timeout=3<br />
+ secure=0<br />
+ running=0<br />
+ wcdiff_req=0<br />
+ wclvls_req=0<br />
+ test -n -H<br />
+ case "$1" in<br />
+ hostname=xx.xx.xx<br />
+ shift<br />
+ shift<br />
+ test -n -P<br />
+ case "$1" in<br />
+ port=80<br />
+ shift<br />
+ shift<br />
+ test -n -t<br />
+ case "$1" in<br />
+ timeout=3<br />
+ shift<br />
+ shift<br />
+ test -n -b<br />
+ case "$1" in<br />
+ path_binary=/usr/sbin<br />
+ shift<br />
+ shift<br />
+ test -n -p<br />
+ case "$1" in<br />
+ path_pid=/var/run<br />
+ shift<br />
+ shift<br />
+ test -n -n<br />
+ case "$1" in<br />
+ name_pid=httpd.pid<br />
+ shift<br />
+ shift<br />
+ test -n -s<br />
+ case "$1" in<br />
+ status_page=server-status<br />
+ shift<br />
+ shift<br />
+ test -n -S<br />
+ case "$1" in<br />
+ secure=1<br />
+ shift<br />
+ test -n -R<br />
+ case "$1" in<br />
+ remote_srv=1<br />
+ shift<br />
+ test -n -wr<br />
+ case "$1" in<br />
+ warn_req=100<br />
+ shift<br />
+ shift<br />
+ test -n -cr<br />
+ case "$1" in<br />
+ crit_req=250<br />
+ shift<br />
+ shift<br />
+ test -n ''<br />
+ val_wcdiff_req<br />
+ '[' '!' -z 100 -a '!' -z 250 ']&#8216;<br />
+ wclvls_req=1<br />
+ &#8216;[' 100 -gt 250 ']&#8216;<br />
+ &#8216;[' 0 = 1 ']&#8216;<br />
+ &#8216;[' 0 = 2 ']&#8216;<br />
+ &#8216;[' 0 = 3 ']&#8216;<br />
+ &#8216;[' 1 = 0 ']&#8216;<br />
+ get_status<br />
+ &#8216;[' 1 = 1 ']&#8216;<br />
++ wget -qO- &#8211;no-check-certificate -t 3 -T 3 &#8216;https://xx.xx.xx:80/server-status?auto&#8217;<br />
+ server_status1=<br />
+ sleep 1<br />
++ wget -qO- &#8211;no-check-certificate -t 3 -T 3 &#8216;https://xx.xx.xx:80/server-status?auto&#8217;<br />
+ server_status2=<br />
+ get_vals<br />
++ cpu_load=0<br />
++ ps -Ao pcpu,args<br />
++ grep /usr/sbin/apache2<br />
++ awk &#8216;{print $1}&#8217;<br />
++ read line<br />
+++ echo &#8216;scale=3; 0 + 0.0&#8242;<br />
+++ bc -l<br />
++ cpu_load=0<br />
++ echo 0<br />
++ read line<br />
+ cpu_load=0<br />
++ echo 0<br />
++ awk &#8216;{print $NF}&#8217;<br />
++ sed &#8216;s/^\./0./&#8217;<br />
+ cpu_load=0<br />
++ echo<br />
++ awk &#8216;{print $3}&#8217;<br />
+ tmp1_req_psec=<br />
++ echo<br />
++ awk &#8216;{print $3}&#8217;<br />
+ tmp2_req_psec=<br />
++ echo &#8216;scale=2;  &#8211; &#8216;<br />
++ bc -l<br />
++ sed &#8216;s/^\./0./&#8217;<br />
(standard_in) 2: parse error<br />
+ req_psec=<br />
++ echo<br />
++ sed &#8216;s/^\./0./&#8217;<br />
++ awk &#8216;{print $14}&#8217;<br />
+ bytes_psec=<br />
++ echo<br />
++ awk &#8216;{print $16}&#8217;<br />
++ sed &#8216;s/^\./0./&#8217;<br />
+ bytes_preq=<br />
++ echo<br />
++ awk &#8216;{print $18}&#8217;<br />
++ sed &#8216;s/^\./0./&#8217;<br />
+ wkrs_busy=<br />
++ echo<br />
++ awk &#8216;{print $20}&#8217;<br />
++ sed &#8216;s/^\./0./&#8217;<br />
+ wkrs_idle=<br />
+ do_output<br />
+ output=&#8217;Apache serves  Requests per second with an average CPU utilization of 0%. Busy workers: , idle: &#8216;<br />
+ do_perfdata<br />
+ perfdata=&#8221;\&#8221;cpu_load&#8217;\&#8221;=0 &#8216;\&#8221;req_psec&#8217;\&#8221;= &#8216;\&#8221;bytes_psec&#8217;\&#8221;= &#8216;\&#8221;bytes_preq&#8217;\&#8221;= &#8216;\&#8221;workers_busy&#8217;\&#8221;= &#8216;\&#8221;workers_idle&#8217;\&#8221;=&#8217;<br />
+ &#8216;[' 1 = 1 ']&#8216;<br />
+ &#8216;[' -ge 100 -a -lt 250 ']&#8216;<br />
./check_apache2.sh: line 277: [: too many arguments<br />
+ '[' -ge 250 ']&#8216;<br />
./check_apache2.sh: line 281: [: -ge: unary operator expected<br />
+ echo &#8216;OK &#8211; Apache serves  Requests per second with an average CPU utilization of 0%. Busy workers: , idle:  | &#8216;\&#8221;cpu_load&#8217;\&#8221;=0 &#8216;\&#8221;req_psec&#8217;\&#8221;= &#8216;\&#8221;bytes_psec&#8217;\&#8221;= &#8216;\&#8221;bytes_preq&#8217;\&#8221;= &#8216;\&#8221;workers_busy&#8217;\&#8221;= &#8216;\&#8221;workers_idle&#8217;\&#8221;=&#8217;<br />
+ exit 0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/comment-page-1/#comment-5396</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 16 Dec 2009 19:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.matejunkie.com/?p=1240#comment-5396</guid>
		<description>Nevermind, I figured it out.  I had to put ExtendedStatus On in my httpd.conf.  This should help the others with this issue.

Thanks,
Jason</description>
		<content:encoded><![CDATA[<p>Nevermind, I figured it out.  I had to put ExtendedStatus On in my httpd.conf.  This should help the others with this issue.</p>
<p>Thanks,<br />
Jason</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/comment-page-1/#comment-5394</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 16 Dec 2009 18:45:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.matejunkie.com/?p=1240#comment-5394</guid>
		<description>I&#039;m getting the same error with regards to the illegal character.  It&#039;s a CentOS5 box.  I have bc installed. 

Here is the output of the script.

[root@FDT-CLEMGT031 libexec]# sh -x ./check_apache2.sh -H 10.1.10.33 -P 80 -t 10 -b /usr/local/apache2/bin -p /usr/local/apache2/logs -n httpd.pid -s server-status
++ basename ./check_apache2.sh
+ PROGNAME=check_apache2.sh
+ VERSION=&#039;Version 1.3,&#039;
+ AUTHOR=&#039;2009, Mike Adolphs (http://www.matejunkie.com/)&#039;
+ ST_OK=0
+ ST_WR=1
+ ST_CR=2
+ ST_UK=3
+ hostname=localhost
+ port=80
+ remote_srv=0
+ path_binary=/usr/sbin
+ path_pid=/var/run
+ name_pid=apache2.pid
+ status_page=server-status
+ timeout=3
+ secure=0
+ running=0
+ wcdiff_req=0
+ wclvls_req=0
+ test -n -H
+ case &quot;$1&quot; in
+ hostname=10.1.10.33
+ shift
+ shift
+ test -n -P
+ case &quot;$1&quot; in
+ port=80
+ shift
+ shift
+ test -n -t
+ case &quot;$1&quot; in
+ timeout=10
+ shift
+ shift
+ test -n -b
+ case &quot;$1&quot; in
+ path_binary=/usr/local/apache2/bin
+ shift
+ shift
+ test -n -p
+ case &quot;$1&quot; in
+ path_pid=/usr/local/apache2/logs
+ shift
+ shift
+ test -n -n
+ case &quot;$1&quot; in
+ name_pid=httpd.pid
+ shift
+ shift
+ test -n -s
+ case &quot;$1&quot; in
+ status_page=server-status
+ shift
+ shift
+ test -n &#039;&#039;
+ val_wcdiff_req
+ &#039;[&#039; &#039;!&#039; -z &#039;&#039; -a &#039;!&#039; -z &#039;&#039; &#039;]&#039;
+ &#039;[&#039; &#039;!&#039; -z &#039;&#039; -a -z &#039;&#039; &#039;]&#039;
+ &#039;[&#039; -z &#039;&#039; -a &#039;!&#039; -z &#039;&#039; &#039;]&#039;
+ &#039;[&#039; 0 = 1 &#039;]&#039;
+ &#039;[&#039; 0 = 2 &#039;]&#039;
+ &#039;[&#039; 0 = 3 &#039;]&#039;
+ &#039;[&#039; 0 = 0 &#039;]&#039;
++ check_pid
++ &#039;[&#039; -f /usr/local/apache2/logs/httpd.pid &#039;]&#039;
++ retval=0
+ running=
+ check_pid
+ &#039;[&#039; -f /usr/local/apache2/logs/httpd.pid &#039;]&#039;
+ retval=0
+ get_status
+ &#039;[&#039; 0 = 1 &#039;]&#039;
++ wget -qO- -t 3 -T 10 &#039;http://10.1.10.33:80/server-status?auto&#039;
+ server_status1=&#039;BusyWorkers: 1
IdleWorkers: 7
Scoreboard: _______W........................................................................................................................................................................................................................................................&#039;
+ sleep 1
++ wget -qO- -t 3 -T 10 &#039;http://10.1.10.33:80/server-status?auto&#039;
+ server_status2=&#039;BusyWorkers: 1
IdleWorkers: 7
Scoreboard: _W______........................................................................................................................................................................................................................................................&#039;
+ get_vals
++ cpu_load=0
++ ps -Ao pcpu,args
++ grep /usr/local/apache2/bin/httpd
++ awk &#039;{print $1}&#039;
++ read line
+ cpu_load=
++ echo
++ awk &#039;{print $NF}&#039;
++ sed &#039;s/^\./0./&#039;
+ cpu_load=
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W........................................................................................................................................................................................................................................................
++ awk &#039;{print $3}&#039;
+ tmp1_req_psec=IdleWorkers:
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _W______........................................................................................................................................................................................................................................................
++ awk &#039;{print $3}&#039;
+ tmp2_req_psec=IdleWorkers:
++ echo &#039;scale=2; IdleWorkers: - IdleWorkers:&#039;
++ bc -l
(standard_in) 1: illegal character: I
(standard_in) 1: illegal character: W
(standard_in) 1: parse error
(standard_in) 1: illegal character: :
(standard_in) 1: illegal character: I
(standard_in) 1: illegal character: W
(standard_in) 1: parse error
(standard_in) 1: illegal character: :
++ sed &#039;s/^\./0./&#039;
+ req_psec=
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W........................................................................................................................................................................................................................................................
++ awk &#039;{print $14}&#039;
++ sed &#039;s/^\./0./&#039;
+ bytes_psec=
++ awk &#039;{print $16}&#039;
++ sed &#039;s/^\./0./&#039;
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W........................................................................................................................................................................................................................................................
+ bytes_preq=
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W........................................................................................................................................................................................................................................................
++ awk &#039;{print $18}&#039;
++ sed &#039;s/^\./0./&#039;
+ wkrs_busy=
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W........................................................................................................................................................................................................................................................
++ awk &#039;{print $20}&#039;
++ sed &#039;s/^\./0./&#039;
+ wkrs_idle=
+ do_output
+ output=&#039;Apache serves  Requests per second with an average CPU utilization of %. Busy workers: , idle: &#039;
+ do_perfdata
+ perfdata=&#039;&#039;\&#039;&#039;cpu_load&#039;\&#039;&#039;= &#039;\&#039;&#039;req_psec&#039;\&#039;&#039;= &#039;\&#039;&#039;bytes_psec&#039;\&#039;&#039;= &#039;\&#039;&#039;bytes_preq&#039;\&#039;&#039;= &#039;\&#039;&#039;workers_busy&#039;\&#039;&#039;= &#039;\&#039;&#039;workers_idle&#039;\&#039;&#039;=&#039;
+ &#039;[&#039; 0 = 1 &#039;]&#039;
+ echo &#039;OK - Apache serves  Requests per second with an average CPU utilization of %. Busy workers: , idle:  &#124; &#039;\&#039;&#039;cpu_load&#039;\&#039;&#039;= &#039;\&#039;&#039;req_psec&#039;\&#039;&#039;= &#039;\&#039;&#039;bytes_psec&#039;\&#039;&#039;= &#039;\&#039;&#039;bytes_preq&#039;\&#039;&#039;= &#039;\&#039;&#039;workers_busy&#039;\&#039;&#039;= &#039;\&#039;&#039;workers_idle&#039;\&#039;&#039;=&#039;
OK - Apache serves  Requests per second with an average CPU utilization of %. Busy workers: , idle:  &#124; &#039;cpu_load&#039;= &#039;req_psec&#039;= &#039;bytes_psec&#039;= &#039;bytes_preq&#039;= &#039;workers_busy&#039;= &#039;workers_idle&#039;=
+ exit 0
[root@FDT-CLEMGT031 libexec]#</description>
		<content:encoded><![CDATA[<p>I&#8217;m getting the same error with regards to the illegal character.  It&#8217;s a CentOS5 box.  I have bc installed. </p>
<p>Here is the output of the script.</p>
<p>[root@FDT-CLEMGT031 libexec]# sh -x ./check_apache2.sh -H 10.1.10.33 -P 80 -t 10 -b /usr/local/apache2/bin -p /usr/local/apache2/logs -n httpd.pid -s server-status<br />
++ basename ./check_apache2.sh<br />
+ PROGNAME=check_apache2.sh<br />
+ VERSION=&#8217;Version 1.3,&#8217;<br />
+ AUTHOR=&#8217;2009, Mike Adolphs (<a href="http://www.matejunkie.com/)" rel="nofollow">http://www.matejunkie.com/)</a>&#8216;<br />
+ ST_OK=0<br />
+ ST_WR=1<br />
+ ST_CR=2<br />
+ ST_UK=3<br />
+ hostname=localhost<br />
+ port=80<br />
+ remote_srv=0<br />
+ path_binary=/usr/sbin<br />
+ path_pid=/var/run<br />
+ name_pid=apache2.pid<br />
+ status_page=server-status<br />
+ timeout=3<br />
+ secure=0<br />
+ running=0<br />
+ wcdiff_req=0<br />
+ wclvls_req=0<br />
+ test -n -H<br />
+ case &#8220;$1&#8243; in<br />
+ hostname=10.1.10.33<br />
+ shift<br />
+ shift<br />
+ test -n -P<br />
+ case &#8220;$1&#8243; in<br />
+ port=80<br />
+ shift<br />
+ shift<br />
+ test -n -t<br />
+ case &#8220;$1&#8243; in<br />
+ timeout=10<br />
+ shift<br />
+ shift<br />
+ test -n -b<br />
+ case &#8220;$1&#8243; in<br />
+ path_binary=/usr/local/apache2/bin<br />
+ shift<br />
+ shift<br />
+ test -n -p<br />
+ case &#8220;$1&#8243; in<br />
+ path_pid=/usr/local/apache2/logs<br />
+ shift<br />
+ shift<br />
+ test -n -n<br />
+ case &#8220;$1&#8243; in<br />
+ name_pid=httpd.pid<br />
+ shift<br />
+ shift<br />
+ test -n -s<br />
+ case &#8220;$1&#8243; in<br />
+ status_page=server-status<br />
+ shift<br />
+ shift<br />
+ test -n &#8221;<br />
+ val_wcdiff_req<br />
+ &#8216;[' '!' -z '' -a '!' -z '' ']&#8216;<br />
+ &#8216;[' '!' -z '' -a -z '' ']&#8216;<br />
+ &#8216;[' -z '' -a '!' -z '' ']&#8216;<br />
+ &#8216;[' 0 = 1 ']&#8216;<br />
+ &#8216;[' 0 = 2 ']&#8216;<br />
+ &#8216;[' 0 = 3 ']&#8216;<br />
+ &#8216;[' 0 = 0 ']&#8216;<br />
++ check_pid<br />
++ &#8216;[' -f /usr/local/apache2/logs/httpd.pid ']&#8216;<br />
++ retval=0<br />
+ running=<br />
+ check_pid<br />
+ &#8216;[' -f /usr/local/apache2/logs/httpd.pid ']&#8216;<br />
+ retval=0<br />
+ get_status<br />
+ &#8216;[' 0 = 1 ']&#8216;<br />
++ wget -qO- -t 3 -T 10 &#8216;http://10.1.10.33:80/server-status?auto&#8217;<br />
+ server_status1=&#8217;BusyWorkers: 1<br />
IdleWorkers: 7<br />
Scoreboard: _______W&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..&#8217;<br />
+ sleep 1<br />
++ wget -qO- -t 3 -T 10 &#8216;http://10.1.10.33:80/server-status?auto&#8217;<br />
+ server_status2=&#8217;BusyWorkers: 1<br />
IdleWorkers: 7<br />
Scoreboard: _W______&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..&#8217;<br />
+ get_vals<br />
++ cpu_load=0<br />
++ ps -Ao pcpu,args<br />
++ grep /usr/local/apache2/bin/httpd<br />
++ awk &#8216;{print $1}&#8217;<br />
++ read line<br />
+ cpu_load=<br />
++ echo<br />
++ awk &#8216;{print $NF}&#8217;<br />
++ sed &#8216;s/^\./0./&#8217;<br />
+ cpu_load=<br />
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
++ awk &#8216;{print $3}&#8217;<br />
+ tmp1_req_psec=IdleWorkers:<br />
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _W______&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
++ awk &#8216;{print $3}&#8217;<br />
+ tmp2_req_psec=IdleWorkers:<br />
++ echo &#8216;scale=2; IdleWorkers: &#8211; IdleWorkers:&#8217;<br />
++ bc -l<br />
(standard_in) 1: illegal character: I<br />
(standard_in) 1: illegal character: W<br />
(standard_in) 1: parse error<br />
(standard_in) 1: illegal character: :<br />
(standard_in) 1: illegal character: I<br />
(standard_in) 1: illegal character: W<br />
(standard_in) 1: parse error<br />
(standard_in) 1: illegal character: :<br />
++ sed &#8216;s/^\./0./&#8217;<br />
+ req_psec=<br />
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
++ awk &#8216;{print $14}&#8217;<br />
++ sed &#8216;s/^\./0./&#8217;<br />
+ bytes_psec=<br />
++ awk &#8216;{print $16}&#8217;<br />
++ sed &#8216;s/^\./0./&#8217;<br />
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
+ bytes_preq=<br />
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
++ awk &#8216;{print $18}&#8217;<br />
++ sed &#8216;s/^\./0./&#8217;<br />
+ wkrs_busy=<br />
++ echo BusyWorkers: 1 IdleWorkers: 7 Scoreboard: _______W&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
++ awk &#8216;{print $20}&#8217;<br />
++ sed &#8216;s/^\./0./&#8217;<br />
+ wkrs_idle=<br />
+ do_output<br />
+ output=&#8217;Apache serves  Requests per second with an average CPU utilization of %. Busy workers: , idle: &#8216;<br />
+ do_perfdata<br />
+ perfdata=&#8221;\&#8221;cpu_load&#8217;\&#8221;= &#8216;\&#8221;req_psec&#8217;\&#8221;= &#8216;\&#8221;bytes_psec&#8217;\&#8221;= &#8216;\&#8221;bytes_preq&#8217;\&#8221;= &#8216;\&#8221;workers_busy&#8217;\&#8221;= &#8216;\&#8221;workers_idle&#8217;\&#8221;=&#8217;<br />
+ &#8216;[' 0 = 1 ']&#8216;<br />
+ echo &#8216;OK &#8211; Apache serves  Requests per second with an average CPU utilization of %. Busy workers: , idle:  | &#8216;\&#8221;cpu_load&#8217;\&#8221;= &#8216;\&#8221;req_psec&#8217;\&#8221;= &#8216;\&#8221;bytes_psec&#8217;\&#8221;= &#8216;\&#8221;bytes_preq&#8217;\&#8221;= &#8216;\&#8221;workers_busy&#8217;\&#8221;= &#8216;\&#8221;workers_idle&#8217;\&#8221;=&#8217;<br />
OK &#8211; Apache serves  Requests per second with an average CPU utilization of %. Busy workers: , idle:  | &#8216;cpu_load&#8217;= &#8216;req_psec&#8217;= &#8216;bytes_psec&#8217;= &#8216;bytes_preq&#8217;= &#8216;workers_busy&#8217;= &#8216;workers_idle&#8217;=<br />
+ exit 0<br />
[root@FDT-CLEMGT031 libexec]#</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Adolphs</title>
		<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/comment-page-1/#comment-5194</link>
		<dc:creator>Mike Adolphs</dc:creator>
		<pubDate>Thu, 03 Dec 2009 11:28:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.matejunkie.com/?p=1240#comment-5194</guid>
		<description>Please check whether bc is installed. Simply &quot;sudo aptitude install bc&quot; and everything should be fine.

If not, please do an &quot;sh -x check_apache2.sh&quot; and mail me its output. Thanks in advance and sorry for the late response Anton.</description>
		<content:encoded><![CDATA[<p>Please check whether bc is installed. Simply &#8220;sudo aptitude install bc&#8221; and everything should be fine.</p>
<p>If not, please do an &#8220;sh -x check_apache2.sh&#8221; and mail me its output. Thanks in advance and sorry for the late response Anton.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christophe</title>
		<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/comment-page-1/#comment-5193</link>
		<dc:creator>Christophe</dc:creator>
		<pubDate>Thu, 03 Dec 2009 10:59:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.matejunkie.com/?p=1240#comment-5193</guid>
		<description>Hi, 

thank-you first for your plugin.

I have the same error (&quot;(standard_in) 1: illegal character: I ...&quot;) without any change into your code.

FYI the System is an Ubuntu 9.10 Workstation 32 bits on VirtualBox.

Any idea ? Thank-you in advance, Christophe.</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>thank-you first for your plugin.</p>
<p>I have the same error (&#8220;(standard_in) 1: illegal character: I &#8230;&#8221;) without any change into your code.</p>
<p>FYI the System is an Ubuntu 9.10 Workstation 32 bits on VirtualBox.</p>
<p>Any idea ? Thank-you in advance, Christophe.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton</title>
		<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/comment-page-1/#comment-5024</link>
		<dc:creator>Anton</dc:creator>
		<pubDate>Sat, 21 Nov 2009 20:26:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.matejunkie.com/?p=1240#comment-5024</guid>
		<description>Hi!

have a roblem with your plugin : (
have changed parameers insite, they are rigt,get illegaö charter errors

[root@localhost libexec]# ./check_apache2.sh
(standard_in) 1: illegal character: I
(standard_in) 1: illegal character: W
(standard_in) 1: parse error
(standard_in) 1: illegal character: :
(standard_in) 1: illegal character: I
(standard_in) 1: illegal character: W
(standard_in) 1: parse error
(standard_in) 1: illegal character: :
OK - Apache serves  Requests per second with an average CPU utilization of 0%. Busy workers: , idle:  &#124; &#039;cpu_load&#039;=0 &#039;req_psec&#039;= &#039;bytes_psec&#039;= &#039;bytes_preq&#039;= &#039;workers_busy&#039;= &#039;workers_idle&#039;=

Thank you in advance!</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>have a roblem with your plugin : (<br />
have changed parameers insite, they are rigt,get illegaö charter errors</p>
<p>[root@localhost libexec]# ./check_apache2.sh<br />
(standard_in) 1: illegal character: I<br />
(standard_in) 1: illegal character: W<br />
(standard_in) 1: parse error<br />
(standard_in) 1: illegal character: :<br />
(standard_in) 1: illegal character: I<br />
(standard_in) 1: illegal character: W<br />
(standard_in) 1: parse error<br />
(standard_in) 1: illegal character: :<br />
OK &#8211; Apache serves  Requests per second with an average CPU utilization of 0%. Busy workers: , idle:  | &#8216;cpu_load&#8217;=0 &#8216;req_psec&#8217;= &#8216;bytes_psec&#8217;= &#8216;bytes_preq&#8217;= &#8216;workers_busy&#8217;= &#8216;workers_idle&#8217;=</p>
<p>Thank you in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Klaus</title>
		<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/comment-page-1/#comment-4778</link>
		<dc:creator>Klaus</dc:creator>
		<pubDate>Tue, 27 Oct 2009 12:38:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.matejunkie.com/?p=1240#comment-4778</guid>
		<description>On a Slackware System it should be $path_binary/httpd instead of $path_binary/apache2
Correct or incorrect path to pid file makes no difference somehow for me. ;)</description>
		<content:encoded><![CDATA[<p>On a Slackware System it should be $path_binary/httpd instead of $path_binary/apache2<br />
Correct or incorrect path to pid file makes no difference somehow for me. ;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
