Add host comment using HTTP POST request

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
acandu
Posts: 1
Joined: Thu Jan 11, 2024 11:18 am

Add host comment using HTTP POST request

Post by acandu »

Good morning,
I created a web app that retrieves and displays data from nagios XI using http request (example: hostlist GET).

My question is: is it possible to add a comment or a downtime for one or more hosts using my web app via REST API ?
If yes, can you provide an example? If no, are there other ways to do this?

From the native interface of Nagios I'm able to do that but I'd like to do this action using my custom web application.

Thank you in adavance.
Andrea
sgardil
Posts: 350
Joined: Wed Aug 09, 2023 9:58 am

Re: Add host comment using HTTP POST request

Post by sgardil »

Hey @acandu

I don't see why this wouldn't be possible however you would need to make a custom plugin to do so. I don't have an example of how this would be done however you can view the exchange and see if someone has done something similar. I will link some documentation for plugins and the exchange as they may be helpful.

https://exchange.nagios.org/
https://nagios-plugins.org/doc/guidelines.html
maruusa0106
Posts: 2
Joined: Wed Sep 04, 2024 4:38 am

Re: Add host comment using HTTP POST request

Post by maruusa0106 »

Nagios XI supports adding comments and downtime via the REST API or using commands Sprunki Mod sent directly to Nagios Core via command files.
drewbinsky
Posts: 2
Joined: Tue Jul 04, 2023 9:00 pm

Re: Add host comment using HTTP POST request

Post by drewbinsky »

sgardil wrote: Thu Jan 11, 2024 12:20 pm Hey @acandu

I don't see why this wouldn't be possible however you would need to make a custom plugin to do so. I don't have an example of how this would be done however you can view the exchange and see if someone has done something similar. I will link some documentation for plugins and the exchange as they may be helpful.

https://exchange.nagios.org/ that's not my neighbor
https://nagios-plugins.org/doc/guidelines.html
If your app’s in something like JavaScript or Python, just translate these into your HTTP library—fetch/axios for JS, or requests for Python. No other workarounds needed since the REST API covers this natively. Let me know if you need help coding it up!"
Last edited by drewbinsky on Thu Apr 03, 2025 2:45 am, edited 1 time in total.
Ellenhelen
Posts: 1
Joined: Mon Jul 28, 2025 11:26 pm

Re: Add host comment using HTTP POST request

Post by Ellenhelen »

acandu wrote: Thu Jan 11, 2024 11:29 am Good morning,
I created a web app that retrieves and displays data from nagios XI using http request (example: hostlist GET).

My question is: Retro Bowl is it possible to add a comment or a downtime for one or more hosts using my web app via REST API ?
If yes, can you provide an example? If no, are there other ways to do this?

From the native interface of Nagios I'm able to do that but I'd like to do this action using my custom web application.

Thank you in adavance.
Andrea
Nagios XI is built on Nagios Core, and sending external commands is how Nagios works. XI's REST API is simply a convenient interface for you to send these commands from your application.
Post Reply