diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ae99797032..7850b9837e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2012-09-17 Vanessa Gil + + * operation/events/events_list.php + extensions/plugin_registration.php + operation/agentes/status_monitor.php + godmode/agentes/agent_template.php + godmode/massive/massive_edit_modules.php + godmode/modules/manage_network_templates.php + include/javascript/pandora_modules.js + include/functions_network_components.php: Added instructions to modules, + events, policies, massive operations... + 2012-09-17 Ramon Novoa * include/javascript/pandora_modules.js, diff --git a/pandora_console/extensions/plugin_registration.php b/pandora_console/extensions/plugin_registration.php index 0ceb2844af..54db0ced34 100644 --- a/pandora_console/extensions/plugin_registration.php +++ b/pandora_console/extensions/plugin_registration.php @@ -175,6 +175,9 @@ function pluginreg_extension_main () { 'tcp_port' => isset($ini_array[$label]["tcp_port"]) ? $ini_array[$label]["tcp_port"] : '', 'critical_inverse' => isset($ini_array[$label]["critical_inverse"]) ? $ini_array[$label]["critical_inverse"] : '', 'warning_inverse' => isset($ini_array[$label]["warning_inverse"]) ? $ini_array[$label]["warning_inverse"] : '', + 'critical_instructions' => isset($ini_array[$label]["critical_instructions"]) ? $ini_array[$label]["critical_instructions"] : '', + 'warning_instructions' => isset($ini_array[$label]["warning_instructions"]) ? $ini_array[$label]["warning_instructions"] : '', + 'unknown_instructions' => isset($ini_array[$label]["unknown_instructions"]) ? $ini_array[$label]["unknown_instructions"] : '', 'id_plugin' => $create_id); db_process_sql_insert('tnetwork_component', $values); diff --git a/pandora_console/godmode/agentes/agent_template.php b/pandora_console/godmode/agentes/agent_template.php index 32a59e9cf4..34e37405f3 100644 --- a/pandora_console/godmode/agentes/agent_template.php +++ b/pandora_console/godmode/agentes/agent_template.php @@ -88,6 +88,9 @@ if (isset ($_POST["template_id"])) { 'str_critical' => $row2['str_critical'], 'critical_inverse' => $row2['critical_inverse'], 'warning_inverse' => $row2['warning_inverse'], + 'critical_instructions' => $row2['critical_instructions'], + 'warning_instructions' => $row2['warning_instructions'], + 'unknown_instructions' => $row2['unknown_instructions'] ); $id_agente_modulo = db_process_sql_insert('tagente_modulo', $values); diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 058a762f51..a49e2c9b51 100644 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -353,6 +353,18 @@ $table->data['edit8'][2] = __('Tags'); $table->data['edit8'][3] = html_print_select_from_sql ('SELECT id_tag, name FROM ttag ORDER BY name', 'id_tag[]', $id_tag, '',__('None'),'0', true, true, false, false); +$table->data['edit10'][0] = ''.__('Critical instructions'). ''. ui_print_help_tip(__("Instructions when the status is critical"), true); +$table->data['edit10'][1] = html_print_textarea ('critical_instructions', 2, 50, '', '', true); +$table->colspan['edit10'][1] = 3; + +$table->data['edit11'][0] = ''.__('Warning instructions'). ''. ui_print_help_tip(__("Instructions when the status is warning"), true); +$table->data['edit11'][1] = html_print_textarea ('warning_instructions', 2, 50, '', '', true); +$table->colspan['edit11'][1] = 3; + +$table->data['edit12'][0] = ''.__('Unknown instructions').''. ui_print_help_tip(__("Instructions when the status is unknown"), true); +$table->data['edit12'][1] = html_print_textarea ('unknown_instructions', 2, 50, '', '', true); +$table->colspan['edit12'][1] = 3; + $table->data['edit9'][0] = __('Quiet'); $table->data['edit9'][0] .= ui_print_help_tip(__('The module still store data but the alerts and events will be stop'), true); $table->data['edit9'][1] = html_print_select(array(-1 => __('No change'), @@ -417,7 +429,7 @@ $(document).ready (function () { $(".select_modules_row_2").css('display', ''); } - $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide (); + $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide (); if (this.value == '0') { filter = ''; @@ -452,7 +464,7 @@ $(document).ready (function () { $("td#delete_table-0-1, td#delete_table-edit1-1, td#delete_table-edit2-1").css ("width", "300px"); $("#form_edit input[type=text]").attr ("value", ""); $("#form_edit input[type=checkbox]").not ("#checkbox-recursion").removeAttr ("checked"); - $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").show (); + $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").show (); } function clean_lists() { @@ -460,7 +472,7 @@ $(document).ready (function () { $("#module_name").html(''); $("#agents").html(''); $("#module").html(''); - $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit36, tr#delete_table-edit37, tr#delete_table-edit38, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide (); + $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit36, tr#delete_table-edit37, tr#delete_table-edit38, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide (); $('input[type=checkbox]').attr('checked', false); $('input[type=checkbox]').attr('disabled', true); $('#module_type').val(-1); @@ -477,7 +489,7 @@ $(document).ready (function () { else { $(".select_modules_row_2").css('display', ''); if($('#module_name option:selected').val() == undefined) { - $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide (); + $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide (); } } } @@ -492,12 +504,12 @@ $(document).ready (function () { if(this.checked) { $(".select_agents_row_2").css('display', 'none'); - $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").show (); + $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").show (); } else { $(".select_agents_row_2").css('display', ''); if($('#id_agents option:selected').val() == undefined) { - $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide (); + $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide (); } } } @@ -545,7 +557,7 @@ $(document).ready (function () { $(".select_agents_row_2").css('display', ''); } - $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide (); + $("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide (); jQuery.post ("ajax.php", {"page" : "operation/agentes/ver_agente", @@ -652,4 +664,4 @@ function process_manage_edit ($module_name, $agents_select = null) { return true; } -?> \ No newline at end of file +?> diff --git a/pandora_console/godmode/modules/manage_network_templates.php b/pandora_console/godmode/modules/manage_network_templates.php index 9a02271c64..31ab0279a1 100644 --- a/pandora_console/godmode/modules/manage_network_templates.php +++ b/pandora_console/godmode/modules/manage_network_templates.php @@ -101,7 +101,7 @@ if ($export_profile) { 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.str_warning, components.min_critical, - components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name + components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name, components.critical_instructions, components.warning_instructions, components.unknown_instructions 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 @@ -113,7 +113,7 @@ if ($export_profile) { 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.str_warning, components.min_critical, - components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name + components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name, components.critical_instructions, components.warning_instructions, components.unknown_instructions 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 @@ -125,7 +125,7 @@ if ($export_profile) { 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.str_warning, components.min_critical, - components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name + components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name, components.critical_instructions, components.warning_instructions, components.unknown_instructions 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_network_components.php b/pandora_console/include/functions_network_components.php index 2ca9b4aade..9471c74382 100644 --- a/pandora_console/include/functions_network_components.php +++ b/pandora_console/include/functions_network_components.php @@ -342,7 +342,9 @@ function network_components_create_module_from_network_component ($id_network_co 'min_ff_event', 'critical_inverse', 'warning_inverse', - )); + 'module_critical_instructions', + 'module_warning_instructions', + 'module_unknown_instructions')); if (empty ($component)) return false; $values = $component; @@ -407,6 +409,9 @@ function network_components_duplicate_network_component ($id_local_component) { $networkCopy['min_ff_event'] = $network['min_ff_event']; $networkCopy['critical_inverse'] = $network['critical_inverse']; $networkCopy['warning_inverse'] = $network['warning_inverse']; + $networkCopy['critical_instructions'] = $network['critical_instructions']; + $networkCopy['warning_instructions'] = $network['warning_instructions']; + $networkCopy['unknown_instructions'] = $network['unknown_instructions']; return network_components_create_network_component ($name, $network['type'], $network['id_group'], $networkCopy); } diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index ca152e083d..6292add168 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -86,6 +86,10 @@ function configure_modules_form () { $("#text-unit").attr("value", ''); $("#text-critical_inverse").attr ("value", 0); $("#text-warning_inverse").attr ("value", 0); + $("#textarea_critical_instructions").attr ("value", ''); + $("#textarea_warning_instructions").attr ("value", ''); + $("#textarea_unknown_instructions").attr ("value", ''); + } $("#local_component").change (function () { diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index f1f49d0a0d..fec63ceee0 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -404,6 +404,9 @@ switch ($config["dbtype"]) { tagente_modulo.extended_info, tagente_modulo.critical_inverse, tagente_modulo.warning_inverse, + tagente_modulo.critical_instructions, + tagente_modulo.warning_instructions, + tagente_modulo.unknown_instructions, tagente_estado.utimestamp AS utimestamp".$sql.") ORDER BY " . $order['field'] . " " . $order['order'] . " LIMIT ".$offset.",".$config["block_size"]; break; @@ -429,6 +432,11 @@ switch ($config["dbtype"]) { tagente_modulo.max_critical, tagente_modulo.str_critical, tagente_modulo.extended_info, + tagente_modulo.critical_inverse, + tagente_modulo.warning_inverse, + tagente_modulo.critical_instructions, + tagente_modulo.warning_instructions, + tagente_modulo.unknown_instructions, tagente_estado.utimestamp AS utimestamp".$sql.") LIMIT " . $config["block_size"] . " OFFSET " . $offset; break; case "oracle": @@ -455,6 +463,11 @@ switch ($config["dbtype"]) { tagente_modulo.max_critical, tagente_modulo.str_critical, tagente_modulo.extended_info, + tagente_modulo.critical_inverse, + tagente_modulo.warning_inverse, + tagente_modulo.critical_instructions, + tagente_modulo.warning_instructions, + tagente_modulo.unknown_instructions, tagente_estado.utimestamp AS utimestamp" . $sql; $sql = oracle_recode_query ($sql, $set); break; @@ -698,4 +711,4 @@ function toggle_full_value(id) { $("#value_module_text_" + id).html(value_title); } - \ No newline at end of file + diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 64d39e7fe6..0bea8dd828 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -1135,9 +1135,7 @@ foreach ($result as $event) { $string .= '- ' . __('Empty') . ' -'; } $string .= ''; - } - - if ($event["criticity"] == 3) { + } else if ($event["criticity"] == 3) { $string .= '' . '' . __('Warning instructions') . ''; if ($event["warning_instructions"] != '') { $string .= $event["warning_instructions"]; @@ -1148,9 +1146,7 @@ foreach ($result as $event) { $string .= '- ' . __('Empty') . ' -'; } $string .= ''; - } - - if ($event["criticity"] == 0) { + } else if ($event["criticity"] == 0) { $string .= '' . '' . __('Unknown instructions') . ''; if ($event["unknown_instructions"] != '') { $string .= $event["unknown_instructions"]; @@ -1163,17 +1159,6 @@ foreach ($result as $event) { $string .= ''; } - $string .= '' . '' . __('Unknown instructions') . ''; - if ($event["unknown_instructions"] != '') { - $string .= $event["unknown_instructions"]; - $string .= ''; - $odd = ($odd == '')? 'rowOdd' : ''; - } - else { - $string .= '- ' . __('Empty') . ' -'; - } - $string .= ''; - $string .= ''; $data = array($string); @@ -1489,4 +1474,4 @@ $(document).ready( function() { }); }); /* ]]> */ - \ No newline at end of file +