diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index 02fd3c957c..25eb202b70 100644 --- a/pandora_agents/pc/AIX/pandora_agent.conf +++ b/pandora_agents/pc/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, AIX version +# Version 7.0NG.720, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index 628da69b4b..a0590435c3 100644 --- a/pandora_agents/pc/FreeBSD/pandora_agent.conf +++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, FreeBSD Version +# Version 7.0NG.720, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf index e11e409af7..58a1bf4376 100644 --- a/pandora_agents/pc/HP-UX/pandora_agent.conf +++ b/pandora_agents/pc/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, HP-UX Version +# Version 7.0NG.720, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index 965f1f6f34..b267e3fd8e 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.720, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf index 3654c93f80..5bc27016ca 100644 --- a/pandora_agents/pc/NT4/pandora_agent.conf +++ b/pandora_agents/pc/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.720, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf index bdc4b70c3c..759466e5f8 100644 --- a/pandora_agents/pc/SunOS/pandora_agent.conf +++ b/pandora_agents/pc/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, Solaris Version +# Version 7.0NG.720, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index 2a179f1c6d..1b9bb5fddc 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2010 Artica Soluciones Tecnologicas -# Version 7.0NG.719 +# Version 7.0NG.720 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf index c95b70a58d..46bc125154 100644 --- a/pandora_agents/shellscript/aix/pandora_agent.conf +++ b/pandora_agents/shellscript/aix/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.719, AIX version +# Version 7.0NG.720, AIX version # General Parameters # ================== diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf index ce6d91f8ab..0c5683fbae 100644 --- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf +++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.719 +# Version 7.0NG.720 # FreeBSD/IPSO version # Licenced under GPL licence, 2003-2007 Sancho Lerena diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf index 483c8728bd..b6e8e92e26 100644 --- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf +++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.719, HPUX Version +# Version 7.0NG.720, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index b47b7b0ef2..5235b04bc9 100644 --- a/pandora_agents/shellscript/linux/pandora_agent.conf +++ b/pandora_agents/shellscript/linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719 +# Version 7.0NG.720 # Licensed under GPL license v2, # (c) 2003-2010 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf index 993be45b74..e00c641870 100644 --- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf +++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719 +# Version 7.0NG.720 # Licensed under GPL license v2, # (c) 2003-2009 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf index 0f703a7387..6eebe2c372 100644 --- a/pandora_agents/shellscript/openWRT/pandora_agent.conf +++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719 +# Version 7.0NG.720 # Licensed under GPL license v2, # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf index c0439c7b96..90bc535372 100644 --- a/pandora_agents/shellscript/solaris/pandora_agent.conf +++ b/pandora_agents/shellscript/solaris/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.719, Solaris version +# Version 7.0NG.720, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 0c7bbcef39..10dcdbac68 100644 --- a/pandora_agents/unix/AIX/pandora_agent.conf +++ b/pandora_agents/unix/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, AIX version +# Version 7.0NG.720, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index cb9d4332f2..abf3428e5c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.719-180302 +Version: 7.0NG.720 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 39a79290f5..9d3c418fc0 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="7.0NG.719-180302" +pandora_version="7.0NG.720" 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/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 07a8fa36ce..060176c1a5 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.720, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf index 40212d2098..015dfdccc0 100644 --- a/pandora_agents/unix/FreeBSD/pandora_agent.conf +++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, FreeBSD Version +# Version 7.0NG.720, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf index 04c521b395..b7e2056fe4 100644 --- a/pandora_agents/unix/HP-UX/pandora_agent.conf +++ b/pandora_agents/unix/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, HP-UX Version +# Version 7.0NG.720, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index fda0d82f2d..f05eb29522 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.720, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf index de203fa85c..eff17d7c68 100644 --- a/pandora_agents/unix/NT4/pandora_agent.conf +++ b/pandora_agents/unix/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.720, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf index bca26835ce..e7e13e733f 100644 --- a/pandora_agents/unix/NetBSD/pandora_agent.conf +++ b/pandora_agents/unix/NetBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, NetBSD Version +# Version 7.0NG.720, NetBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf index f7f6d4f192..39e9690fc4 100644 --- a/pandora_agents/unix/SunOS/pandora_agent.conf +++ b/pandora_agents/unix/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, Solaris Version +# Version 7.0NG.720, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 41fe2e3152..1e576533a3 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,8 +41,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.719'; -use constant AGENT_BUILD => '180302'; +use constant AGENT_VERSION => '7.0NG.720'; +use constant AGENT_BUILD => '180313'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 59a33164ce..0e269ddfb8 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.719 -%define release 180302 +%define version 7.0NG.720 +%define release 1 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 d2f6d674aa..74fcad352b 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.719 -%define release 180302 +%define version 7.0NG.720 +%define release 1 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 375238a319..df500b6a7b 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -9,8 +9,8 @@ # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.719" -PI_BUILD="180302" +PI_VERSION="7.0NG.720" +PI_BUILD="180313" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 77dc303572..0e7d28afcd 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2017 Artica Soluciones Tecnologicas -# Version 7.0NG.719 +# Version 7.0NG.720 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8838c98cfa..765224fcbf 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -3,7 +3,7 @@ AllowLanguageSelection {Yes} AppName -{Pandora FMS Windows Agent v7.0NG.719} +{Pandora FMS Windows Agent v7.0NG.720} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180302} +{180313} ViewReadme {Yes} @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-<%Version%>-Setup<%Ext%>} +{<%AppName%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ae0e9ec059..534623ee35 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 ("7.0NG.719(Build 180302)") +#define PANDORA_VERSION ("7.0NG.720(Build 180313)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index a422caf72d..1f05ad9775 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", "(7.0NG.719(Build 180302))" + VALUE "ProductVersion", "(7.0NG.720(Build 180313))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c3ebb69a11..a73acbcb21 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.719-180302 +Version: 7.0NG.720 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 61bbda6f81..af8c3a9c3a 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="7.0NG.719-180302" +pandora_version="7.0NG.720" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/13.sql b/pandora_console/extras/mr/13.sql index dec893c87c..92a88e037d 100644 --- a/pandora_console/extras/mr/13.sql +++ b/pandora_console/extras/mr/13.sql @@ -32,4 +32,30 @@ START TRANSACTION; FOREIGN KEY (`id_provisioning`) REFERENCES tprovisioning(`id`) ON DELETE CASCADE ) engine=InnoDB DEFAULT CHARSET=utf8; + + create table IF NOT EXISTS `tmigration_queue`( + `id` int unsigned not null auto_increment, + `id_source_agent` int unsigned not null, + `id_target_agent` int unsigned not null, + `id_source_node` int unsigned not null, + `id_target_node` int unsigned not null, + `priority` int unsigned default 0, + `step` int default 0, + `running` tinyint(2) default 0, + `active_db_only` tinyint(2) default 0, + PRIMARY KEY(`id`) + ) engine=InnoDB DEFAULT CHARSET=utf8; + + create table IF NOT EXISTS `tmigration_module_queue`( + `id` int unsigned not null auto_increment, + `id_migration` int unsigned not null, + `id_source_agentmodule` int unsigned not null, + `id_target_agentmodule` int unsigned not null, + `last_replication_timestamp` bigint(20) NOT NULL default 0, + PRIMARY KEY(`id`), + FOREIGN KEY(`id_migration`) REFERENCES tmigration_queue(`id`) + ON DELETE CASCADE + ON UPDATE CASCADE + ) engine=InnoDB DEFAULT CHARSET=utf8; + COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 25c4a0ef10..7944a5d4e3 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1560,3 +1560,36 @@ create table IF NOT EXISTS `tprovisioning_rules`( FOREIGN KEY (`id_provisioning`) REFERENCES tprovisioning(`id`) ON DELETE CASCADE ) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tmigration_queue` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tmigration_queue`( + `id` int unsigned not null auto_increment, + `id_source_agent` int unsigned not null, + `id_target_agent` int unsigned not null, + `id_source_node` int unsigned not null, + `id_target_node` int unsigned not null, + `priority` int unsigned default 0, + `step` int default 0, + `running` tinyint(2) default 0, + `active_db_only` tinyint(2) default 0, + PRIMARY KEY(`id`) +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tmigration_module_queue` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tmigration_module_queue`( + `id` int unsigned not null auto_increment, + `id_migration` int unsigned not null, + `id_source_agentmodule` int unsigned not null, + `id_target_agentmodule` int unsigned not null, + `last_replication_timestamp` bigint(20) NOT NULL default 0, + PRIMARY KEY(`id`), + FOREIGN KEY(`id_migration`) REFERENCES tmigration_queue(`id`) + ON DELETE CASCADE + ON UPDATE CASCADE +) engine=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index 71bed3d10d..d9646c5a98 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -1186,6 +1186,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri $(document).ready (function () { $("#id_agents").change(agent_changed_by_multiple_agents); + $("#modules_selection_mode").change(agent_changed_by_multiple_agents); change_type_downtime(); change_type_execution(); diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 02cbb7283c..c844ccc4d3 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -290,18 +290,22 @@ if (!defined('METACONSOLE')) { else { $url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&recursion='.$recursion.'&ag_group='.$ag_group.'&search='.$search.'&pagination='.$pagination; } + + + + if ($own_info['is_admin'] || $vconsoles_read) { if($ag_group){ - $maps = visual_map_get_user_layouts (0,false,$filters,false); + $maps = visual_map_get_user_layouts ($config['id_user'],false,$filters,false); unset($filters['offset']); unset($filters['limit']); - $count_maps = visual_map_get_user_layouts (0,false,$filters,false); + $count_maps = visual_map_get_user_layouts ($config['id_user'],false,$filters,false); $total_maps = count($count_maps); }else{ - $maps = visual_map_get_user_layouts (0,false,$filters, false); + $maps = visual_map_get_user_layouts ($config['id_user'],false,$filters, false); unset($filters['offset']); unset($filters['limit']); - $count_maps = visual_map_get_user_layouts (0,false,$filters,false); + $count_maps = visual_map_get_user_layouts ($config['id_user'],false,$filters,false); $total_maps = count($count_maps); } } @@ -309,7 +313,7 @@ else { $maps = visual_map_get_user_layouts ($config['id_user'], false, $filters, false); unset($filters['offset']); unset($filters['limit']); - $count_maps = visual_map_get_user_layouts (0,false,$filters,false); + $count_maps = visual_map_get_user_layouts ($config['id_user'],false,$filters,false); $total_maps = count($count_maps); } if (!$maps && !is_metaconsole()) { diff --git a/pandora_console/images/console/background/spain_map_blue.png b/pandora_console/images/console/background/spain_map_blue.png new file mode 100644 index 0000000000..487da21638 Binary files /dev/null and b/pandora_console/images/console/background/spain_map_blue.png differ diff --git a/pandora_console/images/console/background/world_map_blue.jpg b/pandora_console/images/console/background/world_map_blue.jpg new file mode 100644 index 0000000000..be95de8340 Binary files /dev/null and b/pandora_console/images/console/background/world_map_blue.jpg differ diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index 375bd072dd..e79e05bbb7 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -51,6 +51,9 @@ $correctLogin = false; $user_in_db = null; $no_login_msg = ""; +// Clean unwanted output +ob_clean(); + // Special call without checks to retrieve version and build of the Pandora FMS // This info is avalable from the web console without login // Don't change the format, it is parsed by applications diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 805e46376a..7fb34b4a22 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -1599,6 +1599,15 @@ class Tree { 'url' => $moduleGraphURL, 'handle' => $winHandle ); + + // Info to be able to open the snapshot image new page + $module['snapshot'] = ui_get_snapshot_link(array( + 'id_module' => $module['id'], + 'last_data' => $module['datos'], + 'timestamp' => $module['timestamp'], + 'interval' => $module['current_interval'], + 'module_name' => $module['name'] + ), true); } // Alerts fired image diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 7e2218ad45..94a3be6734 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,8 +22,8 @@ /** * Pandora build version and version */ -$build_version = 'PC180302'; -$pandora_version = 'v7.0NG.719'; +$build_version = 'PC180313'; +$pandora_version = 'v7.0NG.720'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index e6d247b421..c3fbfef69b 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -34,6 +34,7 @@ enterprise_include_once ('include/functions_local_components.php'); enterprise_include_once ('include/functions_events.php'); enterprise_include_once ('include/functions_agents.php'); enterprise_include_once ('include/functions_modules.php'); +enterprise_include_once ('include/functions_collection.php'); /** * Parse the "other" parameter. diff --git a/pandora_console/include/functions_pandora_networkmap.php b/pandora_console/include/functions_pandora_networkmap.php index bf05d37bbb..7f01a01090 100644 --- a/pandora_console/include/functions_pandora_networkmap.php +++ b/pandora_console/include/functions_pandora_networkmap.php @@ -731,6 +731,15 @@ function networkmap_links_to_js_links($relations, $nodes_graph) { $agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']); $agent2 = agents_get_agent_id_by_module_id($relation['id_child_source_data']); + foreach ($nodes_graph as $key2 => $node) { + if(isset($node['id_agent'])) { + if($node['id_agent'] == $agent) { + $agent = $node['id_db']; + } else if ($node['id_agent'] == $agent2) { + $agent2 = $node['id_db']; + } + } + } } else if ($relation['child_type'] == 1) { $mod1_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_child_source_data'])); @@ -742,8 +751,16 @@ function networkmap_links_to_js_links($relations, $nodes_graph) { $item['link_color'] = "#FAD403"; } - $agent = $relation['id_parent_source_data']; $agent2 = agents_get_agent_id_by_module_id($relation['id_child_source_data']); + foreach ($nodes_graph as $key2 => $node) { + if(isset($node['id_agent'])) { + if($node['id_agent'] == $relation['id_parent_source_data']) { + $agent = $node['id_db']; + } else if ($node['id_agent'] == $agent2) { + $agent2 = $node['id_db']; + } + } + } } else if ($relation['parent_type'] == 1) { $mod1_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_parent_source_data'])); @@ -756,59 +773,67 @@ function networkmap_links_to_js_links($relations, $nodes_graph) { } $agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']); - $agent2 = $relation['id_child_source_data']; + + foreach ($nodes_graph as $key2 => $node) { + if(isset($node['id_agent'])) { + if($node['id_agent'] == $agent) { + $agent = $node['id_db']; + } else if ($node['id_agent'] == $relation['id_child_source_data']) { + $agent2 = $node['id_db']; + } + } + } } else if (($relation['parent_type'] == 3) && ($relation['child_type'] == 3)) { - foreach ($nodes_graph as $key => $node) { + foreach ($nodes_graph as $key2 => $node) { if ($relation['id_parent'] == $node['id_db']) { - $agent = $key; + $agent = $node['id_db']; } } - foreach ($nodes_graph as $key => $node) { + foreach ($nodes_graph as $key2 => $node) { if ($relation['id_child'] == $node['id_db']) { - $agent2 = $key; + $agent2 = $node['id_db']; } } } else if (($relation['parent_type'] == 3) || ($relation['child_type'] == 3)) { if ($relation['parent_type'] == 3) { - foreach ($nodes_graph as $key => $node) { + foreach ($nodes_graph as $key2 => $node) { if ($relation['id_parent'] == $node['id_db']) { - $agent = $key; + $agent = $node['id_db']; + } else if ($node['id_agent'] == $relation['id_child_source_data']) { + $agent2 = $node['id_db']; } } - $agent2 = $relation['id_child_source_data']; } else if ($relation['child_type'] == 3) { - foreach ($nodes_graph as $key => $node) { + foreach ($nodes_graph as $key2 => $node) { if ($relation['id_child'] == $node['id_db']) { - $agent2 = $key; + $agent2 = $node['id_db']; + } else if ($node['id_agent'] == $relation['id_parent_source_data']) { + $agent = $node['id_db']; } } - $agent = $relation['id_parent_source_data']; } } else { - $agent = $relation['id_parent_source_data']; - $agent2 = $relation['id_child_source_data']; + foreach ($nodes_graph as $key2 => $node) { + if(isset($node['id_agent'])) { + if($node['id_agent'] == $relation['id_parent_source_data']) { + $agent = $node['id_db']; + } else if ($node['id_agent'] == $relation['id_child_source_data']) { + $agent2 = $node['id_db']; + } + } + } } foreach ($nodes_graph as $node) { - if (!isset($node['id_agent'])) { - if ($node['id'] == $agent) { - $item['target'] = $node['id']; - } - else if($node['id'] == $agent2) { - $item['source'] = $node['id']; - } + if ($node['id_db'] == $agent) { + $item['target'] = $node['id']; } - else { - if ($node['id_agent'] == $agent) { - $item['target'] = $node['id']; - } - else if ($node['id_agent'] == $agent2) { - $item['source'] = $node['id']; - } + else if($node['id_db'] == $agent2) { + $item['source'] = $node['id']; } } $return[] = $item; diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 1ef1d2fc39..9da64a6dbe 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -268,21 +268,14 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head = $last_data_str .= html_print_image('images/clock2.png', true, array('title' => $last_data["timestamp"], 'width' => '18px')); $is_snapshot = is_snapshot_data ( $last_data["datos"] ); - if (($config['command_snapshot']) && ($is_snapshot)) { - $handle = 'snapshot_' . $module['id_agente_modulo']; - $url = 'include/procesos.php?agente=' . $row['id_agente_modulo']; - $win_handle = dechex(crc32($handle)); - if (! defined ('METACONSOLE')) { - $link = "winopeng_var('operation/agentes/snapshot_view.php?" . - "id=" . $module['id_agente_modulo'] . - "&refr=" . $module['current_interval'] . - "&label=" . rawurlencode(urlencode(io_safe_output($module['module_name']))) . "','" . $win_handle . "', 700,480)"; - } - else{ - $link = "winopeng_var('$last_data[datos]','',700,480)"; - - } + $link = ui_get_snapshot_link( array( + 'id_module' => $module['id_agente_modulo'], + 'last_data' => $last_data['datos'], + 'timestamp' => $last_data['timestamp'], + 'interval' => $module['current_interval'], + 'module_name' => $module['module_name'] + )); if(!is_image_data($last_data["datos"])){ $salida = '' . diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ec0f1466b8..751b1bf34e 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3919,4 +3919,48 @@ function ui_print_tags_view($title = '', $tags = array()) { $tv .= ''; echo $tv; } + +/** + * @brief Get the link to open a snapshot into a new page + * + * @param Array Params to build the link (see $default_params) + * @param bool Flag to choose de return value: + * true: Get the four params required in the function of pandora.js winopen_var (js use) + * false: Get an inline winopen_var function call (php user) + */ +function ui_get_snapshot_link($params, $only_params = false) { + global $config; + + $default_params = array( + 'id_module' => 0, //id_agente_modulo + 'module_name' => '', + 'interval' => 300, + 'last_data' => '', + 'timestamp' => '0' + ); + + // Merge default params with passed params + $params = array_merge ($default_params, $params); + + // First parameter of js winopeng_var + $page = $config['homeurl_static'] . "/operation/agentes/snapshot_view.php"; + + $url = "$page?" . + "id=" . $params['id_module'] . + "&refr=" . $parms['interval'] . + "×tamp=" . $params['timestamp'] . + "&last_data=" . rawurlencode(urlencode(io_safe_output($params['last_data']))) . + "&label=" . rawurlencode(urlencode(io_safe_output($params['module_name']))); + + // Second parameter of js winopeng_var + $win_handle = dechex(crc32('snapshot_' . $params['id_module'])); + + $link_parts = array ($url, $win_handle, 700, 480); + + // Return only the params to js execution + if ($only_params) return $link_parts; + + // Return the function call to inline js execution + return "winopeng_var('" . implode("', '", $link_parts) . "')"; +} ?> diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index fbb0327986..0a975276f9 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -3602,6 +3602,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, */ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter = false, $returnAllGroup = true, $favourite = false) { + if (! is_array ($filter)){ $filter = array (); } else { @@ -3626,10 +3627,7 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter if ($returnAllGroup) { $groups = users_get_groups ($id_user, 'VR', true, true); } else { - if(users_is_admin($id_user)){ - $groups = users_get_groups ($id_user, 'VR', true, true); - } - else{ + if(!empty($filter['group'])) { $permissions_group = users_get_groups ($id_user, 'VR', false, true); if(empty($permissions_group)){ @@ -3637,12 +3635,12 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter } $groups = array_intersect_key($filter['group'], $permissions_group); } else { - $groups = users_get_groups ($id_user, 'VR', false, true); + $groups = users_get_groups ($id_user, 'VR', true, true); if(empty($groups)) { - $groups = users_get_groups ($id_user, 'VM', false, true); + $groups = users_get_groups ($id_user, 'VM', true, true); } } - } + unset($filter['group']); } diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 6175ef554b..9719f77642 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1928,7 +1928,12 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, var formatted = number_format(v, force_integer, "", short_data); } else { - var formatted = v; + // It is an integer + if(v - Math.floor(v) == 0){ + var formatted = number_format(v, force_integer, "", 2); + } else { + var formatted = v; + } } return '
'+formatted+'
'; diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 0a122889ee..14996e8e4b 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -402,16 +402,21 @@ var TreeController = { else{ var $graphImage = $(' '); + +'images/chart_curve.png" /> '); } - + $graphImage .addClass('module-graph') .click(function (e) { e.preventDefault(); if(element.statusImageHTML.indexOf('data:image')!=-1){ try { - winopeng_var(element.datos,'',700,480); + winopeng_var( + decodeURI(element.snapshot[0]), + element.snapshot[1], + element.snapshot[2], + element.snapshot[3] + ); } catch (error) { // console.log(error); diff --git a/pandora_console/install.php b/pandora_console/install.php index e171b6fa97..58d0a01a3c 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -70,8 +70,8 @@
@@ -61,15 +71,14 @@ $label = get_parameter ("label"); $row = db_get_row_sql("SELECT * FROM tagente_estado WHERE id_agente_modulo = $id"); - + echo "

"; echo __("Current data at"); echo " "; - echo $row["timestamp"]; + echo $last_timestamp; echo "

"; - $datos = io_safe_output($row["datos"]); - if (is_image_data($datos)) { - echo '
image
'; + if (is_image_data($last_data)) { + echo '
image
'; } else { $datos = preg_replace ('/',$datos); $datos = preg_replace ('/\s/i',' ',$datos); echo "
"; - echo $datos; + echo $last_data; echo "
"; ?>