Page 1 of 1
Rename services using API backend
Posted: Wed Jun 16, 2021 4:17 am
by nms
Hi all,
I see quite a few possibilities in utilising the API in Nagios.
is it also possible to rename a host or service using the API without losing its history?
Rgds,
Matt
Re: Rename services using API backend
Posted: Wed Jun 16, 2021 1:18 pm
by vtrac
Hi,
How are you doing?
I asked one of my team member (Sean) for help with API command, and here's what he suggested:
Code: Select all
https://x.x.x.x/nagiosxi/api/v1/config/host/HOSTNAME?host_name=NEWHOSTNAME&apikey=YYYYYYYYYYYYYYYYYY&pretty=1&address=127.0.0.1¬ification_interval=30&applyconfig=1
Please NOTE: Just renaming the host (through API or manually) will cause the historical graphing/object notes to not carry over.
You must use the "Bulk Renaming" tool in CCM if you want the historical graphing to carry over to the new HOST / SERVICE.
Here's a video on how to rename HOST / SERVICE using "Bulk Renaming" tool:
https://support.nagios.com/kb/article/n ... l-732.html
Best Regards,
Vinh