{"id":757,"date":"2020-08-14T15:06:00","date_gmt":"2020-08-14T15:06:00","guid":{"rendered":"https:\/\/www.geekmungus.co.uk\/?p=757"},"modified":"2022-11-05T10:53:18","modified_gmt":"2022-11-05T10:53:18","slug":"using-check_http-to-monitor-cloudflare-websites","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=757","title":{"rendered":"Using check_http to Monitor Cloudflare Websites"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you try to monitor a cloudflare fronted website with NagiosXI check_http you may get this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@wtgc-nagios-01 libexec]# .\/check_http -H www.mysite.com -S\n\nHTTP WARNING: HTTP\/1.1 403 Forbidden - 378 bytes in 0.029 second response time |time=0.028586s;;;0.000000 size=378B;;;0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After much fiddling found that if you formulate the check string as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/check_http -H www.mysite.com -S --sni\n\nHTTP OK: HTTP\/1.1 200 OK - 2175 bytes in 0.556 second response time |time=0.555568s;;;0.000000 size=2175B;;;0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll get a result like this, which is what we want!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need to use this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>--sni<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable SSL\/TLS hostname extension support (SNI)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The SNI is Server Name Indication, you can read about it here, <a href=\"https:\/\/www.google.com\/url?q=https%3A%2F%2Fwww.cloudflare.com%2Fen-gb%2Flearning%2Fssl%2Fwhat-is-sni%2F&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNGz2ocoHra6qxBvr83PWEyqI_d6Ow\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.cloudflare.com\/en-gb\/learning\/ssl\/what-is-sni\/<\/a>, basically a mechanism to improve security by stopping name mis-matching and SSL certificate matching. (put simply).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you try to monitor a cloudflare fronted website with NagiosXI check_http you may get this: After much fiddling found that if you formulate the check string as: You&#8217;ll get a result like this, which is what we want! You need to use this: Enable SSL\/TLS hostname extension support (SNI) The SNI is Server Name &#8230; <a title=\"Using check_http to Monitor Cloudflare Websites\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=757\" aria-label=\"Read more about Using check_http to Monitor Cloudflare Websites\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,16,17],"tags":[],"class_list":["post-757","post","type-post","status-publish","format-standard","hentry","category-linux","category-nagios-and-nagiosxi","category-networking"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=757"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/757\/revisions"}],"predecessor-version":[{"id":1376,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/757\/revisions\/1376"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}