I try to create a Dashboard-Map. A Donutwrapper for each building with an overview of all sensors like you have predefined in your Mapobject "donut_w_name-font-dark.htm". Now my challenge.... i try to configure that the color of the Bulidingname will change from black to red if an Alert is activ or confirmed. Nothing more ;-.)
It works with the follow code but only when i use a String and not the "objectproperty name="Name"" Can you give me a hint how it works?
Working code
<div class="map_object map_donutobj hasname" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" initialwidth="auto" initialheight="auto" style="<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">">
<#mapobject type="objectgrip" mode="<@editmode>">
<#mapobject type="htmlbefore" subid="<@subid>">
<div class="map_donutwrapper">
<#include file="includes\donut.htm" id="<@objectid>">
</div>
<#sensor type="colorclassofstate" id="<@objectid>" var="status">
<#objectproperty type="nodename" id="<@objectid>" var="nodename">
<#if value="@nodename" is="sensor" then="sensr" else="hasred" varexpand="value" var="containsred">
<#if value="@status" contains="@containsred" then="<p style='color:red;background-color: #FFFFAA;font-weight: bold;font-size: 20px'>**Building 1 ALERT**</p>" else="<p style='color:black;font-size: 20px'>**Building 1 OK**</p>" varexpand="value,contains">
<#mapobject type="htmlafter" subid="<@subid>">
</div>
Not working Code
<div class="map_object map_donutobj hasname" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" initialwidth="auto" initialheight="auto" style="<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">">
<#mapobject type="objectgrip" mode="<@editmode>">
<#mapobject type="htmlbefore" subid="<@subid>">
<div class="map_donutwrapper">
<#include file="includes\donut.htm" id="<@objectid>">
</div>
<#sensor type="colorclassofstate" id="<@objectid>" var="status">
<#objectproperty type="nodename" id="<@objectid>" var="nodename">
<#if value="@nodename" is="sensor" then="sensr" else="hasred" varexpand="value" var="containsred">
<#if value="@status" contains="@containsred" then="<p style='color:red;background-color: #FFFFAA;font-weight: bold;font-size: 20px'><**#objectproperty name="Name" id="<@objectid>**"</p>" else="<p style='color:black;font-size: 20px'>**<#objectproperty name="Name" id="<@objectid>**"</p>" varexpand="value,contains">
<#mapobject type="htmlafter" subid="<@subid>">
</div>
Many thanks for your help
Christof
Hi Christof,
I would recommend to take a look here: https://helpdesk.paessler.com/en/support/solutions/articles/7600006526503-how-can-i-add-or-edit-map-objects-used-for-prtg-s-maps
Kind regards
Felix Wiesneth - Team Tech Support
Aug, 2021 - Permalink