From 77c3df8eac2b36a62b1f2cf4f020d799670e1f26 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 7 Oct 2014 00:01:08 +0200 Subject: [PATCH 1/6] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 1ea64ff29f..41fc04fc3b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 5.1SP1-141006 +Version: 5.1SP1-141007 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 4e9cc573b2..d07cf0f740 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="5.1SP1-141006" +pandora_version="5.1SP1-141007" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 1307674422..92c3e02654 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '5.1SP1'; -use constant AGENT_BUILD => '141006'; +use constant AGENT_BUILD => '141007'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index ed48019596..cb1e2ed08c 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 5.1SP1 -%define release 141006 +%define release 141007 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 3f85c74f1b..78e5fda936 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 5.1SP1 -%define release 141006 +%define release 141007 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 070369275b..cc317f3356 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{141006} +{141007} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index cef86090e5..8df566e1c9 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("5.1SP1(Build 141006)") +#define PANDORA_VERSION ("5.1SP1(Build 141007)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d9e064b12b..f234182797 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(5.1SP1(Build 141006))" + VALUE "ProductVersion", "(5.1SP1(Build 141007))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b5b6c77bf0..519399e4f8 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 5.1SP1-141006 +Version: 5.1SP1-141007 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 2fd50d177a..2b7ee5d217 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="5.1SP1-141006" +pandora_version="5.1SP1-141007" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3f7db9721c..6bae453c10 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC141006'; +$build_version = 'PC141007'; $pandora_version = 'v5.1SP1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 7c6e3e7577..776b699315 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Tue, 7 Oct 2014 15:23:49 +0900 Subject: [PATCH 2/6] Updated that add_event API can support newline literally. --- pandora_console/include/functions_api.php | 2 +- pandora_console/include/functions_events.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index d62f94bc9a..80ddd70b6b 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -6584,7 +6584,7 @@ function api_set_add_event_comment($id, $thrash2, $other, $thrash3) { return; } else if ($other['type'] == 'array') { - $comment = $other['data'][0]; + $comment = io_safe_input($other['data'][0]); $meta = $other['data'][1]; $history = $other['data'][2]; diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index a2afc20e70..df781f4bd6 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2270,7 +2270,7 @@ function events_page_comments ($event) { $table_comments->class = "alternate rounded_cells"; $event_comments = io_safe_output($event["user_comment"]); - $event_comments = str_replace("\n", "
", $event_comments); + $event_comments = str_replace( array("\n", ' '), "
", $event_comments); // If comments are not stored in json, the format is old $event_comments_array = json_decode($event_comments, true); From 75be7a31805dc9e7edca7e28ceb0a03ceafae6ba Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 7 Oct 2014 11:59:02 +0200 Subject: [PATCH 3/6] Make sure the module still exists before compacting its data. --- pandora_server/util/pandora_db.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a053e663ca..4c4edadc3e 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -437,6 +437,7 @@ sub pandora_compactdb ($$) { my $id_module = $data->{'id_agente_modulo'}; if (! defined($module_proc_hash{$id_module})) { my $module_type = get_db_value ($dbh, 'SELECT id_tipo_modulo FROM tagente_modulo WHERE id_agente_modulo = ?', $id_module); + next unless defined ($module_type); # Mark proc modules. if ($module_type == 2 || $module_type == 6 || $module_type == 9 || $module_type == 18 || $module_type == 21 || $module_type == 31) { From 494176761b73efe15700c70d027db8655cf7b11e Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 7 Oct 2014 13:48:48 +0200 Subject: [PATCH 4/6] Fixed the update the tags. Ticket # 1417 --- pandora_console/include/functions_modules.php | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index eca97d4ada..3e108754de 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -349,8 +349,25 @@ function modules_delete_agent_module ($id_agent_module) { * @return True if the module was updated. False if not. */ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false, $tags = false) { + + $update_tags = false; + $return_tag = true; + if ($tags !== false) { + $update_tags = true; + $return_tag = tags_update_module_tag ($id, $tags); + } + + if ($return_tag === false) { + return ERR_DB; + } + if (!is_array ($values) || empty ($values)) { - return ERR_GENERIC; + if ($update_tags) { + return true; + } + else { + return ERR_GENERIC; + } } if (isset ($values['nombre'])) { @@ -368,14 +385,7 @@ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false } } - $return_tag = true; - if ($tags !== false) { - $return_tag = tags_update_module_tag ($id, $tags); - } - if ($return_tag === false) { - return ERR_DB; - } $where = array(); $where['id_agente_modulo'] = $id; From fa3578d35e5dc2326a0620503a050cb355af0fee Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 7 Oct 2014 14:03:04 +0200 Subject: [PATCH 5/6] Fixed the lost name of group. Ticket #1419 --- pandora_console/operation/users/user_edit.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index 7823c87cfd..ca2858d378 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -392,7 +392,10 @@ if ($result === false) { foreach ($result as $profile) { $data[0] = ''.profile_get_name ($profile["id_perfil"]).''; - $data[1] = ui_print_group_icon ($profile["id_grupo"], true).' '; + $data[1] = ui_print_group_icon ($profile["id_grupo"], true) . + '' . + ' ' . ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT) . + ''; $tags_ids = explode(',',$profile["tags"]); $tags = tags_get_tags($tags_ids); From 92edfd1cdc39f05a9fb87bb205b3251959d88f3a Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 7 Oct 2014 14:29:19 +0200 Subject: [PATCH 6/6] 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 ###############################################################################