Redirection not followed by check_http

I’ve installed and configured check_mk raw 1.6.0p8 on Debian 10. I’m monitoring the infrastructure of the Jenkins project and some servers that are inside my own network.

I would like to check the age of a specific file on updates.jenkins.io. In order to check that file, I have configured check_http to follow redirects. However, the check does not seem to follow the redirect.

The service check command that is reported on the check page is:

check_mk_active-http!'-u' '/updates/hudson.tasks.Maven.MavenInstaller.json' '-w' '0.300000' '-c' '0.500000' '--onredirect=follow' '-m' '6000:0' '--sni' '$_HOSTADDRESS_4$'

The output from the check is:

HTTP WARNING: HTTP/1.1 404 Not Found - page size 424 too small - 424 bytes in 0.109 second response time

I thought I might be making a check_mk configuration mistake, so I tried an experiment on a separate computer with the check_http script from monitoring-plugins-2.2. I assume the check_http in check_mk is different, but may have some common ancestry long ago.

When I run the monitoring-plugins check_http script it follows the redirect:

$ plugins/check_http -H updates.jenkins.io -u /updates/hudson.tasks.Maven.MavenInstaller.json -w 0.800000 -c 1.700000 -f follow -m 6000:0
HTTP OK: HTTP/1.1 200 OK - 6753 bytes in 0.406 second response time |time=0.406446s;0.800000;1.700000;0.000000;10.000000 size=6753B;6000;0;0

I see that the check_mk service check is using --onredirect=follow while the script from monitoring-plugin-2.2 is using -f follow.

Any recommendations on the mistake I’ve made and how to correct it?

No responses. I assume that either means that my use case is obscure enough that others are not doing it this way, or I posted to the wrong location.

I’ve had great results using check_mk to monitor my infrastructure and the Jenkins infrastructure. Thanks for a great project!

I assume that should be the same function, so probably not the reason for the different behaviour.

What might explain the difference is calling with the host IP address vs. the host name so the request probably ends up in a different vhost on the server.

BTW, when I try https://updates.jenkins.io/updates/hudson.tasks.Maven.MavenInstaller.json, I do not receive any redirect. Instead the server directly responds with 200 OK and some 6.3K of application/json.

Thanks very much for the suggestion! I had not considered that a request by IP address might return a different response than a request by hostname. I’ll try that. Thanks again!