Thruk
Thruk copied to clipboard
Hide services option in "Availability Report For This Host" Log
After issue #1098 we can see services in "Host Log Entries" section. Can you add option to hide it? Please.
We have:
We need ( only "HOST*" types ):
The page shows "State Breakdowns For Host Services" as well, right? Or which page is that exactly?
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 )
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.
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.