When I open the Map Designer in PRTG and open the Graphs section there, I can add a “Primary Toplist of a Sensor” to my map. However, I would like to include a Toplist distribution chart in PRTG maps which is not a primary. The same is for data tables of toplists for sensor types like Packet Sniffers or Flow sensors.
Is there a way to show toplists other than primary in maps? How can I achieve this?
Article Comments
This article applies to PRTG Network Monitor 13 or later
Adding Any Toplist Graph or Table to a Map
In general, you can add almost everything to your maps. The only thing to do is to create your own map objects. In order to display distribution charts and data tables of toplists which are not the primary toplists of your Packet Sniffer or xFlow sensors, follow the steps below.
Generating a Custom Map Object: Toplist of a Sensor
The following steps describe the approach to create a custom map object that can show any toplist of a sensor in PRTG Maps.
Step 1: Create the Custom Map Object
Open a text editor and paste the following code into it:
<!-- Custom Map Objects: Toplist of a Sensor (SUBID in HTML Before) -->
<div class="map_object map_table" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="overflow:hidden;<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">">
<#mapobject type="objectgrip" mode="<@editmode>">
<#mapobject type="htmlbefore" subid="<@subid>" var="toplistsubid">
<#checkobjecttype objecttype="sensor" nicemessage="true" id="<@objectid>">
<div id ="Toplist_<@itemid>"
class="prtg-plugin toplistgraph"
data-plugin="toplist"
style="overflow:hidden;<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">"
data-objectid="<@objectid>"
data-topnumber="live"
data-nonrefreshable=true>
<!--
{"objects":<#table
id='<@objectid>'
_subid='@toplistsubid'
varexpand='_subid'
count='*'
usecaption='true'
noraw='1'
output='json'
topnumber='live'
content='topdata'
columns='position=oftTextRaw,value_=treejson'
sortby='-value_2V'>
}
-->
</div>
<#mapobject type="htmlafter" subid="<@subid>">
</div>
Save this file as .htm in the \webroot\mapobjects subfolder of your PRTG installation.
Step 2: Use the Custom Map Object in the Map Designer
- Create a new map or use an existing one and open the Map Designer.
- Add the newly created custom map object Toplist of a Sensor (SUBID in HTML Before) to your map:
- On the left side, choose a sensor which uses toplists from the device tree.
- On the right side under Properties, select the entry Custom Map Objects and choose your new object.
- Select this object, the toplist, in the main window of the Map Designer.
- Under Properties on the right side, click on HTML.
- Add the sub ID of the desired toplist to the HTML Before field (single integer, e.g., 3). You can find the ID in the URL of a toplist when you open it via the sensor overview page, e.g., subid=3.
- Click on Save.
Done! This way you can add the distribution charts or data tables of any toplists to your PRTG Maps.
The following approach is an alternative to the method as described above. We recommend you to use the method above because it is easier to achieve and provide the following steps only for your information.
Creating a Map Object for a Toplist Graph
The following steps describe the creation of a map object containing the distribution chart of a Toplist which is not the Primary Toplist of a sensor.
- Navigate to the \webroot\mapobjects subfolder of your PRTG installation.
- Find the file graph toplist.htm.
- Create a copy of this file in the current folder and rename the copy accordingly (e.g., “my graph toplist.htm”).
- Open the renamed copy with an editor.
- Edit the first line: Replace Primary Toplist of a Sensor by the name you want for the new map object. For example, the first line could look like this now:
<!-- Graphs: My Toplist of a Sensor -->
- Find out the sub ID of the Toplist you want to add to your maps:
- Open this Toplist in PRTG.
- Look at the current URL: You will see a parameter subid=x. For example:
http://<yourPRTGinstallation>/toplist.htm?id=1234&subid=3&topnumber=live
- Back in the editor, find the line data-objectid="<@objectid>" (usually in line 12 of the code)
- In the next line, add data-subid="x", where x refers to the respective sub ID of the desired Toplist of your sensor. For example:
[…]
data-objectid="<@objectid>"
data-subid="3"
data-topnumber="live"
[…]
- Save the file in the current folder.
You will find this map object with the defined toplist under Graphs in the Map Designer. In our example, there would be the entry “My Toplist of a Sensor” now.
Creating a Map Object for a Toplist Data Table
The following steps describe the creation of a map object containing the data table of a Toplist which is not the Primary Toplist of a sensor.
- Open an editor.
- Copy the following code and paste it into the editor:
<!-- Data Tables: Toplist Table -->
<div class="map_object map_table" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="overflow:auto;<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">">
<#mapobject type="objectgrip" mode="<@editmode>">
<#mapobject type="htmlbefore" subid="<@subid>">
<#checkobjecttype objecttype="sensor" nicemessage="true" id="<@objectid>">
<div class="top10listcontainer" style="overflow:hidden">
<#table id="<@objectid>"
subid="x"
tableid="topdatatable"
count="100"
content="topdata"
topnumber="live"
columns="position,value_,minigraph" sortby="-value_2V"
links="false"
sortable="false"
infoheader="false"
display="extendedheaders"
tabletitle="Toplist"
filter_tags="@tag(<@tagfilterstring>)">
</div>
<#mapobject type="htmlafter" subid="<@subid>">
</div>
- Replace the x in line 8 with the sub ID of your desired Toplist (see subsection above in this article). For example:
[…]
<#table id="<@objectid>"
subid="3"
tableid="topdatatable"
[…]
- Save this file as .htm in the \webroot\mapobjects subfolder of your PRTG installation.
You will now find this map object with the defined Toplist under Data Tables in PRTG’s Map Designer. In our example, there would be the entry “Toplist Table” now.
Sep, 2013 - Permalink
"Done! This way you can add the distribution charts or data tables of any toplists to your PRTG Maps."
What do I have to change in Step 1 (First Method), if I want to see the data table of a choosable netflow toplist?
Step 1 above does only show the graph...
Second Method does work, but not with choosable netflow toplist. And to create a single data template for every subid..., no.
Thanks a lot
Kind Regards
Robert
Dec, 2019 - Permalink
Same for us, what to change for the first method to see a data table?
Dec, 2019 - Permalink
Creating a Map Object for a Toplist Data Table with adjustable subid
As with the graphs you can also set the subid in the "HTML Before" field of the map object.
For this copy the following code in a text editor:
<!-- Data Tables: Toplist Table -->
<div class="map_object map_table" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="overflow:auto;<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">">
<#mapobject type="objectgrip" mode="<@editmode>">
<#mapobject type="htmlbefore" subid="<@subid>" var="toplistsubid">
<#checkobjecttype objecttype="sensor" nicemessage="true" id="<@objectid>">
<div class="top10listcontainer" style="overflow:hidden">
<#table id="<@objectid>"
subid='@toplistsubid'
varexpand='subid'
tableid="topdatatable"
count="100"
content="topdata"
topnumber="live"
columns="position,value_,minigraph" sortby="-value_2V"
links="false"
sortable="false"
infoheader="false"
display="extendedheaders"
tabletitle="Toplist"
filter_tags="@tag(<@tagfilterstring>)">
</div>
<#mapobject type="htmlafter" subid="<@subid>">
</div>
Save this file as .htm in the \webroot\mapobjects subfolder of your PRTG installation, same as with the previous examples.
Dec, 2019 - Permalink
Hi Sasa,
Thanks a lot. That works fine.
I tried for my own before, but i did not suceed.
So you were a great help.
Thanks!
Kind Regards
Robert
Dec, 2019 - Permalink
is there a way to increase the font size?
Jan, 2023 - Permalink
@epitaph91,
You can try out the solution mentioned in this article. This should work for the Toplist table objects as well.
Kind regards,
Sasa Ignjatovic, Tech Support Team
Jan, 2023 - Permalink
This article applies to PRTG Network Monitor 13 or later
Adding Any Toplist Graph or Table to a Map
In general, you can add almost everything to your maps. The only thing to do is to create your own map objects. In order to display distribution charts and data tables of toplists which are not the primary toplists of your Packet Sniffer or xFlow sensors, follow the steps below.
Generating a Custom Map Object: Toplist of a Sensor
The following steps describe the approach to create a custom map object that can show any toplist of a sensor in PRTG Maps.
Step 1: Create the Custom Map Object
Open a text editor and paste the following code into it:
Save this file as .htm in the \webroot\mapobjects subfolder of your PRTG installation.
Step 2: Use the Custom Map Object in the Map Designer
Done! This way you can add the distribution charts or data tables of any toplists to your PRTG Maps.
The following approach is an alternative to the method as described above. We recommend you to use the method above because it is easier to achieve and provide the following steps only for your information.
Creating a Map Object for a Toplist Graph
The following steps describe the creation of a map object containing the distribution chart of a Toplist which is not the Primary Toplist of a sensor.
<!-- Graphs: My Toplist of a Sensor -->
http://<yourPRTGinstallation>/toplist.htm?id=1234&subid=3&topnumber=live
[…] data-objectid="<@objectid>" data-subid="3" data-topnumber="live" […]
You will find this map object with the defined toplist under Graphs in the Map Designer. In our example, there would be the entry “My Toplist of a Sensor” now.
Creating a Map Object for a Toplist Data Table
The following steps describe the creation of a map object containing the data table of a Toplist which is not the Primary Toplist of a sensor.
<!-- Data Tables: Toplist Table --> <div class="map_object map_table" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="overflow:auto;<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">"> <#mapobject type="objectgrip" mode="<@editmode>"> <#mapobject type="htmlbefore" subid="<@subid>"> <#checkobjecttype objecttype="sensor" nicemessage="true" id="<@objectid>"> <div class="top10listcontainer" style="overflow:hidden"> <#table id="<@objectid>" subid="x" tableid="topdatatable" count="100" content="topdata" topnumber="live" columns="position,value_,minigraph" sortby="-value_2V" links="false" sortable="false" infoheader="false" display="extendedheaders" tabletitle="Toplist" filter_tags="@tag(<@tagfilterstring>)"> </div> <#mapobject type="htmlafter" subid="<@subid>"> </div>
[…] <#table id="<@objectid>" subid="3" tableid="topdatatable" […]
You will now find this map object with the defined Toplist under Data Tables in PRTG’s Map Designer. In our example, there would be the entry “Toplist Table” now.
Sep, 2013 - Permalink