New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


How can I add a non-primary Toplist to PRTG Maps?

Votes:

0

Your Vote:

Up

Down

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?

map-designer map-objects maps packet-sniffer prtg toplist xflow

Created on Sep 4, 2013 2:09:47 PM by  Gerald Schoch [Paessler Support]



1 Reply

Accepted Answer

Votes:

0

Your Vote:

Up

Down

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

  1. Create a new map or use an existing one and open the Map Designer.
  2. Add the newly created custom map object Toplist of a Sensor (SUBID in HTML Before) to your map:
    1. On the left side, choose a sensor which uses toplists from the device tree.
    2. On the right side under Properties, select the entry Custom Map Objects and choose your new object.
  3. Select this object, the toplist, in the main window of the Map Designer.
  4. Under Properties on the right side, click on HTML.
  5. 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.
  6. 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.

  1. Navigate to the \webroot\mapobjects subfolder of your PRTG installation.
  2. Find the file graph toplist.htm.
  3. Create a copy of this file in the current folder and rename the copy accordingly (e.g., “my graph toplist.htm”).
  4. Open the renamed copy with an editor.
  5. 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 -->
  6. Find out the sub ID of the Toplist you want to add to your maps:
    1. Open this Toplist in PRTG.
    2. Look at the current URL: You will see a parameter subid=x. For example: http://<yourPRTGinstallation>/toplist.htm?id=1234&subid=3&topnumber=live
  7. Back in the editor, find the line data-objectid="<@objectid>" (usually in line 12 of the code)
  8. 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" […]
  9. 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.

  1. Open an editor.
  2. 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>
  3. 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" […]
  4. 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.

Created on Sep 4, 2013 2:11:42 PM by  Gerald Schoch [Paessler Support]

Last change on Aug 4, 2014 1:06:09 PM by  Gerald Schoch [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.