Rest API monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
amit9876
Posts: 16
Joined: Mon Oct 22, 2018 9:05 am

Rest API monitoring

Post 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
kg2857
Posts: 233
Joined: Wed Apr 12, 2023 5:48 pm

Re: Rest API monitoring

Post by kg2857 »

You may want to check on exchange.nagios.org, or look into check_http.
amit9876
Posts: 16
Joined: Mon Oct 22, 2018 9:05 am

Re: Rest API monitoring

Post 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
Post Reply