Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reports: migrate different sla reports into one generic
reports have been merged into a generic report: - sla_host, sla_hostgroup, sla_service, sla_servicegroup -> sla_report - sla_host_outage, sla_service_outage -> sla_outage Those reports can now use any filter and also combine hosts and services into one report.
- Loading branch information
Showing
16 changed files
with
136 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
plugins/plugins-available/reports2/templates/reports/comp/sla_details.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[% available = get_availability_percents(hst, svc) %] | ||
[% p = available.total.percent; | ||
IF p == -1; p = 100; END; | ||
IF param.exists('mail_max_level') && param.mail_max_level != -1 && p < param.mail_max_level; param.mail_max_level_count = param.mail_max_level_count + 1; END; | ||
IF total_services > 1 && param.details_max_level != -1 && p >= param.details_max_level; NEXT; END | ||
%] | ||
[% IF svc == "" %] | ||
[% pagetitle = loc("Host: %s", _hst(hst)) %] | ||
[% ELSE %] | ||
[% pagetitle = loc("Service: %s on %s", _svc(hst, svc), _hst(hst)) %] | ||
[% END %] | ||
|
||
[% WRAPPER 'reports/comp/page_standard.tt' %] | ||
[% PROCESS 'reports/comp/sla_graph_page.tt' %] | ||
[% END %] | ||
[% PROCESS 'reports/comp/pnp_multiple_graph_page.tt' %] | ||
[% PROCESS 'reports/comp/sla_outages.tt' %] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
plugins/plugins-available/reports2/templates/reports/comp/sla_outages.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
plugins/plugins-available/reports2/templates/reports/sla_report.tt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
[%# EDIT #%] | ||
[% IF block == 'edit' %] | ||
[% | ||
required_fields = [ | ||
{ 'language' => [ 'Language', 'language', 'en' ,'', 1 ] }, | ||
{ 'affected_sla_objects' => [ '', 'affected_sla_objects', '' ] }, | ||
{ 'filter_type' => [ 'Objects', 'radio', 'Both' ,'', 1, ['Services', 'Hosts', 'Both'] ] }, | ||
{ 'filter' => [ 'Filter', 'filter', { 'host' => 'all' } ] }, | ||
|
||
{ 'timeperiod' => [ 'Timeperiod', 'rptimeperiod', 'last12months' ] }, | ||
{ 'breakdown' => [ 'Breakdown by', 'breakdowns', 'months' ] }, | ||
{ 'rpttimeperiod' => [ 'Report Timeperiod', 'rpttimeperiod', '' ] }, | ||
{ 'sla' => [ 'SLA %', 'int', '98' ,'', 1 ] }, | ||
{ 'graph_min_sla' => [ 'Graph SLA %', 'int', '90' ,'', 1 ] }, | ||
{ 'decimals' => [ 'Decimal Points', 'int', '2' ,'', 1 ] }, | ||
{ 'servicenameformat' => [ 'Servicename Format', 'serviceformat', 'description' ] }, | ||
{ 'dateformat' => [ 'Dateformat', 'dateformat', '' ] }, | ||
{ 'datetimeformat' => [ 'Datetimeformat', 'datetimeformat', '' ] }, | ||
{ 'assumeinitialstates' => [ 'Assume Initial States', 'yes_no', 'yes' ] }, | ||
{ 'initialassumedservicestate' => [ 'Initial Assumed State', 'svc_initialassumedstate', '0' ] }, | ||
{ 'includesoftstates' => [ 'Include Soft States', 'yes_no', 'no' ] }, | ||
{ 'unavailable' => [ 'Unavailable States', 'svc_unavailable', ['critical', 'unknown'], '', 1 ] }, | ||
{ 'overview_max_level' => [ 'Overview SLA %', 'int_box', '-1' ,'hide object from overview table if sla is above or equal threshold', 0, 100 ] }, | ||
{ 'details_max_level' => [ 'Details SLA %', 'int_box', '100' ,'hide details if sla is above or equal threshold', 1, 100 ] }, | ||
{ 'mail_max_level' => [ 'Mail SLA %', 'int_box', '-1', 'cancel mail if no object breaks this sla', 0, 100] }, | ||
{ 'max_worst_pages' => [ 'Worst Outages', 'int_box', '1' ,'max. # pages', 1, 1 ] }, | ||
{ 'max_outages_pages' => [ 'Latest Outages', 'int_box', '-1' ,'max. # pages', 1, 1 ] }, | ||
{ 'max_pnp_sources' => [ 'Maximum Graph Sources', 'int_box', '1' ,'max. # graph images', 1, 1 ] }, | ||
{ 'attach_json' => [ 'Attach Json', 'yes_no', 'no', 'attach json raw data' ] }, | ||
]; | ||
%] | ||
[% END %] | ||
|
||
[%# MAIL LAYOUT #%] | ||
[% PROCESS 'reports/comp/mail.tt' %] | ||
|
||
[%# PREPARE REPORT #%] | ||
[% PROCESS 'reports/comp/sla_prepare.tt' %] | ||
|
||
[%# REPORT LAYOUT #%] | ||
[% IF block == 'render' %] | ||
[% PROCESS 'reports/comp/sla_render_settings.tt' %] | ||
[% | ||
title = loc('SLA Report') | ||
subtitle = r.name | ||
coverdetails = [ loc('Report Timeperiod:'), get_report_timeperiod(start, end, reportDateFormat) ]; | ||
%] | ||
|
||
[% WRAPPER 'reports/comp/report.tt' %] | ||
[% WRAPPER 'reports/comp/page_cover.tt' %][% END %] | ||
[% PROCESS 'reports/comp/backend_error_page.tt' %] | ||
[% IF param.filter_type == "Hosts" %] | ||
[% type = "host" %] | ||
[% ELSIF param.filter_type == "Services" %] | ||
[% type = "service" %] | ||
[% ELSE %] | ||
[% type = "both" %] | ||
[% END %] | ||
|
||
[% IF (total_hosts + total_services) > 1 %] | ||
[% WRAPPER 'reports/comp/page_standard.tt' pagetitle=loc("SLA Overview Graph") %] | ||
[% PROCESS 'reports/comp/sla_total_graph.tt' %] | ||
[% END %] | ||
[% END %] | ||
|
||
[% IF param.filter_type == "Hosts" %] | ||
[% FOREACH hst = avail_data.hosts.keys.sort %] | ||
[% PROCESS 'reports/comp/sla_details.tt' svc="" %] | ||
[% END %] | ||
|
||
[% ELSIF param.filter_type == "Services" %] | ||
[% FOREACH hst = avail_data.services.keys.sort %] | ||
[% FOREACH svc = avail_data.services.$hst.keys.sort %] | ||
[% PROCESS 'reports/comp/sla_details.tt' %] | ||
[% END %] | ||
[% END %] | ||
|
||
[% ELSIF param.filter_type == "Both" %] | ||
[% FOREACH hst = avail_data.services.keys.sort %] | ||
[% PROCESS 'reports/comp/sla_outage_details.tt' svc="" %] | ||
[% FOREACH svc = avail_data.services.$hst.keys.sort %] | ||
[% PROCESS 'reports/comp/sla_details.tt' %] | ||
[% END %] | ||
[% END %] | ||
[% END %] | ||
|
||
[% END %][%# report wrapper #%] | ||
[% END %][%# render block #%] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters