Hello,
Within our organization in a few weeks time we'll change the IP addresses of all our servers. Because we want to opt out DNS, in prtg we have created all our devices based on IP and not hostname so we need to rename it there also.
We have a list of the old and new IP address. Is there a way to bulk change this? For starting it would be nice to know where PRTG stores this data.
Best, Steven
Article Comments
Hi,
This might get a longer one. :)
So for starters, all configuration data is stored in the file PRTG Configuration.dat (details here). The file is a XML file so to change all IP adresses the easiest way would be replacing all IPs in the config file. Downside here is it is easily possible to break the file. So if you want to try this I would totally recommend using a backed up file and spin up a trial PRTG installation to test with the changed file.
Within the file search for the tag <host> which is holding the IP address of each device. You can try changing the IPs there and then start your trial installation with the edited config to see if everything comes up properly.
The other way would be using the PRTG API to change the IPs there. The API documentation can be found here.
Best regards
Oct, 2015 - Permalink
Updating a device's address(IP, FQDN or NetBios, the Address field is always the same) only having the device's old and new address consists of two distinct operations:
1. Since all API operations have to be done based on the ID of the object that you want to change, you have to look for the objects with the current address to find their ID's first, if you were looking for the device with address 1.2.3.4:
/api/table.xml?content=devices&output=xml&columns=objid,probe,device,host&filter_host=1.2.3.4 |
Or if you wanted to partially match a hostname "myserver" but with variations (myserver, myserver.domainx, myserver.domainy) :
api/table.xml?content=devices&output=xml&columns=objid,probe,device,host&filter_host=@sub(myserver) |
The query above would return something like:
<?xml version="1.0" encoding="UTF-8"?> <devices totalcount="2" listend="1"> <prtg-version>16.2.24.4274</prtg-version> <item> <objid>2003</objid> <probe>Probe on NEMO-VM2012-2</probe> <device>Some Device</device> <host>myserver</host> </item> <item> <objid>2236</objid> <probe>My Local probe</probe> <device>Some Other Device</device> <host>myserver.domainx</host> </item> </devices>
2. Now, we have to use the previously acquired ID's (2003, 2236) to issue the setobjecproperty operation to effectively change the address. For instance if we were to update the address of "Some Device" (ID: 2003) to newaddress.xyz we would issue the following:
/api/setobjectproperty.htm?id=2003&name=host&value=newaddress.xyz |
To modify several addresses, implement a repetition mechanism that goes trough all resulting ID's and changes them to the new address using the setobjecproperty for every result of the table.xml?content=devices query.
The API will also require you to provide an username and password or passhash for authentication, an introduction to using the API is available here.
If you're looking for a working example for changing the domain in device's names in bulk using a powershell script, you can check out this: KB: Change Device Name Using Script
Best Regards,
Luciano Lingnau [Paessler Support]
Jun, 2016 - Permalink
Good question, I have the same issue! Only difference may be the setup of PRTG. We have multiple probes and a central PRTG server.
Oct, 2015 - Permalink