Page 2 of 2

Re: HTTP URL monitor not working

Posted: Thu Mar 30, 2017 3:32 pm
by mcapra
It's pretty hard to say. On a basic CloudFlare plan, I don't have any problems hitting a test site with check_http (sanitizing with example.com and 1.1.1.1):

Code: Select all

[root@xi-stable ~]# /usr/local/nagios/libexec/check_http -H www.example.com
HTTP OK: HTTP/1.1 200 OK - 10283 bytes in 0.532 second response time |time=0.532148s;;;0.000000 size=10283B;;;0

Code: Select all

[root@xi-stable ~]# dig www.example.com

; <<>> DiG 9.9.4-RedHat-9.9.4-38.el7_3.2 <<>> www.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40490
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 5

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.example.com.      IN      A

;; ANSWER SECTION:
www.example.com. 169   IN      A       1.1.1.1
www.example.com. 169   IN      A       1.1.1.1

;; AUTHORITY SECTION:
example.com.   172669  IN      NS      marek.ns.cloudflare.com.
example.com.   172669  IN      NS      tina.ns.cloudflare.com.

;; ADDITIONAL SECTION:
tina.ns.cloudflare.com. 162776  IN      A       173.245.58.230
tina.ns.cloudflare.com. 162776  IN      AAAA    2400:cb00:2049:1::adf5:3ae6
marek.ns.cloudflare.com. 162776 IN      A       173.245.59.202
marek.ns.cloudflare.com. 162776 IN      AAAA    2400:cb00:2049:1::adf5:3bca

;; Query time: 0 msec
;; SERVER: 192.168.5.2#53(192.168.5.2)
;; WHEN: Thu Mar 30 15:30:09 CDT 2017
;; MSG SIZE  rcvd: 226
But on the surface, it just looks like CloudFlare is, in it's own opinion, doing it's job. It's pretty hard to check on the health of a URL without using HTTP. You could probably create a CNAME entry that's off the CloudFlare grid and run your checks against that, but that sort of defeats the purpose of protecting your sites with CloudFlare since attackers could just as easily use the CNAME as an attack vector unless you have some special web-server configs to only allow the XI machine to connect on the CNAME.

Re: HTTP URL monitor not working

Posted: Thu Mar 30, 2017 4:11 pm
by avandemore
Because cloudflare is pushing a javascript redirect, and the plugin doesn't support it.

You can see here for more information, but you should really pursue this with CloudFlare.

https://superuser.com/questions/888507/ ... navailable