Hello All,
As i'm looking at (i.e. Traffic Light) Mapobjects he see following in source:
<#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="@nodename" is="sensor" then="sensy" else="hasyellow hasnored" varexpand="value" var="containsyellow"> <#if value="@nodename" is="sensor" then="sensg" else="hasgreen hasnoyellow hasnored" varexpand="value" var="containsgreen">
Is it possible to add an additional color, for an ackknoledged Sensor (status 13)?
Thanks Oliver
Article Comments
Hi Oliver!
Were you able to include more colors for traffic light?
I went to a post where someone shares a new object called "circle with black border Status Related Background", but it lacks of paused and ackownledged colors.
If you have something to help, I'll appreciate it!
Cheers, Eduardo Ellery
May, 2021 - Permalink
Hello Eduardo,
Here is a modification which contains the Paused and Acknowledge states. Of course, you can adapt the code as you need. However, we won't provide support for it.
Before applying the modification, please copy the file trafficlight.htm (under "C:\Program Files (x86)\PRTG Network Monitor\webroot\mapobjects") and change its name by modifying the first line:
<!--Status Icons: Traffic light 2-->
Then, here is the first part of the code which need to be modified to include the other states:
<#if value="@nodename" is="sensor" then="sensr" else="hasred" varexpand="value" var="containsred"> <#if value="@nodename" is="sensor" then="sensy" else="hasyellow hasnored" varexpand="value" var="containsyellow"> <#if value="@nodename" is="sensor" then="sensg" else="hasgreen hasnoyellow hasnored" varexpand="value" var="containsgreen"> <#if value="@nodename" is="sensor" then="sensb" else="hasblue hasnogreen hasnoyellow hasnored" varexpand="value" var="containsblue"> <#if value="@nodename" is="sensor" then="senso" else="hasorange hasnogreen hasnoyellow hasnored" varexpand="value" var="containsorange">
The height of the object must be increased as well:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" width="100%" height="100%" viewBox="0 0 100 460">
Finally, you need to add the corresponding circles:
<circle class="trafficlight_circle" r="40" fill="#DADADA" cx="50" cy="50" /> <circle class="trafficlight_circle" r="40" fill="#DADADA" cx="50" cy="140" /> <circle class="trafficlight_circle" r="40" fill="#DADADA" cx="50" cy="230" /> <circle class="trafficlight_circle" r="40" fill="#DADADA" cx="50" cy="320" /> <circle class="trafficlight_circle" r="40" fill="#DADADA" cx="50" cy="410" /> <circle style="<#if value="@status" contains="@containsred" then="" else="opacity:0" varexpand="value,contains">" r="40" fill="#E6005F" cx="50" cy="50" /> <circle style="<#if value="@status" contains="@containsyellow" then="" else="opacity:0" varexpand="value,contains">" r="40" fill="#F59C00" cx="50" cy="140" /> <circle style="<#if value="@status" contains="@containsgreen" then="" else="opacity:0" varexpand="value,contains">" r="40" fill="#C0CC19" cx="50" cy="230" /> <circle style="<#if value="@status" contains="@containsblue" then="" else="opacity:0" varexpand="value,contains">" r="40" fill="#03c8ff" cx="50" cy="320" /> <circle style="<#if value="@status" contains="@containsorange" then="" else="opacity:0" varexpand="value,contains">" r="40" fill="#fc4e65" cx="50" cy="410" />
Here is the result:
Regards.
May, 2021 - Permalink
Hello Oliver,
Thank you very much for your contribution and I really hoped that I could provide you with a more satisfactory answer but unfortunately we don't provide technical support for PRTG customization, no matter if the customization relates to PRTG Maps or PRTG Reports. The reason for us to decline such requests is based on the amount of time it usually takes to troubleshoot those requests and that we are not able to guarantee whether a change is still working after an update. Further information about this topic can be found here:
What is your position towards customizing the PRTG web interface?
Best,
Sebastian
Nov, 2019 - Permalink