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


Article Comments

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 :)


Apr, 2016 - Permalink

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!


Apr, 2016 - Permalink

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


Apr, 2016 - Permalink

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.


Apr, 2016 - Permalink

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 :)


Apr, 2016 - Permalink

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.


Apr, 2016 - Permalink

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


Apr, 2016 - Permalink

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


Apr, 2016 - Permalink

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 :)


Apr, 2016 - Permalink

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.


Apr, 2016 - Permalink

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


Apr, 2016 - Permalink

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


Apr, 2016 - Permalink

Nice :) Thanks for the update!


Apr, 2016 - Permalink