I have a simple data table, showing the Uptime sensor of all devices:

<!--Data Tables: Windows Uptime Status-->

<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="probenode,group,device" nicemessage="true" id="<@objectid>">

  <div class="maptablecontainer" style="overflow:hidden">
    <#lang key="html.mapobjects.tablea10.tabletitle" default="Windows Uptime Status (@@@@)" var="tabletitle">
    <#table tableid="sensortable"
    id="<@objectid>"
    content="sensors"
    columns="sensor,lastvalue,probegroupdevice"
    sortby="-lastvalue"
    infoheader="false"
    links="false"
    sortable="false"
    varexpand="tabletitle"
    tabletitle="@tabletitle"
    filter_tags="@tag(snmpuptimesensor)"

  </div>
  <#mapobject type="htmlafter" subid="<@subid>">
</div>

I would like to filter this to show only Windows server devices, and not Firewalls and Switches etc.


Article Comments

Hello Burdie,

Thank you for your message.

Regarding what you would like to achieve, I'm afraid that it's not possible to filter the devices only in the map object.

You can do so by using the map object for a specific group of the device tree and/or add a tag to the SNMP Uptime sensors which belong to Windows servers. With the latter option, you would then only have to add filter_tags="@tag()" again in the map object file.

To automate the adding of the tag, you can the API of PRTG whose manual is available there: https://www.paessler.com/manuals/prtg/application_programming_interface_api_definition. You can also use the PowerShell module PRTGAPI to make it easier to automate that process.

The script should then look like the following (might require modification):

  1. Get the list of SNMP Uptime sensor
  2. Check the parent device on one or many selection criterion
  3. If parent device is a Windows server > Add a tag to the SNMP Uptime sensor
  4. Otherwise, check next sensor on the list

If you have questions, let us know.

Regards.


Sep, 2021 - Permalink