{"id":358,"date":"2011-03-14T13:51:23","date_gmt":"2011-03-14T11:51:23","guid":{"rendered":"http:\/\/www.mythryll.com\/?p=358"},"modified":"2011-03-14T14:31:46","modified_gmt":"2011-03-14T12:31:46","slug":"use-proxy-with-nagios-check_http","status":"publish","type":"post","link":"https:\/\/www.mythryll.com\/?p=358","title":{"rendered":"use proxy with nagios check_http"},"content":{"rendered":"<p>The following is an attempt to answer the following question:<br \/>\nI 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.<\/p>\n<p>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:<\/p>\n<ul>\n<li> NTLMAPS created with python<\/li>\n<li> CNTLM created with c<\/li>\n<\/ul>\n<p>Both are available for most linux platforms, ntlmaps may work in windows too, if you install python required files.<br \/>\nHope this works for you.<br \/>\nThe -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&#8217;t work at all combined with the -u (uri) option or may produce confusing results.<br \/>\nThe -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.<br \/>\nYou should probably use something like that:<br \/>\ncheck_http -I ntlmproxyserveradress -p 8080 -u http:\/\/www.cnn.com<br \/>\nYou may also want to search the content just to be sure with the -s option.<br \/>\nBefore you go ahead and use the\u00a0 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.<br \/>\nSo 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.<br \/>\nI have modified the above to look like that:<br \/>\ncheck_http -I ntlmproxyserveraddress -p PROXYPORT -u http:\/\/edition.cnn.com\/ -s &#8220;Home&#8221;;<br \/>\nGood luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-358","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/posts\/358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=358"}],"version-history":[{"count":5,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/posts\/358\/revisions"}],"predecessor-version":[{"id":360,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/posts\/358\/revisions\/360"}],"wp:attachment":[{"href":"https:\/\/www.mythryll.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}