Page 1 of 1

Need Help - Can Nagios follow a "Meta refresh" redirect?

Posted: Tue Dec 15, 2015 3:57 pm
by joe1871
We have a new app that is hadling our web pages in HTML5. I have always monitored the site using check_http. With the latest release of the app that we use, there is a "meta refresh" that is causing check_http to fail. I have tried using the "-f follow" to no success. Anyone tell me how to do this? I cannot monitor these sites, and it is a pretty critical issue for us.

Here is the command we use - masking out sensitive data.

./check_http -H 172.xx.xxx.xxx -v -u /ws/oturl/get?apiKey=-xxxxxxxxxxx -s "/oturl.html?key="

Here is the verbose output following the above command:

http://172.xxx.xxx.xxx:80/ws/oturl/get? ... xxxxxxxxxx is 507 characters
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Server: nginx/1.9.1
Date: Tue, 15 Dec 2015 20:41:54 GMT
Content-Length: 142
Connection: close
Set-Cookie: GWSID=xxxxxxxxxx; expires=Sat, 13 Feb 2016 00:00:00 UTC; path=/;
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
**** CONTENT ****
<HTML><HEAD><META HTTP-EQUIV="refresh" CONTENT="0;URL=/ws/oturl/get?apiKey=xxxxxxxxxxxx"></HEAD><BODY></BODY></HTML>

HTTP CRITICAL: HTTP/1.1 200 OK - string '/oturl.html?key=' not found on 'http://172.xxx.xxx.xxx:80/ws/oturl/get? ... xxxxxxxx"- 507 bytes in 0.004 second response time |time=0.004411s;;;0.000000 size=507B;;;0


Any help, especially quick help, would be incredibly appreciated.

Thanks

Joe

Re: Need Help - Can Nagios follow a "Meta refresh" redirect?

Posted: Tue Dec 15, 2015 4:09 pm
by rkennedy
What version of check_http are you using?

Check with this command -

Code: Select all

./check_http -V

Re: Need Help - Can Nagios follow a "Meta refresh" redirect?

Posted: Tue Dec 15, 2015 4:27 pm
by joe1871
Thanks for responding!

the plugin is check_http v2.0.3 (nagios-plugins 2.0.3)

Re: Need Help - Can Nagios follow a "Meta refresh" redirect?

Posted: Tue Dec 15, 2015 4:38 pm
by tmcdonald
I don't believe this will be possible. check_http doesn't have an HTML or a JavaScript engine built in, so it has no concept of what either of those do. Since the refresh is within an HTML element as opposed to an HTTP header, check_http has no way of knowing what the element does, or even is.

You might have more luck with WebInject: https://github.com/sni/Webinject

But it is not our project so any support we could offer would be based solely on our own experiences with it.