Page 1 of 1

Can't get check_http to work with a non standard https only port.

Posted: Tue Jun 25, 2024 11:53 am
by rfrance
Can't get check_http to work with a non standard https only port.

Can I please get some advice or guidance about how to resolve this issue so I can monitor a service and its output? Currently my host and services configuration is working. It is just the http portion that I am having trouble with.

Use case:
We have an emulator running on a linux box. The emulator accepts REST requests. it uses port 4567 and accepts only https requests. I want to use Nagios to verify the emulator is up and is serving the right info.

Problem:
All my attempts with check_http result in failure. Output below.

Diagnostic output below: The target device running the emulator is 10.141.82.120

Nagios configuration Info:
Last Updated: Tue Jun 25 16:17:53 UTC 2024
NagiosĀ® Coreā„¢ 4.5.3 - www.nagios.org
Logged in as admin

Fail:
./check_http -I 10.141.82.120 -p 4567
HTTP CRITICAL - Invalid Status Line ()

Fail:
./check_http -I 10.141.82.120 -u /config -p 4567
HTTP CRITICAL - Invalid Status Line ()

Fail, https only:
curl http://10.141.82.120:4567/
curl: (1) Received HTTP/0.9 when not allowed

Successful GET to /: (With this output I know the emulator is running)
curl -k https://10.141.82.120:4567/
Hello, this is ############## emulator version 1.2.2-480ad7d65dcea03181efff38513fd9c6a98c0522!

Successful GET to the URI /config: (With this output I know the emulator is running and is serving the correct info)
curl -k https://10.141.82.120:4567/config
{"###":[{"######":"test75026f7aec24b2781d5287a6f2141e8","###":"8e1412f6a7825d1872b42cea7f62057tset"

Re: Can't get check_http to work with a non standard https only port.

Posted: Tue Jun 25, 2024 1:03 pm
by lgute
Hi @rfrance, thanks for reaching out.

I think you need to use the -S flag to specify connecting with https.

Code: Select all

./check_http -I 10.141.82.120 -p 4567 -S
./check_http -I 10.141.82.120 -u /config -p 4567 -S
The documentation for check_http may also be helpful. Man page for check_http

Re: Can't get check_http to work with a non standard https only port.

Posted: Tue Jun 25, 2024 1:09 pm
by rfrance
That was it!

Thank you!

I've been hunting and searching for days. I did go through the docs for the plugin and did not pick up on the function of the -S option. My miss.

Re: Can't get check_http to work with a non standard https only port.

Posted: Tue Jun 25, 2024 1:30 pm
by lgute
Hi @rfrance,

You are welcome. Glad I could help!