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/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); 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; 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 @@
'.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); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 6c20dcb604..4156c73c59 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 5.1SP1 -%define release 141006 +%define release 141007 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 0eeca90b50..9be6936491 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 5.1SP1 -%define release 141006 +%define release 141007 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index be53344559..deaa121ce2 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -38,7 +38,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('graph_res','5'), ('step_compact','1'), ('db_scheme_version','5.1SP1'), -('db_scheme_build','PD141006'), +('db_scheme_build','PD141007'), ('show_unknown','0'), ('show_lastalerts','1'), ('style','pandora'), diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 241889e91c..c2e8598846 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 5.1SP1-141006 +Version: 5.1SP1-141007 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index ac90f1644b..b409f6ac28 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index c2fdd8ed51..be975583ee 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -43,7 +43,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "5.1SP1"; -my $pandora_build = "141006"; +my $pandora_build = "141007"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index b92fbbeb20..95d2cb8957 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 5.1SP1 -%define release 141006 +%define release 141007 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 8a0f7225dc..1e57ca8e54 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 5.1SP1 -%define release 141006 +%define release 141007 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 960f736e15..4fe43b7a70 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "5.1SP1 PS141006"; +my $version = "5.1SP1 PS141007"; # Pandora server configuration my %conf; @@ -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) { @@ -437,6 +440,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) { @@ -844,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 ############################################################################### diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 509de758b5..0af56e4a8a 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -34,7 +34,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "5.1SP1 PS141006"; +my $version = "5.1SP1 PS141007"; # save program name for logging my $progname = basename($0);