Rename services using API backend

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Rename services using API backend

Post 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
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Rename services using API backend

Post 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&notification_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