Just a quick and dirty post regarding the Nagios check_http plugin. found a little quirk that kept me scratching my head for some time. I added a new site to my monitoring system and ended up getting a result of
HTTP OK – HTTP/1.1 302 Moved Temporarily – 0.174 second response time |time=0.17
turned out the web hosting provider was redirecting you to the actual content but the check_http plugin does not follow the redirect by default. I corrected the issue by adding “-f follow” switch to the command. This tells the check_http plugin to follow any redirects it encounters.
HTTP OK HTTP/1.1 200 OK – 1.010 second response time |time=1.009625s;;;0.000000 size=12304B;;;0
so your entire command should look like the following:
define service{
use remote-service
host_name [hostname]
service_description HTTP
check_command check_http!-H [domanname] -f follow -s “[String to look for]”
}
The final -s switch is optional but it will help notify you of any unauthorized changes made to the site your monitoring (eg. Hacking attempt).
You’re linking to this page on Nagios Exchange for the check_http plugin, yet there’s no download link anywhere to be found.
theres nothing really to download for this plugin, the check_http plugin is included in your default install, I’m just showing a configuration option I needed to set up to follow redirects.
You are awesome! I’ve been banging my head on a desk for a while with this problem!
Thanks for the hint 😉
awsome