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

Map - Custom Log View

Votes:

0

Hello.

I would like to create a custom Log View, that I would integrate into a Map.

The current Data Tables/Log Table object shows all Status information, and I would like to append a filter that would only show log entries with Up and Down status.

Is it possible to do that by changing the <#lang key="html.global.log" default="Log" var="log"> entry, or do I need a more customized HTM

logs maps prtg

Created on Apr 20, 2016 9:51:10 AM



13 Replies

Accepted Answer

Votes:

0

Should work with the following code:

<!--Data Tables: Log Table -->

<div class="map_object map_table" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="overflow:auto;<#mapobject type="coordinates" subid="<@subid>" mode="<@editmode>">">
  <#mapobject type="objectgrip" mode="<@editmode>">
  <#mapobject type="htmlbefore" subid="<@subid>">
  <#checkobjecttype objecttype="probenode,group,device" nicemessage="true" id="<@objectid>">
  <div class="maptablecontainer" style="overflow:hidden">
    <#lang key="html.global.log" default="Log" var="log">
    <#objectproperty name="name" var="objname" id="<@objectid>">
    <b><#inserthtml html="@log (@objname)" varexpand="html"></b>
    <#table tableid="dashalarmtable"
      content="messages"
      id="<@objectid>"
      columns="datetime,parent,name,status,message"
      count="50"
      sortby="ddate"
      filter_status="3"
      filter_status="5"
      links="false"
      sortable="false"
      infoheader="false"
      varexpand="tabletitle"
      tabletitle="">
  </div>
  <#mapobject type="htmlafter" subid="<@subid>">
</div>

Notice the two filter_status entries :)

Created on Apr 21, 2016 12:54:13 PM by  Stephan Linke [Paessler Support]



Votes:

0

Greetings.

Worked like a charm, but only after I changed the filter_status variable.

In my case, they were 608, 607 and 620.

In any case, thank you for your help!

Created on Apr 25, 2016 6:32:42 AM



Votes:

0

Strange :) Glad that it works for you! :)

Created on Apr 25, 2016 8:55:49 AM by  Stephan Linke [Paessler Support]



Votes:

0

One more question.

Is it possible to change the format of a row entry, depending on the Status information?

Let's say, I want to put a red highlight(or fill) on every entry that has a Down status.

Created on Apr 25, 2016 10:03:57 AM



Votes:

0

Took me a bit to figure it out and will only work in current browsers. Open up
C:\Program Files (x86)\PRTG Network Monitor\webroot\javascript\scripts_custom.js

...and add the following lines:

$('#table_dashalarmtable tr').each(function (i, row) {
  var $row = $(row)
  var $sensorstate = $row.find('td.col-status').html();

  if (['Error','enter-whatever-state-you-want'].includes($sensorstate))
  {  $row.css('background-color','#ff3300'); }

});

Every error will then be highlighted in red in the above table. you can add more states in the if condition if necessary :)

Created on Apr 27, 2016 8:35:36 AM by  Stephan Linke [Paessler Support]



Votes:

0

I did as you said, defined only 'Down' in the If statement, but I cannot see the formatting. Rechecked with newest Chrome, Firefox and IE

Do I need to allow custom scripts in my PRTG configuration. Or rebuild my Map?

The CSS formatting is also not show in the normal Log view.

Created on Apr 27, 2016 9:04:21 AM



Votes:

0

I forgot to mention that the script will only work properly when it's opened up directly, not in the map editor.

Created on Apr 27, 2016 9:23:21 AM by  Stephan Linke [Paessler Support]



Votes:

0

I see, no can do then. Well, thanks for the help.

Created on Apr 27, 2016 9:26:28 AM



Votes:

0

What do you mean by no can do? It actually works, you just have to call the map via its direct URL, visible in the "HTML" tab of the map :)

Created on Apr 27, 2016 9:40:30 AM by  Stephan Linke [Paessler Support]



Votes:

0

Yes, I've been doing the checkup using the direct URL, and have not seen the CSS formatting in the Log table on the map.

Created on Apr 27, 2016 9:45:41 AM



Votes:

0

Can you check your browser's console for any javascript errors?

Created on Apr 27, 2016 12:49:34 PM by  Stephan Linke [Paessler Support]



Votes:

0

Apologies, it looks like I've been looking at cached version of the map. Everything works fine, thank you.

Created on Apr 28, 2016 5:58:42 AM



Votes:

0

Nice :) Thanks for the update!

Created on Apr 28, 2016 7:25:26 AM by  Stephan Linke [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.