diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f2150fa09c..a670b0389a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,28 @@ +2011-07-07 Ramon Novoa + + * include/functions_network_components.php, + include/functions_api.php, + include/functions_ui.php, + pandoradb.sql, + pandoradb.postgreSQL.sql, + pandoradb.oracle.sql, + extensions/resource_registration.php, + extensions/plugin_registration.php, + operation/agentes/status_monitor.php, + operation/agentes/estado_monitores.php, + extras/pandoradb_migrate_v3.2_to_v4.0.sql, + godmode/agentes/module_manager_editor_common.php, + godmode/agentes/module_manager.php, + godmode/agentes/configurar_agente.php, + godmode/agentes/module_manager_editor.php, + godmode/massive/massive_edit_modules.php, + godmode/modules/manage_network_components_form.php, + godmode/modules/manage_network_templates.php, + godmode/modules/manage_network_components_form_common.php, + godmode/modules/manage_network_components.php: Added support for + warning/critical status regexp (works with both numeric and string + data types). + 2011-07-07 Sergio Martin * pandoradb.sql @@ -39,6 +64,7 @@ pandoradb.data.oracle.sql: Default skin applied to all groups by default. +>>>>>>> .r4523 2011-07-06 Juan Manuel Ramon * include/styles/pandora.css diff --git a/pandora_console/extensions/plugin_registration.php b/pandora_console/extensions/plugin_registration.php index 576b7ac5f7..d5e1edaae2 100644 --- a/pandora_console/extensions/plugin_registration.php +++ b/pandora_console/extensions/plugin_registration.php @@ -146,7 +146,11 @@ function pluginreg_extension_main () { 'max_timeout' => $ini_array[$label]["max_timeout"], 'history_data' => $ini_array[$label]["history_data"], 'min_warning' => $ini_array[$label]["min_warning"], + 'max_warning' => $ini_array[$label]["max_warning"], + 'str_warning' => $ini_array[$label]["str_warning"], 'min_critical' => $ini_array[$label]["min_critical"], + 'max_critical' => $ini_array[$label]["max_critical"], + 'str_critical' => $ini_array[$label]["str_critical"], 'min_ff_event' => $ini_array[$label]["min_ff_event"], 'tcp_port' => $ini_array[$label]["tcp_port"], 'id_plugin' => $create_id); diff --git a/pandora_console/extensions/resource_registration.php b/pandora_console/extensions/resource_registration.php index 40c7298109..053624fd64 100644 --- a/pandora_console/extensions/resource_registration.php +++ b/pandora_console/extensions/resource_registration.php @@ -607,8 +607,10 @@ function process_upload_xml_component($xml) { $historical_data = (int)$componentElement->historical_data; $min_war = (float)$componentElement->min_war; $max_war = (float)$componentElement->max_war; + $str_war = (string)$componentElement->str_war; $min_cri = (float)$componentElement->min_cri; $max_cri = (float)$componentElement->max_cri; + $str_cri = (string)$componentElement->str_cri; $ff_treshold = (int)$componentElement->ff_treshold; $snmp_version = (int)$componentElement->snmp_version; $auth_user = io_safe_input((string)$componentElement->auth_user); @@ -676,8 +678,10 @@ function process_upload_xml_component($xml) { 'history_data' => $historical_data, 'min_warning' => $min_war, 'max_warning' => $max_war, + 'str_warning' => $str_war, 'min_critical' => $min_cri, 'max_critical' => $max_cri, + 'str_critical' => $str_cri, 'min_ff_event' => $ff_treshold, 'custom_string_1' => $custom_string_1, 'custom_string_2' => $custom_string_2, @@ -709,8 +713,10 @@ function process_upload_xml_component($xml) { 'history_data' => $historical_data, 'min_warning' => $min_war, 'max_warning' => $max_war, + 'str_warning' => $str_war, 'min_critical' => $min_cri, 'max_critical' => $max_cri, + 'str_critical' => $str_cri, 'min_ff_event' => $ff_treshold, 'custom_string_1' => $custom_string_1, 'custom_string_2' => $custom_string_2, @@ -744,8 +750,10 @@ function process_upload_xml_component($xml) { 'history_data' => $historical_data, 'min_warning' => $min_war, 'max_warning' => $max_war, + 'str_warning' => $str_war, 'min_critical' => $min_cri, 'max_critical' => $max_cri, + 'str_critical' => $str_cri, 'min_ff_event' => $ff_treshold, 'custom_string_1' => $custom_string_1, 'custom_string_2' => $custom_string_2, diff --git a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql index 9b7c9e206f..a2082160fc 100644 --- a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql +++ b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql @@ -181,6 +181,8 @@ CREATE TABLE IF NOT EXISTS `ttag_event` ( -- ----------------------------------------------------- ALTER TABLE `tagente_modulo` ADD COLUMN (`unit` text DEFAULT ''); +ALTER TABLE `tagente_modulo` ADD COLUMN (`str_warning` text DEFAULT ''); +ALTER TABLE `tagente_modulo` ADD COLUMN (`str_critical` text DEFAULT ''); ALTER TABLE `tagente_modulo` ADD INDEX module(id_modulo); -- ----------------------------------------------------- diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index a673f066c8..90c9d7df5e 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -643,8 +643,10 @@ if ($update_module || $create_module) { $history_data = (int) get_parameter('history_data'); $min_warning = (float) get_parameter ('min_warning'); $max_warning = (float) get_parameter ('max_warning'); + $str_warning = (string) get_parameter ('str_warning'); $min_critical = (float) get_parameter ('min_critical'); $max_critical = (float) get_parameter ('max_critical'); + $str_critical = (string) get_parameter ('str_critical'); $ff_event = (int) get_parameter ('ff_event'); $unit = (string) get_parameter('unit'); $id_tag = (array) get_parameter('id_tag_selected'); @@ -689,8 +691,10 @@ if ($update_module) { 'history_data' => $history_data, 'min_warning' => $min_warning, 'max_warning' => $max_warning, + 'str_warning' => $str_warning, 'min_critical' => $min_critical, 'max_critical' => $max_critical, + 'str_critical' => $str_critical, 'custom_string_1' => $custom_string_1, 'custom_string_2' => $custom_string_2, 'custom_string_3' => $custom_string_3, @@ -767,8 +771,10 @@ if ($create_module) { 'history_data' => $history_data, 'min_warning' => $min_warning, 'max_warning' => $max_warning, + 'str_warning' => $str_warning, 'min_critical' => $min_critical, 'max_critical' => $max_critical, + 'str_critical' => $str_critical, 'custom_string_1' => $custom_string_1, 'custom_string_2' => $custom_string_2, 'custom_string_3' => $custom_string_3, diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 32e876f7a6..26fae6ebb0 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -260,7 +260,8 @@ $modules = db_get_all_rows_filter ('tagente_modulo', 'order' => $order), array ('id_agente_modulo', 'id_tipo_modulo', 'descripcion', 'nombre', 'max', 'min', 'module_interval', 'id_modulo', 'id_module_group', - 'disabled','max_warning', 'min_warning', 'max_critical', 'min_critical')); + 'disabled','max_warning', 'min_warning', 'str_warning', + 'max_critical', 'min_critical', 'str_critical')); if ($modules === false) { echo "
".__('No available data to show')."
"; @@ -414,7 +415,7 @@ foreach ($modules as $module) { $data[5] = ui_print_truncate_text($module['descripcion'], 25, false); // MAX / MIN values - $data[6] = ui_print_module_warn_value ($module["max_warning"], $module["min_warning"], $module["max_critical"], $module["min_critical"]); + $data[6] = ui_print_module_warn_value ($module["max_warning"], $module["min_warning"], $module["str_warning"], $module["max_critical"], $module["min_critical"], $module["str_critical"]); // Delete module $data[7] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true); diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index d30b734175..abf1e51aa3 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -172,8 +172,10 @@ if ($id_agent_module) { $history_data = $module['history_data']; $min_warning = $module['min_warning']; $max_warning = $module['max_warning']; + $str_warning = $module['str_warning']; $min_critical = $module['min_critical']; $max_critical = $module['max_critical']; + $str_critical = $module['str_critical']; $ff_event = $module['min_ff_event']; // Select tag info. $id_tag = tags_get_module_tags ($id_agent_module); @@ -215,8 +217,10 @@ else { $history_data = 1; $min_warning = 0; $max_warning = 0; + $str_warning = ''; $min_critical = 0; $max_critical = 0; + $str_critical = ''; $ff_event = 0; // New support for snmp v3 diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 81cb3f9e78..cb946e328a 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -175,6 +175,9 @@ $table_simple->data[2][1] .= html_print_input_text ('min_warning', $min_warning, $table_simple->data[2][1] .= '
'.__('Max.').''; $table_simple->data[2][1] .= html_print_input_text ('max_warning', $max_warning, '', 10, 255, true, $disabledBecauseInPolicy); +$table_simple->data[2][1] .= '
'.__('Str.').''; +$table_simple->data[2][1] .= html_print_input_text ('str_warning', $str_warning, + '', 10, 255, true, $disabledBecauseInPolicy); $table_simple->data[2][2] = __('Critical status').' ' . ui_print_help_icon ('critical_status', true); $table_simple->data[2][3] = ''.__('Min. ').''; $table_simple->data[2][3] .= html_print_input_text ('min_critical', $min_critical, @@ -182,6 +185,9 @@ $table_simple->data[2][3] .= html_print_input_text ('min_critical', $min_critica $table_simple->data[2][3] .= '
'.__('Max.').''; $table_simple->data[2][3] .= html_print_input_text ('max_critical', $max_critical, '', 10, 255, true, $disabledBecauseInPolicy); +$table_simple->data[2][3] .= '
'.__('Str.').''; +$table_simple->data[2][3] .= html_print_input_text ('str_critical', $str_critical, + '', 10, 255, true, $disabledBecauseInPolicy); /* FF stands for Flip-flop */ $table_simple->data[3][0] = __('FF threshold').' ' . ui_print_help_icon ('ff_threshold', true); diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index bf4a3438c7..64272c48ee 100644 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -35,7 +35,7 @@ function process_manage_edit ($module_name, $agents_select = null) { } /* List of fields which can be updated */ - $fields = array ('min_warning', 'max_warning', 'min_critical', 'max_critical', 'min_ff_event', 'module_interval', + $fields = array ('min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', 'min_ff_event', 'module_interval', 'disabled', 'post_process', 'snmp_community', 'tcp_send', 'min', 'max', 'id_module_group', 'plugin_user', 'plugin_pass', 'id_export', 'history_data'); $values = array (); foreach ($fields as $field) { @@ -298,11 +298,15 @@ $table->data['edit1'][1] = ''.__('Min.').''; $table->data['edit1'][1] .= html_print_input_text ('min_warning', '', '', 5, 15, true); $table->data['edit1'][1] .= '
'.__('Max.').''; $table->data['edit1'][1] .= html_print_input_text ('max_warning', '', '', 5, 15, true); +$table->data['edit1'][1] .= '
'.__('Str.').''; +$table->data['edit1'][1] .= html_print_input_text ('str_warning', '', '', 5, 15, true); $table->data['edit1'][2] = __('Critical status'); $table->data['edit1'][3] = ''.__('Min.').''; $table->data['edit1'][3] .= html_print_input_text ('min_critical', '', '', 5, 15, true); $table->data['edit1'][3] .= '
'.__('Max.').''; $table->data['edit1'][3] .= html_print_input_text ('max_critical', '', '', 5, 15, true); +$table->data['edit1'][3] .= '
'.__('Str.').''; +$table->data['edit1'][3] .= html_print_input_text ('str_critical', '', '', 5, 15, true); $table->data['edit2'][0] = __('Interval'); $table->data['edit2'][1] = html_print_input_text ('module_interval', '', '', 5, 15, true); diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index 80db141c5c..381901b75e 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -51,8 +51,10 @@ $id_modulo = (int) get_parameter ('id_component_type'); $id_plugin = (int) get_parameter ('id_plugin'); $min_warning = (int) get_parameter ('min_warning'); $max_warning = (int) get_parameter ('max_warning'); +$str_warning = (string) get_parameter ('str_warning'); $min_critical = (int) get_parameter ('min_critical'); $max_critical = (int) get_parameter ('max_critical'); +$str_critical = (string) get_parameter ('str_critical'); $ff_event = (int) get_parameter ('ff_event'); $history_data = (bool) get_parameter ('history_data'); $post_process = (float) get_parameter('post_process'); @@ -124,8 +126,10 @@ if ($create_component) { 'history_data' => $history_data, 'min_warning' => $min_warning, 'max_warning' => $max_warning, + 'str_warning' => $str_warning, 'min_critical' => $min_critical, 'max_critical' => $max_critical, + 'str_critical' => $str_critical, 'min_ff_event' => $ff_event, 'custom_string_1' => $custom_string_1, 'custom_string_2' => $custom_string_2, @@ -180,8 +184,10 @@ if ($update_component) { 'history_data' => $history_data, 'min_warning' => $min_warning, 'max_warning' => $max_warning, + 'str_warning' => $str_warning, 'min_critical' => $min_critical, 'max_critical' => $max_critical, + 'str_critical' => $str_critical, 'min_ff_event' => $ff_event, 'custom_string_1' => $custom_string_1, 'custom_string_2' => $custom_string_2, @@ -243,8 +249,10 @@ $url = ui_get_url_refresh (array ('offset' => false, 'history_data' => false, 'min_warning' => false, 'max_warning' => false, + 'str_warning' => false, 'min_critical' => false, 'max_critical' => false, + 'str_critical' => false, 'ff_event' => false, 'id_component_type' => false)); diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index 90e58f7794..a3137072d2 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -50,8 +50,10 @@ if (isset ($id)) { $max_timeout = $component["max_timeout"]; $min_warning = $component["min_warning"]; $max_warning = $component["max_warning"]; + $str_warning = $component["str_warning"]; $max_critical = $component["max_critical"]; $min_critical = $component["min_critical"]; + $str_critical = $component["str_critical"]; $ff_event = $component["min_ff_event"]; $history_data = $component["history_data"]; $post_process = $component["post_process"]; @@ -87,8 +89,10 @@ if (isset ($id)) { $type = 0; $min_warning = 0; $max_warning = 0; + $str_warning = ''; $max_critical = 0; $min_critical = 0; + $str_critical = ''; $ff_event = 0; $history_data = true; $post_process = 0; diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php index 6dfbe984f5..ab0e3c7172 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -75,6 +75,9 @@ $table->data[3][1] .= html_print_input_text ('min_warning', $min_warning, $table->data[3][1] .= '
'.__('Max.').''; $table->data[3][1] .= html_print_input_text ('max_warning', $max_warning, '', 5, 15, true); +$table->data[3][1] .= '
'.__('Str.').''; +$table->data[3][1] .= html_print_input_text ('str_warning', $str_warning, + '', 5, 15, true); $table->data[3][2] = __('Critical status'); $table->data[3][3] = ''.__('Min.').''; $table->data[3][3] .= html_print_input_text ('min_critical', $min_critical, @@ -82,6 +85,9 @@ $table->data[3][3] .= html_print_input_text ('min_critical', $min_critical, $table->data[3][3] .= '
'.__('Max.').''; $table->data[3][3] .= html_print_input_text ('max_critical', $max_critical, '', 5, 15, true); +$table->data[3][3] .= '
'.__('Str.').''; +$table->data[3][3] .= html_print_input_text ('str_critical', $str_critical, + '', 5, 15, true); $table->data[4][0] = __('FF threshold') . ' ' . ui_print_help_icon ('ff_threshold', true); $table->data[4][1] = html_print_input_text ('ff_event', $ff_event, diff --git a/pandora_console/godmode/modules/manage_network_templates.php b/pandora_console/godmode/modules/manage_network_templates.php index baecd0c0ed..38c760adac 100644 --- a/pandora_console/godmode/modules/manage_network_templates.php +++ b/pandora_console/godmode/modules/manage_network_templates.php @@ -60,8 +60,8 @@ if ($export_profile) { SELECT components.name, components.description, components.type, components.max, components.min, components.module_interval, components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid, components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter, - components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.min_critical, - components.max_critical, components.min_ff_event, comp_group.name AS group_name + components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical, + components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name FROM `tnetwork_component` AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group WHERE tpc.id_nc = components.id_nc AND components.id_group = comp_group.id_sg @@ -72,8 +72,8 @@ if ($export_profile) { SELECT components.name, components.description, components.type, components.max, components.min, components.module_interval, components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid, components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter, - components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.min_critical, - components.max_critical, components.min_ff_event, comp_group.name AS group_name + components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical, + components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name FROM \"tnetwork_component\" AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group WHERE tpc.id_nc = components.id_nc AND components.id_group = comp_group.id_sg @@ -84,8 +84,8 @@ if ($export_profile) { SELECT components.name, components.description, components.type, components.max, components.min, components.module_interval, components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid, components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter, - components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.min_critical, - components.max_critical, components.min_ff_event, comp_group.name AS group_name + components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical, + components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name FROM tnetwork_component AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group WHERE tpc.id_nc = components.id_nc AND components.id_group = comp_group.id_sg diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 623e719d9a..e93e2eb3d6 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -348,8 +348,10 @@ function get_tree_agents($trash1, $trahs2, $other, $returnType) 'module_history_data' => $module['history_data'], 'module_min_warning' => $module['min_warning'], 'module_max_warning' => $module['max_warning'], + 'module_str_warning' => $module['str_warning'], 'module_min_critical' => $module['min_critical'], 'module_max_critical' => $module['max_critical'], + 'module_str_critical' => $module['str_critical'], 'module_min_ff_event' => $module['min_ff_event'], 'module_delete_pending' => $module['delete_pending'], 'module_id_agent_state' => $module['id_agente_estado'], @@ -533,8 +535,10 @@ function get_tree_agents($trash1, $trahs2, $other, $returnType) 'module_history_data', 'module_min_warning', 'module_max_warning', + 'module_str_warning', 'module_min_critical', 'module_max_critical', + 'module_str_critical', 'module_min_ff_event', 'module_delete_pending', 'module_id_agent_state', @@ -706,7 +710,7 @@ function set_delete_agent($id, $thrash1, $thrast2, $thrash3) { * @param string $id Name of agent to add the module. * @param $thrash1 Don't use. * @param array $other it's array, $other as param is ;;; - * ;;;;;; + * ;;;;;;;; * ;;;;;;; * ;;; in this order * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_) @@ -729,20 +733,22 @@ function set_create_network_module($id, $thrash1, $other, $thrash3) { 'id_module_group' => $other['data'][3], 'min_warning' => $other['data'][4], 'max_warning' => $other['data'][5], - 'min_critical' => $other['data'][6], - 'max_critical' => $other['data'][7], - 'min_ff_event' => $other['data'][8], - 'history_data' => $other['data'][9], - 'ip_target' => $other['data'][10], - 'tcp_port' => $other['data'][11], - 'snmp_community' => $other['data'][12], - 'snmp_oid' => $other['data'][13], - 'module_interval' => $other['data'][14], - 'post_process' => $other['data'][15], - 'min' => $other['data'][16], - 'max' => $other['data'][17], - 'custom_id' => $other['data'][18], - 'descripcion' => $other['data'][19], + 'str_warning' => $other['data'][6], + 'min_critical' => $other['data'][7], + 'max_critical' => $other['data'][8], + 'str_critical' => $other['data'][9], + 'min_ff_event' => $other['data'][10], + 'history_data' => $other['data'][11], + 'ip_target' => $other['data'][12], + 'tcp_port' => $other['data'][13], + 'snmp_community' => $other['data'][14], + 'snmp_oid' => $other['data'][15], + 'module_interval' => $other['data'][16], + 'post_process' => $other['data'][17], + 'min' => $other['data'][18], + 'max' => $other['data'][19], + 'custom_id' => $other['data'][20], + 'descripcion' => $other['data'][21], ); $idModule = modules_create_agent_module($idAgent, $name, $values, true); @@ -1070,17 +1076,25 @@ function set_new_module($id, $id2, $other, $trash1) { if ($other['data'][9] != '') { $values['max_warning'] = $other['data'][9]; } - + if ($other['data'][10] != '') { - $values['min_critical'] = $other['data'][10]; + $values['str_warning'] = $other['data'][10]; } if ($other['data'][11] != '') { - $values['max_critical'] = $other['data'][11]; + $values['min_critical'] = $other['data'][11]; } if ($other['data'][12] != '') { - $values['history_data'] = $other['data'][12]; + $values['max_critical'] = $other['data'][12]; + } + + if ($other['data'][13] != '') { + $values['str_critical'] = $other['data'][13]; + } + + if ($other['data'][14] != '') { + $values['history_data'] = $other['data'][14]; } $values['id_modulo'] = 2; diff --git a/pandora_console/include/functions_network_components.php b/pandora_console/include/functions_network_components.php index 93fe6b1789..99c35b0ede 100644 --- a/pandora_console/include/functions_network_components.php +++ b/pandora_console/include/functions_network_components.php @@ -332,8 +332,10 @@ function network_components_create_module_from_network_component ($id_network_co 'history_data', 'min_warning', 'max_warning', + 'str_warning', 'min_critical', 'max_critical', + 'str_critical', 'min_ff_event')); if (empty ($component)) return false; @@ -392,8 +394,10 @@ function network_components_duplicate_network_component ($id_local_component) { $networkCopy['history_data'] = $network['history_data']; $networkCopy['min_warning'] = $network['min_warning']; $networkCopy['max_warning'] = $network['max_warning']; + $networkCopy['str_warning'] = $network['str_warning']; $networkCopy['min_critical'] = $network['min_critical']; $networkCopy['max_critical'] = $network['max_critical']; + $networkCopy['str_critical'] = $network['str_critical']; $networkCopy['min_ff_event'] = $network['min_ff_event']; return network_components_create_network_component ($name, $network['type'], $network['id_group'], $networkCopy); diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 72ed90a95a..1366238583 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1313,14 +1313,14 @@ function ui_print_moduletype_icon ($id_moduletype, $return = false) { * * @return string HTML string */ -function ui_print_module_warn_value ($max_warning, $min_warning, $max_critical, $min_critical) { +function ui_print_module_warn_value ($max_warning, $min_warning, $str_warning, $max_critical, $min_critical, $str_critical) { $data = ""; if ($max_warning != $min_warning) { $data .= format_for_graph($max_warning) ."/". format_for_graph ($min_warning); } else { $data .= __("N/A"); - } + } $data .= " - "; diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index ff22704ca4..816c5dfce6 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -399,7 +399,7 @@ foreach ($modules as $module) { } } - $data[6] = ui_print_module_warn_value ($module["max_warning"], $module["min_warning"], $module["max_critical"], $module["min_critical"]); + $data[6] = ui_print_module_warn_value ($module["max_warning"], $module["min_warning"], $module["str_warning"], $module["max_critical"], $module["min_critical"], $module["str_critical"]); $data[7] = $salida; $graph_type = return_graphtype ($module["id_tipo_modulo"]); diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 0ee3e6945d..9e26e22592 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -262,8 +262,10 @@ switch ($config["dbtype"]) { tagente_estado.estado, tagente_modulo.min_warning, tagente_modulo.max_warning, + tagente_modulo.str_warning, tagente_modulo.min_critical, tagente_modulo.max_critical, + tagente_modulo.str_critical, tagente_estado.utimestamp AS utimestamp".$sql." LIMIT ".$offset.",".$config["block_size"]; break; case "postgresql": @@ -282,8 +284,10 @@ switch ($config["dbtype"]) { tagente_estado.estado, tagente_modulo.min_warning, tagente_modulo.max_warning, + tagente_modulo.str_warning, tagente_modulo.min_critical, tagente_modulo.max_critical, + tagente_modulo.str_critical, tagente_estado.utimestamp AS utimestamp".$sql." LIMIT " . $config["block_size"] . " OFFSET " . $offset; break; case "oracle": @@ -304,8 +308,10 @@ switch ($config["dbtype"]) { tagente_estado.estado, tagente_modulo.min_warning, tagente_modulo.max_warning, + tagente_modulo.str_warning, tagente_modulo.min_critical, tagente_modulo.max_critical, + tagente_modulo.str_critical, tagente_estado.utimestamp AS utimestamp".$sql; $sql = oracle_recode_query ($sql, $set); break; @@ -469,7 +475,7 @@ foreach ($result as $row) { $data[6] .= " " . html_print_image('images/binary.png', true, array("style" => '0', "alt" => '')) . ""; } - $data[7] = ui_print_module_warn_value($row['max_warning'], $row['min_warning'], $row['max_critical'], $row['min_critical']); + $data[7] = ui_print_module_warn_value($row['max_warning'], $row['min_warning'], $row['str_warning'], $row['max_critical'], $row['min_critical'], $row['str_critical']); if (is_numeric($row["datos"])) $data[8] = format_numeric($row["datos"]); diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index d905689868..e8303bfa91 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -193,8 +193,10 @@ CREATE TABLE tagente_modulo ( history_data NUMBER(5, 0) default 1, min_warning BINARY_DOUBLE default 0, max_warning BINARY_DOUBLE default 0, + str_warning CLOB default '', min_critical BINARY_DOUBLE default 0, max_critical BINARY_DOUBLE default 0, + str_critical CLOB default '', min_ff_event INTEGER default 0, delete_pending NUMBER(5, 0) default 0 NOT NULL, policy_linked NUMBER(5, 0) default 0 NOT NULL, @@ -603,8 +605,10 @@ CREATE TABLE tnetwork_component ( history_data NUMBER(5, 0) default 1, min_warning BINARY_DOUBLE default 0, max_warning BINARY_DOUBLE default 0, + str_warning CLOB default '', min_critical BINARY_DOUBLE default 0, max_critical BINARY_DOUBLE default 0, + str_critical CLOB default '', min_ff_event NUMBER(10, 0) default 0, custom_string_1 CLOB default '', custom_string_2 CLOB default '', diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 11c5fbc09e..28caa70212 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -179,8 +179,10 @@ CREATE TABLE "tagente_modulo" ( "history_data" SMALLINT default 1, "min_warning" DOUBLE PRECISION default 0, "max_warning" DOUBLE PRECISION default 0, + "str_warning" text, "min_critical" DOUBLE PRECISION default 0, "max_critical" DOUBLE PRECISION default 0, + "str_critical" text, "min_ff_event" INTEGER default 0, "delete_pending" SMALLINT NOT NULL default 0, "policy_linked" SMALLINT NOT NULL default 0, @@ -484,8 +486,10 @@ CREATE TABLE "tnetwork_component" ( "history_data" SMALLINT default 1, "min_warning" DOUBLE PRECISION default 0, "max_warning" DOUBLE PRECISION default 0, + "str_warning" text, "min_critical" DOUBLE PRECISION default 0, "max_critical" DOUBLE PRECISION default 0, + "str_critical" text, "min_ff_event" INTEGER default 0, "custom_string_1" text default '', "custom_string_2" text default '', diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index dbedc7fb82..d2d9b97925 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -173,8 +173,10 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `history_data` tinyint(1) unsigned default '1', `min_warning` double(18,2) default 0, `max_warning` double(18,2) default 0, + `str_warning` text default '', `min_critical` double(18,2) default 0, `max_critical` double(18,2) default 0, + `str_critical` text default '', `min_ff_event` int(4) unsigned default '0', `delete_pending` int(1) unsigned default 0, `policy_linked` tinyint(1) unsigned not null default 0, @@ -525,8 +527,10 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `history_data` tinyint(1) unsigned default '1', `min_warning` double(18,2) default 0, `max_warning` double(18,2) default 0, + `str_warning` text default '', `min_critical` double(18,2) default 0, `max_critical` double(18,2) default 0, + `str_critical` text default '', `min_ff_event` int(4) unsigned default '0', `custom_string_1` text default '', `custom_string_2` text default '',