Thruk icon indicating copy to clipboard operation
Thruk copied to clipboard

Hide services option in "Availability Report For This Host" Log

Open white-line opened this issue 2 years ago • 4 comments

After issue #1098 we can see services in "Host Log Entries" section. Can you add option to hide it? Please.

We have: image

We need ( only "HOST*" types ): image

white-line avatar Jul 11 '21 08:07 white-line

The page shows "State Breakdowns For Host Services" as well, right? Or which page is that exactly?

sni avatar Oct 01 '21 13:10 sni

The page shows "State Breakdowns For Host Services" as well, right? Or which page is that exactly?

Yes.. But in "Host Log" section should only be events of "HOST*" types. Services should be excluded. Page - "avail.cgi" ( "View Availability Report For This Host" action )

image

white-line avatar Oct 20 '21 19:10 white-line

Solution here, i tnink:

In template "avail_report_log_entries.tt" replace:

        <tr class='[% class %]'>
          <td class='[% class %]'>[% format_date(log.start, datetime_format) %]</td>
          <td class='[% class %]'>[% format_date(log.end, datetime_format) %]</td>
          <td class='[% class %]'>[% log.duration %]</td>
          <td class='logEntries[% log.class %]'>[% log.type %]</td>
          <td class='[% class %]'>[% IF escape_html_tags %][% escape_html(log_line_plugin_output(log)) %][% ELSE %][% log_line_plugin_output(log) %][% END %]</td>
        </tr>

To

          [% entry_block = BLOCK %]
            <tr class='[% class %]'>
                <td class='[% class %]'>[% format_date(log.start, datetime_format) %]</td>
                <td class='[% class %]'>[% format_date(log.end, datetime_format) %]</td>
                <td class='[% class %]'>[% log.duration %]</td>
                <td class='logEntries[% log.class %]'>[% log.type %]</td>
                <td class='[% class %]'>[% IF escape_html_tags %][% escape_html(log_line_plugin_output(log)) %][% ELSE %][% log_line_plugin_output(log) %][% END %]</td>
            </tr>
          [% END %]
          [% IF service or full_log_entries %]
            [% entry_block %]
          [% ELSE %]
            [% IF log.type.match('HOST') %]
              [% entry_block %]
            [% END %]
          [% END %]

I tested it - works fine. Thanks.

white-line avatar Oct 24 '21 01:10 white-line

If there are services listed on that page, i'd say it's ok to list the service related log entries as well. But it might be a nice feature to disable services on that page and really generate only a host report without the services.

sni avatar Jul 29 '22 17:07 sni