check_http & ssl

This board serves as an open discussion and support collaboration point for Nagios XI. NOTE: Nagios XI customers should use the Customer Support forum to obtain expedited support.

check_http & ssl

Postby crechet51 » Fri Aug 16, 2019 3:41 am

Hi,

I have a site httpS, which I need to check with check_http and find a line in it that contains a specific word.

I do:
Code: Select all
check_http! -S -s "123"!

As I understand it: S - use https instead of http

I get:
Code: Select all
HTTP CRITICAL: HTTP/1.1 301 Moved Permanently - string '123' not found on 'https://site.com:443/'
crechet51
 
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

Re: check_http & ssl

Postby scottwilkerson » Fri Aug 16, 2019 6:47 am

it looks like the site you are pointing check_http to has a redirect, it would be easiest to set check_http to follow the redirect with the -f follow flag

Code: Select all
check_http! -S -s "123" -f follow!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15796
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_http & ssl

Postby crechet51 » Fri Aug 16, 2019 8:14 am

I set

Code: Select all
check_http!-f -s "123"!

and I get:

Code: Select all
check_http: Invalid onredirect option - -s


:roll:
crechet51
 
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

Re: check_http & ssl

Postby scottwilkerson » Fri Aug 16, 2019 8:27 am

You missed the word follow
Code: Select all
check_http!-f follow -s "123"!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15796
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_http & ssl

Postby crechet51 » Fri Aug 16, 2019 8:48 am

Great! It's works. Thank you.
crechet51
 
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

Re: check_http & ssl

Postby scottwilkerson » Fri Aug 16, 2019 8:51 am

crechet51 wrote:Great! It's works. Thank you.

Great!

Locking
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15796
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios XI

Who is online

Users browsing this forum: No registered users and 3 guests