What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Change color of the Objectname in a Dashbord-Map if an alert is aktiv

Votes:

0

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

custommaps maps objectname

Created on Jul 28, 2021 2:39:28 PM

Last change on Jul 28, 2021 7:06:11 PM by  Felix Wiesneth [Paessler Support]



1 Reply

Votes:

0

Hi Christof,

I would recommend to take a look here: https://kb.paessler.com/en/topic/1703-how-can-i-add-or-edit-map-objects-used-for-prtg-s-maps


Kind regards

Felix Wiesneth - Team Tech Support

Created on Aug 2, 2021 2:06:54 PM by  Felix Wiesneth [Paessler Support]




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.