New Question
 
 
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 PRTG
Download >>

 

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

 

Top Tags


View all Tags


Map custom object traffic RX/TX

Votes:

0

Your Vote:

Up

Down

Hello everyone,

i want to create a custom object that shows RX and TX values of a SNMP traffic sensor. I already created the object, but how do I get the data for the RX and TX values?

As I can see from the api guide this must somehow be done with json. What is to do to accomplish this task?

This are the channels I'd like to read out and show:

<value channel="Datenverkehr eingehend (Geschwindigkeit)" channelid="0">1 Mbit/Sek.</value>

<value channel="Datenverkehr ausgehend (Geschwindigkeit)" channelid="1">3 Mbit/Sek.</value>

This is the object which I created:

<!--Custom Icons: Sensor Statistiken RX-/TX-->

<div align="center" class="map_object" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="<#mapobject type="topleftcoordinates" subid="<@subid>" mode="<@editmode>">"> <#checkobjecttype objecttype="sensor" nicemessage="true" id="<@objectid>"> <#mapobject type="objectgrip" mode="<@editmode>"> <#mapobject type="htmlbefore" subid="<@subid>"> <h2><b><u><#objectproperty name="ParentDevice" show="text" id="<@objectid>"></b></u></h2> <p><#objectproperty name="Name" id="<@objectid>"></p> <#objectstatus name="downsens" id="<@objectid>"> <p> <b>RX:</b> <#objectstatus name="lastvalue" id="<@objectid>"> <br> <b>TX:</b> <#objectstatus name="lastvalue" id="<@objectid>"> </p>

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

custom json maps sensor traffic

Created on Aug 20, 2014 6:50:29 AM by  crazyib (0) 1



3 Replies

Votes:

0

Your Vote:

Up

Down

Hello,

thank you very much for using PRTG. I'm very much afraid this is not possible. Map Objects can only access the value of the one Primary Channel of a sensor. Please instead consider placing a graph of the sensor in question onto the map as well. to see the values of all channels.

best regards.

Created on Aug 20, 2014 12:24:35 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hello,

I found a solution myself.

I updated the "jquery.js" in "webroot/javascript/lib" to the latest version and builded the following map object:

<div align="center" class="map_object" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="<#mapobject type="topleftcoordinates" subid="<@subid>" mode="<@editmode>">">
<#checkobjecttype objecttype="sensor" nicemessage="true" id="<@objectid>">
<#mapobject type="objectgrip" mode="<@editmode>">
<#mapobject type="htmlbefore" subid="<@subid>">
  <h2><b><u><#objectproperty name="ParentDevice" show="text" id="<@objectid>"></b></u></h2>
  <p><#objectproperty name="Name" id="<@objectid>"></p>
  <#objectstatus name="downsens" id="<@objectid>">
  
  <div id="dvContent"></div>
  
<script>
$(document).ready(function(){
  $.ajax({
    type: "GET",
    url: "https://URL_OF_YOUR_PRTG_SERVER/api/table.xml?content=values&output=xml&columns=datetime,value_,coverage&count=1&id=<@objectid>",
    dataType: "xml",
    success: function(xml){
    $(xml).find('item').each(function(){
      var sRX = $(this).find('value[channel="Eingehend (Geschwindigkeit)"]').text();
	  var sTX= $(this).find('value[channel="Ausgehend (Geschwindigkeit)"]').text();
      $("<p></p>").html("<b>RX:</b> " + sRX).appendTo("#dvContent");
	  $("<p></p>").html("<b>TX:</b> " + sTX).appendTo("#dvContent");
    });
  },
  error: function() {
    alert("An error occurred while processing XML file.");
  }
  });
});
</script>
  
  <#mapobject type="htmlafter" subid="<@subid>">
</div>

Yet this just works for one sensor, I think it's because of the "id=<@objectid>" in "url:", but I think this should give everyone a basic idea how to accomplish this.

Created on Aug 20, 2014 3:09:51 PM by  crazyib (0) 1

Last change on Aug 20, 2014 5:46:29 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Could you please delete the URL in the post I sent after my initial one? Thank you really much.

Created on Aug 20, 2014 3:15:39 PM by  crazyib (0) 1



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.