The following is an attempt to answer the following question:
I want to check if a website is up through nagios check_http command. How does it work especially if you want to go through proxy authentication.
The basic authentication for the check_http command is resolved using the -a parameter with user:password and the basic proxy authentication is done with -b option respectively. If you are using an MS-ISA proxy though, the problem is that it probably requires NTLM type authentication so you might never have a chance with it, unless you use an intermediate proxy that does the translation. Two suggestions:
- NTLMAPS created with python
- CNTLM created with c
Both are available for most linux platforms, ntlmaps may work in windows too, if you install python required files.
Hope this works for you.
The -H option is necessary only if you want to use the virtual host name parameter. It is not necessary to do a basic web check and it might also confuse things as it sometimes doesn’t work at all combined with the -u (uri) option or may produce confusing results.
The -I option works as proxy server address if you provide the url or the webserver address on other cases. Think about it like this: you are asking a host in your setup (it may well be the nagios server) to ask your proxy (using a certain port) to check in his turn a url if it is working or not.
You should probably use something like that:
check_http -I ntlmproxyserveradress -p 8080 -u http://www.cnn.com
You may also want to search the content just to be sure with the -s option.
Before you go ahead and use the http://www.cnn.com url, be careful they are redirecting you to another url so you will probably get the answer that is has been moved.
So use the correct url or experiment with the other options in http://nagiosplugins.org/man/check_http in order to follow the redirection and check there.
I have modified the above to look like that:
check_http -I ntlmproxyserveraddress -p PROXYPORT -u http://edition.cnn.com/ -s “Home”;