Unfortunately, there's no such item available PRTG and you have to build it yourself. Here's an object that displays comments of an object:
Since this is not generated automatically, you'll neeed a script that iterates through the devices and puts the IP address in the comment of it:
[xml]$Devices = (New-Object System.Net.WebClient).DownloadString(http://<your-prtg-server>/api/table.xml?content=devices&output=xml&columns=objid,host&username=<prtg-user>&passhash=<passhash>)
foreach($Device in $Devices.Item)
{
$ips = [System.Net.Dns]::GetHostAddresses("$Device.Host")
Invoke-WebRequest "http://<ihr-prtg-server>/api/setobjectproperty.htm?id=$Device.Objid&name=Comments$value=$ips[1].IPAddressToString&username=<prtg-user>&passhash=<passhash>"
}
This is just a proof of concept and probably needs some tweaking. What it basically has to do:
- Retrieve list of all devices via PRTGs API.
- Parse the XML into a PowerShell object
- Resolve the host for each object
- Put the IPv4 string into the comment device
Create a new map object (e.g. C:\Program Files (x86)\PRTG Network Monitor\webroot\mapobjects\device_comment.htm) with the following code:
<!-- Devices: Device comment -->
<div class="map_object" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">">
<#mapobject type="objectgrip" mode="<@editmode>">
<#mapobject type="htmlbefore" subid="<@subid>">
<#checkobjecttype objecttype="device" nicemessage="true" id="<@objectid>">
<#objectstatus name="comments" id="<@objectid>">
<#mapobject type="htmlafter" subid="<@subid>">
</div>
This will show the device comment as simple text on the map as shown above. Add
<b>IP: </b>
to the HTML Before field of the object to prepend some text to it.
Add comment