how to make a check_http out of this curl statement

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
brudnick
Posts: 37
Joined: Mon Feb 17, 2014 3:17 pm

how to make a check_http out of this curl statement

Post by brudnick »

I have a curl statement that I can run and get the results of { "status": "UP" }. I am trying to find the equivalent for check_http that matches on the string "UP"

Curl statement:

Code: Select all

 curl -k -H "Host: healthcheck" "https://redacted:443/health"
Curl Response: { "status": "UP" }
my try on check_http:

Code: Select all

./check_http -H redacted -S -p 443 -f ok -k "Host: healthcheck" -s "UP"
Resonse: HTTP CRITICAL: HTTP/1.1 301 Moved Permanently - string 'UP' not found on 'https://redacted:443/' - 552 bytes in 0.034 second response time |time=0.033834s;;;0.000000 size=552B;;;0
Any help would be appreciated.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: how to make a check_http out of this curl statement

Post by scottwilkerson »

You need to add the path, and I would also change the -f to follow

Code: Select all

./check_http -H redacted -S -p 443 -f follow -k "Host: healthcheck" -s "UP" -u "/health"
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked