minor changes

This commit is contained in:
alejandro.campos@artica.es 2021-09-30 16:02:14 +02:00
parent fc6fb36293
commit 277fcd51ca
2 changed files with 5 additions and 13 deletions

View File

@ -15,7 +15,7 @@ ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_warning_status` TIN
ALTER TABLE `treport_content` ADD COLUMN `time_in_warning_status` TINYINT(1) DEFAULT '0'; ALTER TABLE `treport_content` ADD COLUMN `time_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0'; ALTER TABLE `treport_content` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0';
INSERT INTO `treport_content` (id_report, id_gs, id_agent_module, type, period, `order`, name, description, id_agent, `text`, external_source, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, style, server_name, time_in_warning_status, checks_in_warning_status) SELECT id_report, 0, id_agent_module, 'availability', period, `order`, name, description, id_agent, NULL, NULL, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, '{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":1,"dyn_height":"230"}', server_name, 1, 1 FROM treport_content WHERE type = 'histogram_data'; INSERT INTO `treport_content` (id_report, id_gs, id_agent_module, type, period, `order`, name, description, id_agent, `text`, external_source, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, style, server_name, time_in_warning_status, checks_in_warning_status, failover_mode) SELECT id_report, 0, id_agent_module, 'availability', period, `order`, name, description, id_agent, NULL, NULL, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, '{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":1,"dyn_height":"230"}', server_name, 1, 1, 0 FROM treport_content WHERE type = 'histogram_data';
INSERT INTO `treport_content_item` (id_report_content, id_agent_module, id_agent_module_failover, operation, server_name) SELECT id_rc, id_agent_module, 0, '', server_name FROM treport_content WHERE type = 'availability' AND id_agent <> 0 AND id_agent_module <> 0; INSERT INTO `treport_content_item` (id_report_content, id_agent_module, id_agent_module_failover, operation, server_name) SELECT id_rc, id_agent_module, 0, '', server_name FROM treport_content WHERE type = 'availability' AND id_agent <> 0 AND id_agent_module <> 0;
DELETE FROM `treport_content` WHERE type = 'histogram_data'; DELETE FROM `treport_content` WHERE type = 'histogram_data';

View File

@ -6756,26 +6756,18 @@ function reporting_advanced_sla(
$min_value = null; $min_value = null;
} }
if ((!isset($min_value_warning)) || ($min_value_warning == 0)) {
$min_value_warning = null;
}
if ((!isset($max_value)) || ($max_value == 0)) { if ((!isset($max_value)) || ($max_value == 0)) {
$max_value = null; $max_value = null;
} }
if ((!isset($max_value_warning)) || ($max_value_warning == 0)) {
$max_value_warning = null;
}
if ((!(isset($max_value))) && (!(isset($min_value)))) { if ((!(isset($max_value))) && (!(isset($min_value)))) {
$max_value = null; $max_value = null;
$min_value = null; $min_value = null;
} }
if ((!(isset($max_value_warning))) && (!(isset($min_value_warning)))) { if ((!(isset($max_value_warning))) && (!(isset($min_value_warning)))) {
$max_value_warning = null; $max_value_warning = 0;
$min_value_warning = null; $min_value_warning = 0;
} }
} }
@ -7326,7 +7318,7 @@ function reporting_advanced_sla(
$warning_checks++; $warning_checks++;
} }
$time_in_warning += $time_interval; $time_in_warning += $time_interval;
} else if ($sla_check_value === true) { } else if ($sla_check_value === true) {
if (isset($current_data['type']) === false if (isset($current_data['type']) === false
|| ((int) $current_data['type'] === 0 || ((int) $current_data['type'] === 0
@ -7335,7 +7327,7 @@ function reporting_advanced_sla(
$ok_checks++; $ok_checks++;
} }
$time_in_ok += $time_interval; $time_in_ok += $time_interval;
} else { } else {
if (isset($current_data['type']) === false if (isset($current_data['type']) === false
|| ((int) $current_data['type'] === 0 || ((int) $current_data['type'] === 0