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

PRTG Network Monitor

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

Free Download

Top Tags


View all Tags

Add a ProgressBar in Maps

Votes:

0

Your Vote:

Up

Down

Hello, I want to share my work for an horizontal progress bar. Known restrictions (for the moment) : - Value must be a 0/100 range because I don't know how to get the maximum value - Object height is hard coded. I wasn't able to match the PRTG Map Editor size - Text inside the progress is not V-centered

Progress bar

Maybe only a few things is needed to acheive it :

<!--Status Icons: Progress Bar-->

<div class="map_object map_icon mapicon_status_white" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="<#mapobject type="topleftcoordinates" subid="<@subid>" mode="<@editmode>">">
  <#mapobject type="objectgrip" mode="<@editmode>">
  <#mapobject type="htmlbefore" subid="<@subid>">
  <#checkobjecttype objecttype="sensor" nicemessage="true" id="<@objectid>">

<style> 
.progress-bar
{
	background-color:rgb(176,176,176);
	color:rgb(255,255,255);
	font-size:14px;
	text-align:center;
	padding:10px 5px 8px 5px;
	border-radius: 3px;
	width: 150px;
}
	
.progress-bar-inner 
{  
    display: block;  
	font-weight: bold;
	margin : 2px;
	padding : 2px;
    border-radius: 3px;
    position: relative;
	vertical-align: 20%;
} 
</style>     
  
	<!-- list des name : https://www.paessler.com/manuals/prtg/live_single_object_status -->
	<div class='progress-bar'>
		  <span id="myspan<@objectid>" class='progress-bar-inner'>VALUE</span>
	</div> 

	<script>
	var str = "<#objectstatus name="lastvalue" id="<@objectid>">";
	var res = str.split(" ", 1);
	var prtgValue = parseInt(res);
	document.getElementById("myspan<@objectid>").textContent="<#objectstatus name="lastvalue" id="<@objectid>">";
	document.getElementById("myspan<@objectid>").style.width=res[0]+"%";
	if (prtgValue < 15)
	{
		document.getElementById("myspan<@objectid>").style.background="rgb(227,6,19)";
	}
	else if (prtgValue < 25)
	{
		document.getElementById("myspan<@objectid>").style.background="rgb(245,197, 0)";
	}
	else {
		document.getElementById("myspan<@objectid>").style.background="rgb(184,196,25)";
	}
	</script>

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

api control maps web-gui

Created on Apr 13, 2021 11:55:11 AM by  nolme (0) 1

Last change on Apr 14, 2021 10:19:43 AM by  Sasa Ignjatovic [Paessler Support]



5 Replies

Votes:

0

Your Vote:

Up

Down

Hello there,

Thank you for sharing this. If possible a screenshot of the map object would be nice.


Kind regards

Felix Wiesneth - Team Tech Support

Created on Apr 13, 2021 3:14:22 PM by  Felix Wiesneth [Paessler Support]



Votes:

0

Your Vote:

Up

Down

@Felix Wiesneth : screenshot updated.

Is it possible to get object max value (like we have for lastvalue) ? Thanks

Created on Apr 18, 2021 9:31:29 AM by  nolme (0) 1



Votes:

0

Your Vote:

Up

Down

Hi there,

Thank you for the screenshots.
I'm afraid it is not possible to get the max value of a sensor/channel.


Kind regards

Felix Wiesneth - Team Tech Support

Created on Apr 19, 2021 7:19:11 AM by  Felix Wiesneth [Paessler Support]



Votes:

0

Your Vote:

Up

Down

:( so how does the jauge is able to ? Does the dev team can add this variable to improve the control ( I don't think that's difficult because it already work with lastvalue )?

Created on Apr 21, 2021 2:13:55 PM by  nolme (0) 1



Votes:

0

Your Vote:

Up

Down

Hi there,

I can't get into detail here. If you want to propose this as a new feature, please take a look here how to open a feature request. Since we are working on a new API at the moment, this request won't be added in the old API. On our roadmap you can take a look about our progress.


Felix Wiesneth - Team Tech Support

Created on Apr 23, 2021 1:40:14 PM by  Felix Wiesneth [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.