Hello!

I'm trying to create new custom map object for PRTG map in folder C:\Program Files (x86)\PRTG Network Monitor\webroot\mapobjects.

Now I have object like this:

<!--New Gauges: Radial gauge-->

<div class="map_object map_table <#sensor type="colorclassofstate" prefix="map_objectstate_" id="<@objectid>">" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="overflow:hidden;<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">">
<#mapobject type="objectgrip" mode="<@editmode>">
<#mapobject type="htmlbefore" subid="<@subid>">
<#checkobjecttype objecttype="sensor" nicemessage="true" id="<@objectid>">
<script src="http:////cdn.rawgit.com/Mikhus/canvas-gauges/gh-pages/download/latest/all/gauge.min.js"></script> 
<span>

<canvas data-type="radial-gauge"
    data-width="300"
    data-height="300"
	 data-title="<#objectproperty name="Name" id="<@objectid>">"
    data-units="<#objectproperty name="value" id="<@objectid>">"
    data-min-value="0"
    data-max-value="350"
	data-value='<#objectproperty name="primarychannel" show="number" id="<@objectid>">'
    data-highlights="[{&quot;from&quot;: 300, &quot;to&quot;: 350, &quot;color&quot;: &quot;rgba(200, 50, 50, .75)&quot;}]"
    data-color-plate="#fff"
    data-border-shadow-width="0"
    data-borders="false"
    data-needle-type="arrow"
    data-needle-width="2"
    data-needle-circle-size="7"
    data-needle-circle-outer="true"
    data-needle-circle-inner="false"
    data-animation-duration="1500"
    data-animation-rule="linear"
></canvas>
</span>
<#mapobject type="htmlafter" subid="<@subid>">		                       
</div>

But I don't understand where I can get objectproperty names? I can't find It in PRTG API docs. Now I can get only sensor Name value, I get It via this code:

<#objectproperty name="Name" id="<@objectid>">

How I can get this properties (for sersor) ?

  • Maximum error limit
  • Minimum error limit
  • Current sensor value
  • Unit

Thanks in advance!


Article Comments

I want to get values from primary channel sensor. Where primary channel values is :

  • Maximum error limit
  • Minimum error limit
  • Current sensor value
  • Unit

Now I found how to get last channel value - <#objectstatus name="lastvalue" id="<@objectid>">

But I don't understand how to get other values.


Oct, 2016 - Permalink

Hello,

Unfornutnalty auch a api call to receive the minimum and maximum erroor limit does not exist, sorry. The unit you are receiving with the lastvalue parameter aswell.


Oct, 2016 - Permalink

I can get maximum value via json API , like this:

<#table id="<@objectid>" output='json' noraw='1' infoheader="false" count='1' filter_channels='@ntxt('maximum')' subcheck="1" content='channels' columns='maximum'>

But I don't understand how to get only value, without other data

for example json data in my example will be {"prtg-version":"16.3.24.5302","treesize":0,"channels":[{"maximum":"260963 Mhz"}]}

I want to get only this value - 260963 but I dont understanl how to do it via PRTG


Oct, 2016 - Permalink

Can I use this json example in custom PRTG map element?


Oct, 2016 - Permalink

Hi mercury131,

You can use an XML/REST Value Sensor to retrieve this specific value and then put the sensor on the map. See the linked description for the sensor on how to configure the sensor so that it pulls the required value.

Kind regards,

Erhard


Oct, 2016 - Permalink