check_http & ssl

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
crechet51
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

check_http & ssl

Post by crechet51 »

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/' 
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http & ssl

Post by scottwilkerson »

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!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
crechet51
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

Re: check_http & ssl

Post by crechet51 »

I set

Code: Select all

check_http!-f -s "123"!
and I get:

Code: Select all

check_http: Invalid onredirect option - -s 
:roll:
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http & ssl

Post by scottwilkerson »

You missed the word follow

Code: Select all

check_http!-f follow -s "123"!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
crechet51
Posts: 24
Joined: Mon Aug 05, 2019 9:41 am

Re: check_http & ssl

Post by crechet51 »

Great! It's works. Thank you.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http & ssl

Post by scottwilkerson »

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

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked