diff --git a/pandora_console/extras/mr/28.sql b/pandora_console/extras/mr/28.sql new file mode 100644 index 0000000000..1b79e8f440 --- /dev/null +++ b/pandora_console/extras/mr/28.sql @@ -0,0 +1,6 @@ + + START TRANSACTION; + + ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal'); + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 4cdb88ac30..e706124436 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1216,13 +1216,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 27); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 28); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '734'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '735'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); -- --------------------------------------------------------------------- @@ -2103,3 +2103,9 @@ ALTER TABLE `tnetflow_filter` DROP COLUMN `output`; -- Update table `tuser_task` -- ---------------------------------------------------------------------- UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report"; + +-- ---------------------------------------------------------------------- +-- Alter table `talert_templates` +-- ---------------------------------------------------------------------- + + ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal'); diff --git a/pandora_console/godmode/alerts/alert_view.php b/pandora_console/godmode/alerts/alert_view.php index 0e5771720f..6de5473020 100644 --- a/pandora_console/godmode/alerts/alert_view.php +++ b/pandora_console/godmode/alerts/alert_view.php @@ -186,6 +186,10 @@ switch ($template['type']) { $condition = __('The alert would fire when the module is in critical status'); break; + case 'not_normal': + $condition = __('The alert would fire when the module is in not normal status'); + break; + case 'unknown': $condition = __('The alert would fire when the module is in unknown status'); break; diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index d6828dd599..6603e5230f 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -679,7 +679,7 @@ if ($step == 2) { 'type', $type, '', - __('Select'), + __('None'), 0, true, false, @@ -1018,6 +1018,7 @@ var onchange_msg = ; var unknown = ; var error_message_min_max_zero = ; +var not_normal = ; function check_fields_step2() { var correct = true; @@ -1174,6 +1175,13 @@ if ($step == 2) { /* Show example */ $("span#example").empty ().append (critical); break; + case "not_normal": + $("#template-value, #template-max, span#matches_value, #template-min").hide (); + $("#template-example").show (); + + /* Show example */ + $("span#example").empty ().append (not_normal); + break; case "onchange": $("#template-value, #template-max, #template-min").hide (); $("#template-example, span#matches_value").show (); diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 6bfe709c32..011acafae9 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -664,6 +664,7 @@ function alerts_get_alert_templates_types() $types['unknown'] = __('Unknown status'); $types['onchange'] = __('On Change'); $types['always'] = __('Always'); + $types['not_normal'] = __('Not normal status'); return $types; } @@ -680,7 +681,7 @@ function alerts_get_alert_templates_type_name($type) { $types = alerts_get_alert_templates_types(); - if (! isset($type[$type])) { + if (!isset($types[$type])) { return __('Unknown'); } diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 7b9517f661..e3f4291282 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -114,10 +114,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_report_front_logo', 'images/pandora_logo_white.jpg'), ('custom_report_front_header', ''), ('custom_report_front_footer', ''), -('MR', 27), +('MR', 28), ('identification_reminder', 1), ('identification_reminder_timestamp', 0), -('current_package_enterprise', '734'), +('current_package_enterprise', '735'), ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'), ('custom_docs_logo', 'default_docs.png'), ('custom_support_logo', 'default_support.png'),