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
Add host comment using HTTP POST request
Re: Add host comment using HTTP POST request
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
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
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
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!"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
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
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.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