Monitoring https URLs

Hi,

I try to monitor a certain instagram.com page.

When I configure this options:

  • Virtual host: www.instagram.com
  • Mode of the Check: Check the URL
  • URI to fetch (default is /): /xxxxxxxxxxxx
  • Use SSL/HTTPS for the connection: Use SSL with auto negotiation

I get this error:

HTTP WARNING: HTTP/1.1 400 Bad Request - 250 bytes in 0.114 second response time

Why I didn’t see an a HTTP OK: HTTP/1.1 200 OK ?

What’s the best configuration to monitor an external page?

Thanks in advance

1 Like

Hey,

I’ve tested it and it works on my test system (CEE 2.0.0p23).

Normaly

I normally use the option “Fixed string to expect” so you can be sure, that the page really contains what you are looking for and “redirect” to “warning” to be sure you really check the URI you have configured in the check.
I’m not the expert but for me that worked very well.
As soon as the http-check works you can fine tune it with “page size to expect” or “expected response time”.

Josef

The result:

HTTP OK: HTTP/1.1 301 Moved Permanently - 2417 bytes in 0.143 second response time

seeams work fine.

Whats the eactly command to try via command line in this case? I would like to try the parameter with the option “Fixed string to expect”

For example, found inside the page the name of user; " xxxxxxxxxxxx" or any other string
That’s possible?

yes you can enter any string that is in the body. I don’t know the exact option for the CLI I use the WATO configuration but I suppose that it’s “-s string”. The check_command in CMK is: " ‘-s’ ‘string’ "

whith this command:

OMD[monitor]:~$ /omd/sites/monitor/lib/nagios/plugins/check_http -t 30 -4 -H www.instagram.com -u /instagram -s "instagram"

Output:

HTTP CRITICAL: HTTP/1.1 301 Moved Permanently - string 'instagram' not found on 'http://www.instagram.com:80/instagram' - 284 bytes in 0.040 second response time |time=0.039853s;;;0.000000;30.000000 size=284B;;;0

I didn’t found the “instagram” string

I’m not sure if its handled because of the redirect. I can test this this evening on my system. Why don’t you look after the final page “https://www.instagram.com” because you get redirected to this one if you enter “Login • Instagram”.
You can do this just to test if the string context is working.

Josef

This URL will not work under any circumstances. NonSSL gives no real response.
For all the tests you have to keep in mind that check_http cannot handle any Javascript or other active content. @Josef gave already the right example with an complete URI at the end.

with this command the result is the same. Port 80 not work correctly

/omd/sites/monitor/lib/nagios/plugins/check_http -H www.instagram.com:80 -u /instagram -s "instagram"

The result:

HTTP CRITICAL: HTTP/1.1 301 Moved Permanently - string 'instagram' not found on 'http://www.instagram.com:80/instagram' - 284 bytes in 0.152 second response time |time=0.151503s;;;0.000000;10.000000 size=284B;;;0

Did you activate “follow redirect” ?
Why do you use the :80 ?

Josef

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.