Page 1 of 1

Add host comment using HTTP POST request

Posted: Thu Jan 11, 2024 11:29 am
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

Re: Add host comment using HTTP POST request

Posted: Thu Jan 11, 2024 12:20 pm
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

Re: Add host comment using HTTP POST request

Posted: Tue Jan 14, 2025 1:33 am
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.

Re: Add host comment using HTTP POST request

Posted: Thu Apr 03, 2025 2:44 am
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!"

Re: Add host comment using HTTP POST request

Posted: Mon Jul 28, 2025 11:30 pm
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.