From 3a27b49edd3180d064e6f896d86a86353f5bc447 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 7 Oct 2014 14:29:19 +0200 Subject: [PATCH 1/4] Delete old data that was not exported. --- pandora_server/util/pandora_db.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 4c4edadc3e..4fe43b7a70 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -82,6 +82,9 @@ sub pandora_purgedb ($$) { # Delete old numeric data pandora_delete_old_module_data ($dbh, 'tagente_datos', $ulimit_access_timestamp, $ulimit_timestamp); + + # Delete old export data + pandora_delete_old_export_data ($dbh, $ulimit_timestamp); # Delete extended session data if (enterprise_load (\%conf) != 0) { @@ -845,6 +848,18 @@ sub pandora_delete_old_module_data { } } +############################################################################## +# Delete old export data. +############################################################################## +sub pandora_delete_old_export_data { + my ($dbh, $ulimit_timestamp) = @_; + + log_message ('PURGE', "Deleting old export data from tserver_export_data\n"); + while(db_do ($dbh, "DELETE FROM tserver_export_data WHERE UNIX_TIMESTAMP(timestamp) < ? LIMIT $SMALL_OPERATION_STEP", $ulimit_timestamp) ne '0E0') { + usleep (10000); + }; +} + ############################################################################### # Main ############################################################################### From 464031de215775c808b97537d2b55bc0e99e7459 Mon Sep 17 00:00:00 2001 From: Sancho Lerena Date: Tue, 7 Oct 2014 15:54:26 +0200 Subject: [PATCH 2/4] Fixed missing parameter, was calling to a fixed path --- pandora_server/util/integrity_check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/util/integrity_check b/pandora_server/util/integrity_check index eb52c949f7..74d0d6ac1b 100755 --- a/pandora_server/util/integrity_check +++ b/pandora_server/util/integrity_check @@ -156,7 +156,7 @@ then cat /dev/null > $OUTPUT echo "#Pandora FMS Integrity Check generated at $HUMANDATE at `hostname` by $USER" >> $OUTPUT echo "Creating integrity check of Pandora FMS Console files" - for ax in `find /var/www/pandora_console/ -name "*.php" -o -name "*.js" -o -name "*.css" -o -name "*.sql"` + for ax in `find $CONSOLE_PATH -name "*.php" -o -name "*.js" -o -name "*.css" -o -name "*.sql"` do bx=`md5sum $ax` echo $bx >>$OUTPUT From f76ca4ef6e7cfe27fcd0823ed465d78ef10ee3ee Mon Sep 17 00:00:00 2001 From: Vanessa Gil Date: Tue, 7 Oct 2014 16:33:54 +0200 Subject: [PATCH 3/4] Fixed link to event list in service map. --- pandora_console/operation/events/events.php | 20 +++++++++++++++++-- .../operation/events/events_list.php | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index ebc6c07221..fbe612946d 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -200,8 +200,6 @@ $group_rep = (int) get_parameter ("group_rep", 1); $delete = (bool) get_parameter ("delete"); $validate = (bool) get_parameter ("validate", 0); $section = (string) get_parameter ("section", "list"); -$text_agent = (string) get_parameter('text_agent', __("All")); -$text_module = (string) get_parameter('module_search', ''); $filter_only_alert = (int) get_parameter('filter_only_alert', -1); $filter_id = (int) get_parameter('filter_id', 0); $id_name = (string) get_parameter('id_name', ''); @@ -210,6 +208,24 @@ $date_from = (string)get_parameter('date_from', ''); $date_to = (string)get_parameter('date_to', ''); $text_agent = (string) get_parameter("text_agent", __("All")); +$id_agent = get_parameter('id_agent', 0); +if ($id_agent != 0) { + $text_agent = db_get_value('nombre', 'tagente', 'id_agente', $id_agent); + if ($text_agent == false) { + $text_agent = ''; + } +} + + +$text_module = (string) get_parameter('module_search', ''); +$id_agent_module = get_parameter('id_agent_module', 0); +if ($id_agent_module != 0) { + $text_module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id_agent_module); + if ($text_module == false) { + $text_module = ''; + } +} + $tag_with_json = base64_decode(get_parameter("tag_with", '')) ; $tag_with_json_clean = io_safe_output($tag_with_json); diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index a6527cd648..127cafd831 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -386,7 +386,7 @@ $data[0] .= html_print_select($user_users, "id_user_ack", $id_user_ack, '', if (!$meta) { $data[1] = __('Module search') . '
'; $data[1] .= html_print_autocomplete_modules('module_search', - '', false, true, '', array(), true); + $text_module, false, true, '', array(), true); } else { $data[1] .= ''; From 77030e1b9854a1e5b52f925dd75cfe07daee7302 Mon Sep 17 00:00:00 2001 From: Vanessa Gil Date: Tue, 7 Oct 2014 19:03:14 +0200 Subject: [PATCH 4/4] Fixed bug when you filter events. --- pandora_console/include/functions_tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index daf94ab559..daa59c57bf 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -756,7 +756,7 @@ function tags_get_acl_tags($id_user, $id_group, $access = 'AR', $return_mode = ' break; case 'event_condition': // Return the condition of the tags for tevento table - $condition = tags_get_acl_tags_event_condition($acltags); + $condition = "(".tags_get_acl_tags_event_condition($acltags).")"; if(!empty($condition)) { return " $query_prefix ".$condition;