Searching for string on webpage

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
jk111
Posts: 7
Joined: Tue Apr 23, 2019 10:36 am

Searching for string on webpage

Post by jk111 »

I'm attempting to do something I though would be straightforward but I'm not getting it.

I have a company website in AWS that has URL https://mycompany.com/ok which just has the string OK on it.
I'm attempting to use the check_https as follows:

check_http -H mycompany.com --url "/ok" -s "OK" -S but it returns:
HTTP CRITICAL: HTTP/1.1 301 Moved Permanently - string 'OK' not found on https://mycompany.com:443/ok.

I've tried about every combination I can think of to try and get that string but to no avail. When I follow that link I get the "OK" page. Any pointers here?
gwesterman
Posts: 268
Joined: Wed Aug 23, 2023 11:29 am

Re: Searching for string on webpage

Post by gwesterman »

Hi @jk111,

Try adding -f follow.

Let us know if that works or not.

Thank you!
jk111
Posts: 7
Joined: Tue Apr 23, 2019 10:36 am

Re: Searching for string on webpage

Post by jk111 »

I tried it with the -f follow switch and got the error:

CRITICAL - Cannot make SSL connection.
139637063849792:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:ssl/record/rec_layer_s3.c:1544:SSL alert number 40
jk111
Posts: 7
Joined: Tue Apr 23, 2019 10:36 am

Re: Searching for string on webpage

Post by jk111 »

Can anyone help with this?
jk111
Posts: 7
Joined: Tue Apr 23, 2019 10:36 am

Re: Searching for string on webpage

Post by jk111 »

Hello, I keep running into the SSL error over multiple websites. I came across a KB where it said to set update-cryto-policies to LEGACY but that didn't work. I'm really struggling to setup URL monitoring using the check_http. No matter what website I use, I keep running into this.
nagios-dnelson

Re: Searching for string on webpage

Post by nagios-dnelson »

Greetings @jk111!

Are you still experiencing this issue? I just tested the following command on the latest version of XI and it returned without error:

Code: Select all

check_http -H peacefulrock.com -s "Peaceful Rock Productions" -f ok -I 67.205.3.197 -u "/" -S --sni -p 443
Likely, this isn't the same website you were trying against, but I am using a couple of flags that you might not have been. I would suggest adding the -p 443 and the --sni flags first to see if that gets you further in your quest.

If that doesn't work, would you be willing to let me know the name of the site you are trying to test?

-Doug
Post Reply