Page 1 of 1

Rest API monitoring

Posted: Fri May 19, 2023 9:11 am
by amit9876
Hi, Please let me know how can I monitor a Rest API endpoint which sends http status code as an output.

We are using NagiosXI. Nagios XI 5.6.7

Thanks

Re: Rest API monitoring

Posted: Fri May 19, 2023 12:16 pm
by kg2857
You may want to check on exchange.nagios.org, or look into check_http.

Re: Rest API monitoring

Posted: Mon May 22, 2023 3:32 am
by amit9876
I am trying this but it is not working until now.

My API post response is below:

{
"status": "OK"
}

I am trying following check.

/usr/local/nagios/libexec/check_http -I restapi-development.messagesnetwork.com -u '/api/ReceiveInvoice?healthcheck=true' -S -j 'POST' -r 'status: OK' -v

Response:

SSL initialized
POST /api/ReceiveInvoice?healthcheck=true HTTP/1.0
User-Agent: check_http/v2.2.1 (nagios-plugins 2.2.1)
Connection: close
Accept: */*


https://restapi-development.messagesnet ... check=true is 103 characters
STATUS: HTTP/1.1 400 Bad Request
**** HEADER ****
Content-Length: 0
Connection: close
Date: Mon, 22 May 2023 08:32:12 GMT
**** CONTENT ****

HTTP CRITICAL: HTTP/1.1 400 Bad Request - pattern not found - 103 bytes in 0.077 second response time |time=0.076583s;;;0.000000 size=103B;;;0