I just made some small improvements to the check_apache2.sh script. It’s now able to request the server-status page via HTTPS, if the script is called with the -S/–secure option. I didn’t set a different standard port in case of -S, so you have to provide a specific port via -p/–port as well. Please be aware of the fact, that the plugin doesn’t provide any logic to check the server’s SSL certificate.
Feel free to download it from Nagiosexchange or to svn checkout it from svn.matejunkie.com:
user@host ~ $ svn co https://svn.matejunkie.com/svn/nagios-plugins/stable/check_apache/ check_apache/
Heyas,
Strange thing. I run the script, and get the following output-
root@fenix:/usr/local/nagios/libexec# ./check_apache2.sh -e
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
./check_apache2.sh: 321: bc: not found
OK – Apache serves Requests per second with an average CPU utilization of % since 3214 seconds. Amount of workers currently busy: 1, currently idle: 9! | ‘req_psec’= ‘cpu_load’= ‘uptime’=3214 ‘workers_busy’=1 ‘workers_idle’=9 ‘total_req’=858 ‘total_kb’=1159 ‘bytes_psec’=369.264 ‘bytes_preq’=1383.24
Not sure what those errors are referring to. I’m running this on the localhost, which is an Ubuntu server where my Nagios install is located. I figured I’d do a quick test this way first. Any ideas would be greatly appreciated.
Thanks,
Dave
That’ll do the job:
This is nothing extraordinary, although Debian based distributions seem to exclude it in their default installation. More information e.g. in the Wikipedia.
Hi,
There’s a typo in the version downloadable from:
http://exchange.nagios.org/directory/Plugins/Web-Servers/Apache/check_apache2-2Esh/details
Line 140; binary_dir is misspelled… preventing you from being able to use the -b switch.
Hope this helps,
Cheers,
Jim
Hi,
Also, to get the script working I had to add $binary_name as an option.
Your script assumes the binary is called “apache2″ but for a lot of installations apache runs as “httpd”..
Works great now, thanks!
Jim