diff --git a/extras/pandora_update_version.sh b/extras/pandora_update_version.sh index 90c4bf6519..10e5534459 100755 --- a/extras/pandora_update_version.sh +++ b/extras/pandora_update_version.sh @@ -54,7 +54,8 @@ AGENT_WIN_FILE="$CODEHOME/pandora_agents/win32/pandora.cc" AGENT_WIN_MPI_FILE="$CODEHOME/pandora_agents/win32/installer/pandora.mpi" AGENT_WIN_RC_FILE="$CODEHOME/pandora_agents/win32/versioninfo.rc" SATELLITE_FILE="$PANDHOME_ENT/satellite_server/satellite_server.pl" -PERL_PLUGIN_FILES="$PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl \ +PERL_PLUGIN_FILES="$PANDHOME_ENT/pandora_server/util/recon_script/vmware-plugin.pl \ +$PANDHOME_ENT/pandora_server/util/recon_script/pcm_client.pl \ $PANDHOME_ENT/pandora_plugins/NGINX/nginx_requests_queued.pl \ $PANDHOME_ENT/pandora_plugins/Sybase/sybase_plugin.pl \ $PANDHOME_ENT/pandora_plugins/SNMP/dynamic_snmp.pl \ diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index bff05d8732..07054ee2e1 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.731, AIX version +# Version 7.0NG.732, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/DEBIAN/control b/pandora_agents/pc/DEBIAN/control index af1e09fc24..cdbcc99cfe 100644 --- a/pandora_agents/pc/DEBIAN/control +++ b/pandora_agents/pc/DEBIAN/control @@ -1,10 +1,10 @@ package: pandorafms-agent-unix -Version: 4.0.1 +Version: 7.0 Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: Miguel de Dios -Homepage: http://pandorafms.org/ +Maintainer: ÁRTICA ST +Homepage: https://pandorafms.org/ Depends: coreutils, perl, unzip Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index 938691a2af..9d8a49bb99 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.731, FreeBSD Version +# Version 7.0NG.732, 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 d6f6d248c9..c02e4647e1 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.731, HP-UX Version +# Version 7.0NG.732, 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 0de221f790..153113e070 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.731, GNU/Linux +# Version 7.0NG.732, 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 cb90a522a3..6ddeba7edc 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.731, GNU/Linux +# Version 7.0NG.732, 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 1758206b7b..502317f893 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.731, Solaris Version +# Version 7.0NG.732, 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 bc4a50047f..96b20ea7e3 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.731 +# Version 7.0NG.732 # 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 6ca5613d16..200ff9db97 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.731, AIX version +# Version 7.0NG.732, 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 b55b3033f6..2002f4db65 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.731 +# Version 7.0NG.732 # 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 4a5a240381..f9c19dbd06 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.731, HPUX Version +# Version 7.0NG.732, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/DEBIAN/control b/pandora_agents/shellscript/linux/DEBIAN/control index d17817f5b8..55a5168f93 100755 --- a/pandora_agents/shellscript/linux/DEBIAN/control +++ b/pandora_agents/shellscript/linux/DEBIAN/control @@ -1,10 +1,10 @@ package: pandorafms-agent -Version: 4.0 +Version: 7.0 Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: Miguel de Dios +Maintainer: ÁRTICA ST Homepage: http://pandorafms.org/ Depends: coreutils, perl Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index 8e2600567a..dc272a7a71 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.731 +# Version 7.0NG.732 # 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 8dfed3e54d..5a466677d2 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.731 +# Version 7.0NG.732 # 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 ca04eca187..170188cc6f 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.731 +# Version 7.0NG.732 # 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 563805acdb..aad04ca60d 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.731, Solaris version +# Version 7.0NG.732, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 9d787783ff..3ce7da3c7e 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.731, AIX version +# Version 7.0NG.732, 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 6af9c8cebe..4b20131ada 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,10 +1,10 @@ package: pandorafms-agent-unix -Version: 7.0NG.731-190225 +Version: 7.0NG.732-190312 Architecture: all Priority: optional Section: admin Installed-Size: 260 -Maintainer: Miguel de Dios +Maintainer: ÁRTICA ST Homepage: http://pandorafms.org/ Depends: coreutils, perl, unzip Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. It’s possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file. diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 885349a84a..4c38106b0f 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.731-190225" +pandora_version="7.0NG.732-190312" 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 2164faaedc..35202fcbe5 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.731, GNU/Linux +# Version 7.0NG.732, 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 0c5a190f9b..c505d5f75e 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.731, FreeBSD Version +# Version 7.0NG.732, 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 f039431f7a..237bffb291 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.731, HP-UX Version +# Version 7.0NG.732, 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 df03402446..5a65e0e095 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.731, GNU/Linux +# Version 7.0NG.732, 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 12421565e8..1394067390 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.731, GNU/Linux +# Version 7.0NG.732, 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 6dd394db7a..677615a47c 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.731, NetBSD Version +# Version 7.0NG.732, 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 3d7294a56a..89d5b46100 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.731, Solaris Version +# Version 7.0NG.732, 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 1b0beb6592..7bf1e25c3a 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.731'; -use constant AGENT_BUILD => '190225'; +use constant AGENT_VERSION => '7.0NG.732'; +use constant AGENT_BUILD => '190312'; # 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 479ec78469..5bb4145674 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.731 -%define release 190225 +%define version 7.0NG.732 +%define release 190312 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 958ec6edb9..f98ff3cd9d 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.731 -%define release 190225 +%define version 7.0NG.732 +%define release 190312 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 324749839f..fb27a8e252 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.731" -PI_BUILD="190225" +PI_VERSION="7.0NG.732" +PI_BUILD="190312" 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 aab9a2f315..3d1e208de8 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.731 +# Version 7.0NG.732 # 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 a9f356dcf9..20957929d2 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.731} +{Pandora FMS Windows Agent v7.0NG.732} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190225} +{190312} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1cdb4731e9..5ea340e78e 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.731(Build 190225)") +#define PANDORA_VERSION ("7.0NG.732(Build 190312)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 4ed34ac285..9f62b65035 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.731(Build 190225))" + VALUE "ProductVersion", "(7.0NG.732(Build 190312))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 84bd5108d8..0f08432214 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.731-190225 +Version: 7.0NG.732-190312 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 ed29060a70..a15849cec1 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.731-190225" +pandora_version="7.0NG.732-190312" package_pear=0 package_pandora=1 @@ -149,7 +149,7 @@ if [ $package_pear -eq 1 ] then echo "Make the package \"php-xml-rpc\"." cd temp_package - dh-make-pear --maintainer "Miguel de Dios " XML_RPC + dh-make-pear --maintainer "ÁRTICA ST " XML_RPC cd php-xml-rpc-* dpkg-buildpackage -rfakeroot cd .. diff --git a/pandora_console/extras/mr/25.sql b/pandora_console/extras/mr/25.sql new file mode 100644 index 0000000000..0809bc486e --- /dev/null +++ b/pandora_console/extras/mr/25.sql @@ -0,0 +1,147 @@ +START TRANSACTION; + +UPDATE `twidget` SET `unique_name`='example' WHERE `class_name` LIKE 'WelcomeWidget'; + +INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); + +ALTER TABLE `trecon_task` ADD COLUMN `wmi_enabled` tinyint(1) unsigned DEFAULT '0'; +ALTER TABLE `trecon_task` ADD COLUMN `auth_strings` text; +ALTER TABLE `trecon_task` ADD COLUMN `autoconfiguration_enabled` tinyint(1) unsigned default '0'; + + +INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Application.VMware', 'Discovery Application script to monitor VMware technologies (ESXi, VCenter, VSphere)', '/usr/share/pandora_server/util/recon_scripts/vmware-plugin.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}'); +INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Cloud', 'Discovery Cloud script to monitor Cloud technologies (AWS.EC2, AWS.S3, AWS.RDS, RDS,ȊWS.EKS)', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}'); + +CREATE TABLE IF NOT EXISTS `tevent_extended` ( + `id` serial PRIMARY KEY, + `id_evento` bigint(20) unsigned NOT NULL, + `external_id` bigint(20) unsigned, + `utimestamp` bigint(20) NOT NULL default '0', + `description` text, + FOREIGN KEY `tevent_ext_fk`(`id_evento`) REFERENCES `tevento`(`id_evento`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `tnotification_source` ( + `id` serial, + `description` VARCHAR(255) DEFAULT NULL, + `icon` text, + `max_postpone_time` int(11) DEFAULT NULL, + `enabled` int(1) DEFAULT NULL, + `user_editable` int(1) DEFAULT NULL, + `also_mail` int(1) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `tnotification_source` +-- +INSERT INTO `tnotification_source`(`description`, `icon`, `max_postpone_time`, `enabled`, `user_editable`, `also_mail`) VALUES + ("System status", "icono_info_mr.png", 86400, 1, 1, 0), + ("Message", "icono_info_mr.png", 86400, 1, 1, 0), + ("Pending task", "icono_info_mr.png", 86400, 1, 1, 0), + ("Advertisement", "icono_info_mr.png", 86400, 1, 1, 0), + ("Official communication", "icono_info_mr.png", 86400, 1, 1, 0), + ("Sugerence", "icono_info_mr.png", 86400, 1, 1, 0); + +-- ----------------------------------------------------- +-- Table `tmensajes` +-- ----------------------------------------------------- +ALTER TABLE `tmensajes` ADD COLUMN `url` TEXT; +ALTER TABLE `tmensajes` ADD COLUMN `response_mode` VARCHAR(200) DEFAULT NULL; +ALTER TABLE `tmensajes` ADD COLUMN `citicity` INT(10) UNSIGNED DEFAULT '0'; +ALTER TABLE `tmensajes` ADD COLUMN `id_source` BIGINT(20) UNSIGNED NOT NULL; +ALTER TABLE `tmensajes` ADD COLUMN `subtype` VARCHAR(255) DEFAULT ''; +ALTER TABLE `tmensajes` ADD INDEX (`id_source`); +UPDATE `tmensajes` SET `id_source`=(SELECT `id` FROM `tnotification_source` WHERE `description` = "Message"); +ALTER TABLE `tmensajes` ADD CONSTRAINT `tsource_fk` FOREIGN KEY (`id_source`) REFERENCES `tnotification_source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; + + +CREATE TABLE IF NOT EXISTS `tnotification_user` ( + `id_mensaje` INT(10) UNSIGNED NOT NULL, + `id_user` VARCHAR(60) NOT NULL, + `utimestamp_read` BIGINT(20), + `utimestamp_erased` BIGINT(20), + `postpone` INT, + PRIMARY KEY (`id_mensaje`,`id_user`), + FOREIGN KEY (`id_mensaje`) REFERENCES `tmensajes`(`id_mensaje`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `tnotification_group` ( + `id_mensaje` INT(10) UNSIGNED NOT NULL, + `id_group` mediumint(4) UNSIGNED NOT NULL, + PRIMARY KEY (`id_mensaje`,`id_group`), + FOREIGN KEY (`id_mensaje`) REFERENCES `tmensajes`(`id_mensaje`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `tnotification_source_user` ( + `id_source` BIGINT(20) UNSIGNED NOT NULL, + `id_user` VARCHAR(60), + `enabled` INT(1) DEFAULT NULL, + `also_mail` INT(1) DEFAULT NULL, + PRIMARY KEY (`id_source`,`id_user`), + FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `tnotification_source_group` ( + `id_source` BIGINT(20) UNSIGNED NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + PRIMARY KEY (`id_source`,`id_group`), + INDEX (`id_group`), + FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `tnotification_source_group_user`( + `id_source` BIGINT(20) UNSIGNED NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + `id_user` VARCHAR(60), + `enabled` INT(1) DEFAULT NULL, + `also_mail` INT(1) DEFAULT NULL, + PRIMARY KEY (`id_source`,`id_user`), + FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_group`) REFERENCES `tnotification_source_group`(`id_group`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES ('Generate Notification','Internal type','This command allows you to send an internal notification to any user or group.',1,'[\"Destination user\",\"Destination group\",\"Title\",\"Message\",\"Link\",\"Criticity\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); + +INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="System status"), "admin", 1, 0); +INSERT INTO `tnotification_source_group` SELECT `id`,0 FROM `tnotification_source` WHERE `description`="Message"; +INSERT INTO `tnotification_user` (`id_mensaje`, `id_user`) SELECT `id_mensaje`, `id_usuario_destino` FROM `tmensajes` WHERE `id_usuario_destino` != ''; + +INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Apache accesses per client and status', +'(.*?)\ -.*1.1"\ (\d+)\ \d+', +'host,status', 1); + +INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Apache time per requester and html code', +'(.*?)\ -.*1.1"\ (\d+)\ (\d+)', +'origin,respose,_time_', 1); + +INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Count output', +'.*', +'Coincidences', 0); + +INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Events replicated to metaconsole', +'.* (.*?) .* (\d+) events replicated to metaconsole', +'server,_events_', 0); + +INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Pages with warnings', +'PHP Warning:.*in (.*?) on', +'page', 0); + +INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Users login', +'Starting Session \d+\ of user (.*)', +'user', 0); + +COMMIT; diff --git a/pandora_console/extras/mr/26.sql b/pandora_console/extras/mr/26.sql new file mode 100644 index 0000000000..f9c904a0a3 --- /dev/null +++ b/pandora_console/extras/mr/26.sql @@ -0,0 +1,8 @@ +START TRANSACTION; + +-- ---------------------------------------------------------------------- +-- Add column in table `tagent_custom_fields` +-- ---------------------------------------------------------------------- +ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT ''; + +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 bedb9927cd..e7cedb62f5 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 @@ -1199,13 +1199,14 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 24); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 26); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '731'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '733'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); -- --------------------------------------------------------------------- -- Table `tconfig_os` @@ -1406,12 +1407,16 @@ ALTER TABLE twidget_dashboard MODIFY options LONGTEXT NOT NULL default ""; ALTER TABLE trecon_task ADD `alias_as_name` int(2) unsigned default '0'; ALTER TABLE trecon_task ADD `snmp_enabled` int(2) unsigned default '0'; ALTER TABLE trecon_task ADD `vlan_enabled` int(2) unsigned default '0'; +ALTER TABLE trecon_task ADD `wmi_enabled` tinyint(1) unsigned DEFAULT '0'; +ALTER TABLE trecon_task ADD `auth_strings` text; +ALTER TABLE trecon_task ADD `autoconfiguration_enabled` tinyint(1) unsigned default '0'; -- --------------------------------------------------------------------- -- Table `twidget` AND Table `twidget_dashboard` -- --------------------------------------------------------------------- UPDATE twidget_dashboard SET id_widget = (SELECT id FROM twidget WHERE unique_name = 'graph_module_histogram') WHERE id_widget = (SELECT id FROM twidget WHERE unique_name = 'graph_availability'); DELETE FROM twidget WHERE unique_name = 'graph_availability'; +UPDATE `twidget` SET `unique_name`='example' WHERE `class_name` LIKE 'WelcomeWidget'; -- --------------------------------------------------------------------- -- Table `tbackup` (Extension table. Modify only if exists) @@ -1816,7 +1821,30 @@ CREATE TABLE IF NOT EXISTS `tlog_graph_models` ( INSERT INTO tlog_graph_models VALUES (1, 'Apache log model', '^.*?\s+.*".*?\s(\/.*?)\?.*1.1"\s+(.*?)\s+(.*?)\s+', 'pagina, html_err_code, _tiempo_', 1); - + +INSERT INTO tlog_graph_models VALUES (2, 'Apache accesses per client and status', +'(.*?)\ -.*1.1"\ (\d+)\ \d+', +'host,status', 1); + +INSERT INTO tlog_graph_models VALUES (3, 'Apache time per requester and html code', +'(.*?)\ -.*1.1"\ (\d+)\ (\d+)', +'origin,respose,_time_', 1); + +INSERT INTO tlog_graph_models VALUES (4, 'Count output', +'.*', +'Coincidences', 0); + +INSERT INTO tlog_graph_models VALUES (5, 'Events replicated to metaconsole', +'.* (.*?) .* (\d+) events replicated to metaconsole', +'server,_events_', 0); + +INSERT INTO tlog_graph_models VALUES (6, 'Pages with warnings', +'PHP Warning:.*in (.*?) on', +'page', 0); + +INSERT INTO tlog_graph_models VALUES (7, 'Users login', +'Starting Session \d+\ of user (.*)', +'user', 0); -- ----------------------------------------------------- -- Add column in table `treport` -- ----------------------------------------------------- @@ -1856,15 +1884,159 @@ ALTER TABLE `tevento` ADD COLUMN `data` double(22,5) default NULL; ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0'; +-- --------------------------------------------------------------------- +-- Table `tevent_extended` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tevent_extended` ( + `id` serial PRIMARY KEY, + `id_evento` bigint(20) unsigned NOT NULL, + `external_id` bigint(20) unsigned, + `utimestamp` bigint(20) NOT NULL default '0', + `description` text, + FOREIGN KEY `tevent_ext_fk`(`id_evento`) REFERENCES `tevento`(`id_evento`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- ----------------------------------------------------- -- Table `tgis_map_layer_groups` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `tgis_map_layer_groups` ( - `layer_id` INT NOT NULL, - `group_id` MEDIUMINT(4) UNSIGNED NOT NULL, - `agent_id` INT(10) UNSIGNED NOT NULL COMMENT 'Used to link the position to the group', - PRIMARY KEY (`layer_id`, `group_id`), - FOREIGN KEY (`layer_id`) REFERENCES `tgis_map_layer` (`id_tmap_layer`) ON DELETE CASCADE, - FOREIGN KEY (`group_id`) REFERENCES `tgrupo` (`id_grupo`) ON DELETE CASCADE, - FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE +CREATE TABLE `tgis_map_layer_groups` ( + `layer_id` int(11) NOT NULL, + `group_id` mediumint(4) unsigned NOT NULL, + `agent_id` int(10) unsigned NOT NULL COMMENT 'Used to link the position to the group', + PRIMARY KEY (`layer_id`,`group_id`), + KEY `group_id` (`group_id`), + KEY `agent_id` (`agent_id`), + CONSTRAINT `tgis_map_layer_groups_ibfk_1` FOREIGN KEY (`layer_id`) REFERENCES `tgis_map_layer` (`id_tmap_layer`) ON DELETE CASCADE, + CONSTRAINT `tgis_map_layer_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `tgrupo` (`id_grupo`) ON DELETE CASCADE, + CONSTRAINT `tgis_map_layer_groups_ibfk_3` FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ----------------------------------------------------- +-- Table `tnotification_source` +-- ----------------------------------------------------- +CREATE TABLE `tnotification_source` ( + `id` serial, + `description` VARCHAR(255) DEFAULT NULL, + `icon` text, + `max_postpone_time` int(11) DEFAULT NULL, + `enabled` int(1) DEFAULT NULL, + `user_editable` int(1) DEFAULT NULL, + `also_mail` int(1) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `tnotification_source` +-- +INSERT INTO `tnotification_source`(`description`, `icon`, `max_postpone_time`, `enabled`, `user_editable`, `also_mail`) VALUES + ("System status", "icono_info_mr.png", 86400, 1, 1, 0), + ("Message", "icono_info_mr.png", 86400, 1, 1, 0), + ("Pending task", "icono_info_mr.png", 86400, 1, 1, 0), + ("Advertisement", "icono_info_mr.png", 86400, 1, 1, 0), + ("Official communication", "icono_info_mr.png", 86400, 1, 1, 0), + ("Sugerence", "icono_info_mr.png", 86400, 1, 1, 0); + +-- ----------------------------------------------------- +-- Table `tmensajes` +-- ----------------------------------------------------- +ALTER TABLE `tmensajes` ADD COLUMN `url` TEXT; +ALTER TABLE `tmensajes` ADD COLUMN `response_mode` VARCHAR(200) DEFAULT NULL; +ALTER TABLE `tmensajes` ADD COLUMN `citicity` INT(10) UNSIGNED DEFAULT '0'; +ALTER TABLE `tmensajes` ADD COLUMN `id_source` BIGINT(20) UNSIGNED NOT NULL; +ALTER TABLE `tmensajes` ADD COLUMN `subtype` VARCHAR(255) DEFAULT ''; +ALTER TABLE `tmensajes` ADD CONSTRAINT `tsource_fk` FOREIGN KEY (`id_source`) REFERENCES `tnotification_source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; + + +-- ---------------------------------------------------------------------- +-- Table `tnotification_user` +-- ---------------------------------------------------------------------- +CREATE TABLE `tnotification_user` ( + `id_mensaje` INT(10) UNSIGNED NOT NULL, + `id_user` VARCHAR(60) NOT NULL, + `utimestamp_read` BIGINT(20), + `utimestamp_erased` BIGINT(20), + `postpone` INT, + PRIMARY KEY (`id_mensaje`,`id_user`), + FOREIGN KEY (`id_mensaje`) REFERENCES `tmensajes`(`id_mensaje`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tnotification_group` +-- ---------------------------------------------------------------------- +CREATE TABLE `tnotification_group` ( + `id_mensaje` INT(10) UNSIGNED NOT NULL, + `id_group` mediumint(4) UNSIGNED NOT NULL, + PRIMARY KEY (`id_mensaje`,`id_group`), + FOREIGN KEY (`id_mensaje`) REFERENCES `tmensajes`(`id_mensaje`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tnotification_source_user` +-- ---------------------------------------------------------------------- +CREATE TABLE `tnotification_source_user` ( + `id_source` BIGINT(20) UNSIGNED NOT NULL, + `id_user` VARCHAR(60), + `enabled` INT(1) DEFAULT NULL, + `also_mail` INT(1) DEFAULT NULL, + PRIMARY KEY (`id_source`,`id_user`), + FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tnotification_source_group` +-- ---------------------------------------------------------------------- +CREATE TABLE `tnotification_source_group` ( + `id_source` BIGINT(20) UNSIGNED NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + PRIMARY KEY (`id_source`,`id_group`), + INDEX (`id_group`), + FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tnotification_source_user` +-- ---------------------------------------------------------------------- +CREATE TABLE `tnotification_source_group_user` ( + `id_source` BIGINT(20) UNSIGNED NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + `id_user` VARCHAR(60), + `enabled` INT(1) DEFAULT NULL, + `also_mail` INT(1) DEFAULT NULL, + PRIMARY KEY (`id_source`,`id_user`), + FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_group`) REFERENCES `tnotification_source_group`(`id_group`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Add alert command 'Generate notification' +-- ---------------------------------------------------------------------- +INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES ('Generate Notification','Internal type','This command allows you to send an internal notification to any user or group.',1,'[\"Destination user\",\"Destination group\",\"Title\",\"Message\",\"Link\",\"Criticity\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); + +-- ---------------------------------------------------------------------- +-- Update message references and pre-configure notifications +-- ---------------------------------------------------------------------- +INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="System status"), "admin", 1, 0); +INSERT INTO `tnotification_source_group` SELECT `id`,0 FROM `tnotification_source` WHERE `description`="Message"; +INSERT INTO `tnotification_user` (`id_mensaje`, `id_user`) SELECT `id_mensaje`, `id_usuario_destino` FROM `tmensajes` WHERE `id_usuario_destino` != ''; +-- ---------------------------------------------------------------------- +-- Add custom internal recon scripts +-- ---------------------------------------------------------------------- +INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Application.VMware', 'Discovery Application script to monitor VMware technologies (ESXi, VCenter, VSphere)', '/usr/share/pandora_server/util/recon_scripts/vmware-plugin.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}'); +INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Cloud', 'Discovery Cloud script to monitor Cloud technologies (AWS.EC2, AWS.S3, AWS.RDS, RDS,ȊWS.EKS)', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}'); +-- ---------------------------------------------------------------------- +-- Add column in table `tagent_custom_fields` +-- ---------------------------------------------------------------------- +ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT ''; diff --git a/pandora_console/general/firts_task/recon_view.php b/pandora_console/general/firts_task/recon_view.php index 026d0f5673..2377ce7c20 100755 --- a/pandora_console/general/firts_task/recon_view.php +++ b/pandora_console/general/firts_task/recon_view.php @@ -15,17 +15,17 @@ global $config; check_login(); ui_require_css_file('firts_task'); ?> - true, 'message' => __('There are no recon task defined yet.') ]); ?> + true, 'message' => __('There are no discovery tasks defined yet.') ]); ?>
- __('Recon server')]); ?> + __('Discovery server')]); ?>
-

+

ICMP (pings), SNMP (detecting the topology of networks and their interfaces), and other customized @@ -33,8 +33,8 @@ ui_require_css_file('firts_task'); ); ?>

-
- + +

diff --git a/pandora_console/general/footer.php b/pandora_console/general/footer.php index a9a251d177..48d0613c98 100644 --- a/pandora_console/general/footer.php +++ b/pandora_console/general/footer.php @@ -1,16 +1,19 @@ '; +echo ''; require_once $config['homedir'].'/include/functions_update_manager.php'; @@ -40,9 +43,9 @@ if ($current_package == 0) { echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config['MR'])); -echo '
'; -echo ''.__('Page generated at').' '.date($config['date_format']); -echo '
® '.get_copyright_notice().''; +echo ' '; +echo ''.__('Page generated at').' '.date($config['date_format']); +echo '
® '.get_copyright_notice().''; if (isset($config['debug'])) { $cache_info = []; diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 846f20677b..7addef057f 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -1,8 +1,7 @@ - - - - - - -
- - +
+ '.notifications_print_ball( + $notifications_numbers['notifications'], + $notifications_numbers['last_id'] + ).'
'; - $logo_title = get_product_name().' Enterprise'; - } - - echo html_print_image( - $custom_logo, - true, - [ - 'alt' => $logo_title, - 'border' => '0', - ] - ); - ?> -
-
- id = 'header_table'; - $table->class = 'none'; - $table->cellpadding = 0; - $table->cellspacing = 0; - $table->head = []; - $table->data = []; - $table->style[0] = $table->style['clippy'] = $table->style[1] = $table->style[3] = $table->style[4] = $table->style[5] = $table->style[6] = $table->style[8] = $table->style[9] = $table->style['qr'] = 'width: 22px; text-align:center; height: 22px; padding-right: 9px;padding-left: 9px;'; - $table->style[7] = 'width: 20px; padding-right: 9px;'; - $table->style['searchbar'] = 'width: 180px; min-width: 180px;'; - $table->style[11] = 'padding-left: 10px; padding-right: 5px;width: 16px;'; - $table->width = '100%'; - $table->styleTable = 'margin: auto; margin-top: 0px;'; - $table->rowclass[0] = ''; - - $acl_head_search = true; - if ($config['acl_enterprise'] == 1 && !users_is_admin()) { - $acl_head_search = db_get_sql( - "SELECT sec FROM tusuario - INNER JOIN tusuario_perfil ON tusuario.id_user = tusuario_perfil.id_usuario - INNER JOIN tprofile_view ON tprofile_view.id_profile = tusuario_perfil.id_perfil - WHERE tusuario.id_user = '".$config['id_user']."' AND (sec = '*' OR sec = 'head_search')" - ); + // ======= Servers List =============================================== + $servers_list = '
'; + $servers = []; + $servers['all'] = (int) db_get_value('COUNT(id_server)', 'tserver'); + if ($servers['all'] != 0) { + $servers['up'] = (int) servers_check_status(); + $servers['down'] = ($servers['all'] - $servers['up']); + if ($servers['up'] == 0) { + // All Servers down or no servers at all. + $servers_check_img = html_print_image('images/header_down_gray.png', true, ['alt' => 'cross', 'class' => 'bot', 'title' => __('All systems').': '.__('Down')]); + } else if ($servers['down'] != 0) { + // Some servers down. + $servers_check_img = html_print_image('images/header_warning_gray.png', true, ['alt' => 'error', 'class' => 'bot', 'title' => $servers['down'].' '.__('servers down')]); + } else { + // All servers up. + $servers_check_img = html_print_image('images/header_ready_gray.png', true, ['alt' => 'ok', 'class' => 'bot', 'title' => __('All systems').': '.__('Ready')]); } - if ($acl_head_search) { - $table->data[0][11] = ui_print_help_tip(__('Blank characters are used as AND conditions'), true); + unset($servers); + // Since this is the header, we don't like to trickle down variables. + $servers_check_img_link = ''; + $servers_check_img_link .= $servers_check_img; + $servers_check_img_link .= ''; + }; + $servers_list .= $servers_check_img_link.'
'; - // Search bar - $search_bar = '
'; - if (!isset($config['search_keywords'])) { + + + // ======= Alerts =============================================== + $check_minor_release_available = false; + $pandora_management = check_acl($config['id_user'], 0, 'PM'); + + $check_minor_release_available = db_check_minor_relase_available(); + + if ($check_minor_release_available) { + if (users_is_admin($config['id_user'])) { + if ($config['language'] == 'es') { + set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. '.__('Sobre actualización de revisión menor').'', 'Revisión/es menor/es disponible/s'); + } else { + set_pandora_error_for_header('There are one or more minor releases waiting for update. '.__('About minor release update').'', 'minor release/s available'); + } + } + } + + + // Chat messages. + $header_chat = "'; + + + // Search + $acl_head_search = true; + if ($config['acl_enterprise'] == 1 && !users_is_admin()) { + $acl_head_search = db_get_sql( + "SELECT sec FROM tusuario + INNER JOIN tusuario_perfil ON tusuario.id_user = tusuario_perfil.id_usuario + INNER JOIN tprofile_view ON tprofile_view.id_profile = tusuario_perfil.id_perfil + WHERE tusuario.id_user = '".$config['id_user']."' AND (sec = '*' OR sec = 'head_search')" + ); + } + + if ($acl_head_search) { + // Search bar + $search_bar = ''; + if (!isset($config['search_keywords'])) { + $search_bar .= ''; + } else { + if (strlen($config['search_keywords']) == 0) { $search_bar .= ''; } else { - if (strlen($config['search_keywords']) == 0) { - $search_bar .= ''; - } else { - $search_bar .= ''; - } + $search_bar .= ''; } - - $search_bar .= ''; - - // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; - $search_bar .= ""; - $search_bar .= '
'; - - $table->data[0]['searchbar'] = $search_bar; } - // Servers check - $servers = []; - $servers['all'] = (int) db_get_value('COUNT(id_server)', 'tserver'); - $servers['up'] = (int) servers_check_status(); - $servers['down'] = ($servers['all'] - $servers['up']); - if ($servers['up'] == 0) { - // All Servers down or no servers at all - $servers_check_img = html_print_image('images/header_down.png', true, ['alt' => 'cross', 'class' => 'bot', 'title' => __('All systems').': '.__('Down')]); - } else if ($servers['down'] != 0) { - // Some servers down - $servers_check_img = html_print_image('images/header_warning.png', true, ['alt' => 'error', 'class' => 'bot', 'title' => $servers['down'].' '.__('servers down')]); + $search_bar .= ' 'ok', 'class' => 'bot', 'title' => __('All systems').': '.__('Ready')]); + $search_bar .= "value='".$config['search_keywords']."'"; } - unset($servers); - // Since this is the header, we don't like to trickle down variables. - $servers_link_open = ''; - $servers_link_close = ''; + $search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" + onkeyup="javascript: fieldKeyWordEmpty = false;" + style="margin-top:5px;" class="search_input" />'; - if ($config['show_qr_code_header'] == 0) { - $show_qr_code_header = 'display: none;'; + // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; + $search_bar .= ""; + $search_bar .= ''; + + $header_searchbar = ''; + } + + + // ======= Autorefresh code ============================= + $autorefresh_txt = ''; + $autorefresh_additional = ''; + + $ignored_params = [ + 'agent_config' => false, + 'code' => false, + ]; + + if (!isset($_GET['sec2'])) { + $_GET['sec2'] = ''; + } + + if (!isset($_GET['refr'])) { + $_GET['refr'] = null; + } + + $select = db_process_sql("SELECT autorefresh_white_list,time_autorefresh FROM tusuario WHERE id_user = '".$config['id_user']."'"); + $autorefresh_list = json_decode($select[0]['autorefresh_white_list']); + + if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) { + $do_refresh = true; + if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { + if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { + $do_refresh = false; + } + } + + if ($do_refresh) { + $autorefresh_img = html_print_image('images/header_refresh_gray.png', true, ['class' => 'bot', 'alt' => 'lightning', 'title' => __('Configure autorefresh')]); + + if ($_GET['refr']) { + $autorefresh_txt .= ' ('.date('i:s', $config['refr']).')'; + } + + $ignored_params['refr'] = ''; + $values = get_refresh_time_array(); + $autorefresh_additional = ''; + unset($values); + + $autorefresh_link_open_img = ''; + + if ($_GET['refr']) { + $autorefresh_link_open_txt = ''; + } else { + $autorefresh_link_open_txt = ''; + } + + $autorefresh_link_close = ''; + $display_counter = 'display:block'; } else { - $show_qr_code_header = 'display: inline;'; + $autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); + + $ignored_params['refr'] = false; + + $autorefresh_link_open_img = ''; + $autorefresh_link_open_txt = ''; + $autorefresh_link_close = ''; + + $display_counter = 'display:none'; } + } else { + $autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); - $table->data[0]['qr'] = ''; + $ignored_params['refr'] = false; - echo "'; - ?> - - data[0]['clippy'] = ''.html_print_image( - 'images/clippy_icon.png', - true, - [ - 'id' => 'clippy', - 'class' => 'clippy', - 'alt' => __('%s assistant', get_product_name()), - 'title' => __( - '%s assistant', - get_product_name() - ), - ] - ).''; - } + $autorefresh_link_open_img = ''; + $autorefresh_link_open_txt = ''; + $autorefresh_link_close = ''; + + $display_counter = 'display:none'; + } + + $header_autorefresh = '
'.$autorefresh_link_open_img.$autorefresh_img.$autorefresh_link_close.'
'; + $header_autorefresh_counter = '
'.$autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional.'
'; - $table->data[0][0] = $servers_link_open.$servers_check_img.$servers_link_close; + // Qr. + if ($config['show_qr_code_header'] == 0) { + $show_qr_code_header = 'display: none;'; + } else { + $show_qr_code_header = 'display: inline;'; + } + + $header_qr = ''; + + echo "'; + ?> + + __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); + } else { + $header_user = html_print_image('images/header_user_green.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); + } + + $header_user = ''; + + // Logout. + $header_logout = ''; + + echo '
'.$header_autorefresh, $header_autorefresh_counter, $header_qr, $header_chat.'
+
'.$header_searchbar, $header_discovery, $servers_list.'
+
'.$header_user, $header_logout.'
'; + ?> + + + + - - // ======= Autorefresh code ============================= - $autorefresh_txt = ''; - $autorefresh_additional = ''; - - $ignored_params = [ - 'agent_config' => false, - 'code' => false, - ]; - - if (!isset($_GET['sec2'])) { - $_GET['sec2'] = ''; - } - - if (!isset($_GET['refr'])) { - $_GET['refr'] = null; - } - - $select = db_process_sql("SELECT autorefresh_white_list,time_autorefresh FROM tusuario WHERE id_user = '".$config['id_user']."'"); - $autorefresh_list = json_decode($select[0]['autorefresh_white_list']); - - if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) { - $do_refresh = true; - if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { - if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { - $do_refresh = false; - } - } - - if ($do_refresh) { - $autorefresh_img = html_print_image('images/header_refresh.png', true, ['class' => 'bot', 'alt' => 'lightning', 'title' => __('Configure autorefresh')]); - - if ($_GET['refr']) { - $autorefresh_txt .= ' ('.date('i:s', $config['refr']).')'; - } - - $ignored_params['refr'] = ''; - $values = get_refresh_time_array(); - $autorefresh_additional = ''; - unset($values); - - $autorefresh_link_open_img = ''; - - if ($_GET['refr']) { - $autorefresh_link_open_txt = ''; - } else { - $autorefresh_link_open_txt = ''; - } - - $autorefresh_link_close = ''; - } else { - $autorefresh_img = html_print_image('images/header_refresh_disabled.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); - - $ignored_params['refr'] = false; - - $autorefresh_link_open_img = ''; - $autorefresh_link_open_txt = ''; - $autorefresh_link_close = ''; - } - } else { - $autorefresh_img = html_print_image('images/header_refresh_disabled.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); - - $ignored_params['refr'] = false; - - $autorefresh_link_open_img = ''; - $autorefresh_link_open_txt = ''; - $autorefresh_link_close = ''; - } - - $table->data[0][1] = $autorefresh_link_open_img.$autorefresh_img.$autorefresh_link_close; - $table->data[0][2] = $autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional; - // ====================================================== - $check_minor_release_available = false; - $pandora_management = check_acl($config['id_user'], 0, 'PM'); - - $check_minor_release_available = db_check_minor_relase_available(); - - if ($check_minor_release_available) { - if (users_is_admin($config['id_user'])) { - if ($config['language'] == 'es') { - set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. '.__('Sobre actualización de revisión menor').'', 'Revisión/es menor/es disponible/s'); - } else { - set_pandora_error_for_header('There are one or more minor releases waiting for update. '.__('About minor release update').'', 'minor release/s available'); - } - } - } - - echo ''; - - if ($config['alert_cnt'] > 0) { - $maintenance_link = 'javascript:'; - $maintenance_title = __('System alerts detected - Please fix as soon as possible'); - $maintenance_class = $maintenance_id = 'show_systemalert_dialog white'; - - $maintenance_link_open_txt = ''; - $maintenance_link_open_img = ''; - $maintenance_link_close = ''; - if (!$pandora_management) { - $maintenance_img = ''; - } else { - $maintenance_img = $maintenance_link_open_img.html_print_image( - 'images/header_yellow.png', - true, - [ - 'title' => __( - 'You have %d warning(s)', - $config['alert_cnt'] - ), - 'id' => 'yougotalert', - 'class' => 'bot', - ] - ).$maintenance_link_close; - } - } else { - if (!$pandora_management) { - $maintenance_img = ''; - } else { - $maintenance_img = html_print_image('images/header_ready.png', true, ['title' => __('There are not warnings'), 'id' => 'yougotalert', 'class' => 'bot']); - } - } - - $table->data[0][3] = $maintenance_img; - - // Main help icon - if (!$config['disable_help']) { - $table->data[0][4] = ''.html_print_image( - 'images/header_help.png', - true, - [ - 'title' => __('Main help'), - 'id' => 'helpmodal', - 'class' => 'modalpopup', - ] - ).''; - } - - // Logout - $table->data[0][5] = ''; - $table->data[0][5] .= html_print_image('images/header_logout.png', true, ['alt' => __('Logout'), 'class' => 'bot', 'title' => __('Logout')]); - $table->data[0][5] .= ''; - - // User - if (is_user_admin($config['id_user']) == 1) { - $table->data[0][6] = html_print_image('images/header_user_admin.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); - } else { - $table->data[0][6] = html_print_image('images/header_user.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); - } - - $table->data[0][6] = ''.$table->data[0][6].''; - - $table->data[0][7] = ' ('.$config['id_user'].')'; - - // Chat messages - $table->data[0][8] = "'; - - // Messages - $msg_cnt = messages_get_count($config['id_user']); - if ($msg_cnt > 0) { - echo ''; - - $table->data[0][9] = ''; - $table->data[0][9] .= html_print_image('images/header_email.png', true, ['title' => __('You have %d unread message(s)', $msg_cnt), 'id' => 'yougotmail', 'class' => 'bot', 'style' => 'width:24px;']); - $table->data[0][9] .= ''; - } - - - - html_print_table($table); - - unset($table); - ?> -
+ + +'; +echo ''; // menu_container ui_require_jquery_file('cookie'); -$config_fixed_menu = false; -if (isset($config['fixed_menu'])) { - $config_fixed_menu = $config['fixed_menu']; -} - $config_fixed_header = false; if (isset($config['fixed_header'])) { $config_fixed_header = $config['fixed_header']; @@ -64,25 +126,35 @@ if (isset($config['fixed_header'])) { @@ -348,182 +191,199 @@ $(document).ready( function() { handsIn = 0; handsIn2 = 0; - if(!click_display){ - $('.menu_icon').mouseenter(function() { + +/** + * Positionate the submenu elements. Add a negative top. + * + * @param int index It is the position of li.menu_icon in the ul. + * @param string id_submenu It is the id of first level submenu. + * @param string id_submenu2 It is the id of second level submenu. + * @param int item_height It is the height of a menu item (28 o 35). + * + * @return (int) The position (in px). + */ +function menu_calculate_top(index, id_submenu, id_submenu2, item_height){ + + var level1 = index; + var level2 = $('#'+id_submenu+' ul.submenu > li').length; + var level3 = $('#'+id_submenu2+' > li.sub_subMenu').length; + var item_height = item_height; + + level2--; + if (id_submenu2 !== false) { + // If level3 is set, the position is calculated like box is in the center. + // wiouth considering level2 box can be moved. + level3--; + total = (level1 + level3); + comp = level3; + } else { + total = (level1 + level2); + comp = level2; + } + + // Positionate in the middle + if (total > 12 && ((total < 18) || ((level1 - comp) <= 4))) { + return - ( Math.floor(comp / 2) * item_height); + } + + // Positionate in the bottom + if (total >= 18) { + return (- comp * item_height); + } + + // return 0 by default + return 0; +} + + +/** + * Get the menu items to be positioned. + * + * @param string item It is the selector of the current element. + * + * @return Add the top position in a inline style. + */ +function get_menu_items(item){ + var item_height = parseInt(item.css('min-height')); + var id_submenu = item.attr('id'); + var id_submenu2 = false; + var index = item.index(); + + if(item.parent().hasClass('godmode')){ + index = index+6; // This is because the menu has divided in two parts. + } + var top_submenu = menu_calculate_top(index, id_submenu, id_submenu2, item_height); + top_submenu = top_submenu+'px'; + $('#'+id_submenu+' ul.submenu').css('top', top_submenu); + + $('.has_submenu').mouseenter(function() { + id_submenu2 = item.attr('id'); + id_submenu2 = $('#'+id_submenu2+' ul.submenu2').attr('id'); + var top_submenu2 = menu_calculate_top(index, id_submenu, id_submenu2, item_height); + top_submenu2 = top_submenu2+'px'; + $('#'+id_submenu2).css('top', top_submenu2); + }); +} + +/* + * Show and hide submenus + */ +if(!click_display){ + $('.menu_icon').mouseenter(function() { + table_hover = $(this); + handsIn = 1; + openTime = new Date().getTime(); + $("ul#sub"+table_hover[0].id).show(); + get_menu_items(table_hover); + if( typeof(table_noHover) != 'undefined') + if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id ) + $("ul#sub"+table_noHover[0].id).hide(); + }).mouseleave(function() { + table_noHover = $(this); + handsIn = 0; + setTimeout(function() { + opened = new Date().getTime() - openTime; + if(opened > 3000 && handsIn == 0) { + openTime = 4000; + $("ul#sub"+table_noHover[0].id).hide(); + } + }, 2500); + }); +}else{ + $(document).ready(function() { + if (autohidden_menu) { + $('.menu_icon').on("click", function() { + if( typeof(table_hover) != 'undefined'){ + $("ul#sub"+table_hover[0].id).hide(); + } table_hover = $(this); handsIn = 1; openTime = new Date().getTime(); $("ul#sub"+table_hover[0].id).show(); - if( typeof(table_noHover) != 'undefined') - if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id ) - $("ul#sub"+table_noHover[0].id).hide(); + get_menu_items(table_hover); }).mouseleave(function() { table_noHover = $(this); handsIn = 0; setTimeout(function() { opened = new Date().getTime() - openTime; - if(opened > 3000 && handsIn == 0) { - openTime = 4000; - $("ul#sub"+table_hover[0].id).hide(); + if(opened > 5000 && handsIn == 0) { + openTime = 6000; + $("ul#sub"+table_noHover[0].id).hide(); } - }, 2500); + }, 5500); }); + } else { + $('.menu_icon').on("click", function() { + if( typeof(table_hover) != 'undefined'){ + $("ul#sub"+table_hover[0].id).hide(); + } + table_hover = $(this); + handsIn = 1; + openTime = new Date().getTime(); + $("ul#sub"+table_hover[0].id).show(); + get_menu_items(table_hover); + }); + } + }); +} + +$('.has_submenu').mouseenter(function() { + table_hover2 = $(this); + handsIn2 = 1; + openTime2 = new Date().getTime(); + $("#sub"+table_hover2[0].id).show(); + if( typeof(table_noHover2) != 'undefined') + if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id ) + $("ul#sub"+table_noHover2[0].id).hide(); +}).mouseleave(function() { + table_noHover2 = table_hover2; + handsIn2 = 0; + setTimeout(function() { + opened = new Date().getTime() - openTime2; + if(opened >= 3000 && handsIn2 == 0) { + openTime2 = 4000; + $("ul#sub"+table_hover2[0].id).hide(); + } + }, 3500); +}); + +$(document).ready(function() { + + if(!click_display){ + $('#container').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + }); }else{ - $(document).ready(function() { - if (autohidden_menu) { - $('.menu_icon').on("click", function() { - if( typeof(table_hover) != 'undefined'){ - $("ul#sub"+table_hover[0].id).hide(); - } - table_hover = $(this); - handsIn = 1; - openTime = new Date().getTime(); - $("ul#sub"+table_hover[0].id).show(); - }).mouseleave(function() { - table_noHover = $(this); - handsIn = 0; - setTimeout(function() { - opened = new Date().getTime() - openTime; - if(opened > 5000 && handsIn == 0) { - openTime = 6000; - $("ul#sub"+table_hover[0].id).hide(); - } - }, 5500); - }); - } else { - $('.menu_icon').on("click", function() { - if( typeof(table_hover) != 'undefined'){ - $("ul#sub"+table_hover[0].id).hide(); - } - table_hover = $(this); - handsIn = 1; - openTime = new Date().getTime(); - $("ul#sub"+table_hover[0].id).show(); - }); - } + $('#main').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); }); } -- $('.has_submenu').mouseenter(function() { - table_hover2 = $(this); - handsIn2 = 1; - openTime2 = new Date().getTime(); - $("#sub"+table_hover2[0].id).show(); - if( typeof(table_noHover2) != 'undefined') - if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id ) - $("ul#sub"+table_noHover2[0].id).hide(); - }).mouseleave(function() { - table_noHover2 = table_hover2; - handsIn2 = 0; - setTimeout(function() { - opened = new Date().getTime() - openTime2; - if(opened >= 3000 && handsIn2 == 0) { - openTime2 = 4000; - $("ul#sub"+table_hover2[0].id).hide(); - } - }, 3500); - }); - - $(document).ready(function() { - if (!classic_menu) { - //Daniel maya 02/06/2016 Display menu with click --INI - if(!click_display){ - $('#container').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); - }else{ - $('#main').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); - } - //Daniel maya 02/06/2016 Display menu with click --END - } - else { - if(!click_display){ - $('#container').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '145px'); - $('ul.submenu').css('left', '144px'); - }); - }else{ - $('#main').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '145px'); - $('ul.submenu').css('left', '144px'); - }); - } - } + + $('div.menu>ul>li>ul>li>a').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + }); - if (classic_menu) { - $('div.menu>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('ul.submenu').css('left', '144px'); - }); - - $('div.menu>ul>li>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('ul.submenu').css('left', '144px'); - }); - } - else { - $('div.menu>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); - - $('div.menu>ul>li>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); - } + $('div.menu>ul>li>ul>li>ul>li>a').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); }); +}); - diff --git a/pandora_console/general/mysqlerr.php b/pandora_console/general/mysqlerr.php new file mode 100644 index 0000000000..40da530386 --- /dev/null +++ b/pandora_console/general/mysqlerr.php @@ -0,0 +1,113 @@ + + + + + + + +
+ +
+ + + +
+ +
+ /images/mysqlerr.png'> +
+ +
+
+ +
+ +
+
+
+ +
+ + + \ No newline at end of file diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 143d6d880b..a7fc1f156a 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -708,6 +708,13 @@ foreach ($fields as $field) { __('This field allows url insertion using the BBCode\'s url tag').'.
'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.

'.__('e.g.: [url=google.com]Google web search[/url]'), true ); + $combo = []; + $combo = $field['combo_values']; + $combo = explode(',', $combo); + $combo_values = []; + foreach ($combo as $value) { + $combo_values[$value] = $value; + } $custom_value = db_get_value_filter( 'description', @@ -747,6 +754,28 @@ foreach ($fields as $field) { ); } + if ($field['combo_values'] !== '') { + $data[1] = html_print_select( + $combo_values, + 'customvalue_'.$field['id_field'], + $custom_value, + '', + __('None'), + '', + true, + false, + false, + '', + false, + false, + false, + false, + false, + '', + false + ); + }; + array_push($table->data, $data); } @@ -757,7 +786,7 @@ if (!empty($fields)) { echo '
'; -// The context help about the learning mode +// The context help about the learning mode. if ($modo == 0) { echo ""; } else { diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 5b3a91d0d7..9c10099042 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -159,8 +159,8 @@ $module_macros = []; // Create agent if ($create_agent) { $mssg_warning = 0; - $alias_safe_output = io_safe_output(get_parameter("alias","")); - $alias = io_safe_input(trim (preg_replace('/[\/\\\|%#&$-]/', '', $alias_safe_output))); + $alias_safe_output = io_safe_output(get_parameter('alias', '')); + $alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$-]/', '', $alias_safe_output))); $alias_as_name = (int) get_parameter_post('alias_as_name', 0); $direccion_agente = (string) get_parameter_post('direccion', ''); $unique_ip = (int) get_parameter_post('unique_ip', 0); @@ -765,8 +765,8 @@ if ($update_agent) { $mssg_warning = 0; $id_agente = (int) get_parameter_post('id_agente'); $nombre_agente = str_replace('`', '‘', (string) get_parameter_post('agente', '')); - $alias_safe_output = io_safe_output(get_parameter("alias","")); - $alias = io_safe_input(trim (preg_replace('/[\/\\\|%#&$-]/', '', $alias_safe_output))); + $alias_safe_output = io_safe_output(get_parameter('alias', '')); + $alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$-]/', '', $alias_safe_output))); $alias_as_name = (int) get_parameter_post('alias_as_name', 0); $direccion_agente = (string) get_parameter_post('direccion', ''); $unique_ip = (int) get_parameter_post('unique_ip', 0); diff --git a/pandora_console/godmode/agentes/configure_field.php b/pandora_console/godmode/agentes/configure_field.php index 25afef0c21..5f7c6b91d0 100755 --- a/pandora_console/godmode/agentes/configure_field.php +++ b/pandora_console/godmode/agentes/configure_field.php @@ -25,13 +25,16 @@ $id_field = (int) get_parameter('id_field', 0); $name = (string) get_parameter('name', ''); $display_on_front = (bool) get_parameter('display_on_front', 0); $is_password_type = (bool) get_parameter('is_password_type', 0); - -// Header +$is_combo_enable = (bool) get_parameter('is_combo_enable', 0); +$combo_values = (string) get_parameter('combo_values', ''); +// Header. if ($id_field) { $field = db_get_row_filter('tagent_custom_fields', ['id_field' => $id_field]); $name = $field['name']; $display_on_front = $field['display_on_front']; $is_password_type = $field['is_password_type']; + $combo_values = $field['combo_values']; + $is_combo_enable = $config['is_combo_enable']; ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, ''); } else { ui_print_page_header(__('Create agent custom field'), 'images/custom_field.png', false, '', true, ''); @@ -40,17 +43,87 @@ if ($id_field) { $table = new stdClass(); $table->width = '100%'; $table->class = 'databox filters'; +$table->id = 'configure_field'; $table->style[0] = 'font-weight: bold'; $table->style[2] = 'font-weight: bold'; +$table->style[4] = 'font-weight: bold'; +$table->style[6] = 'font-weight: bold'; + +echo "'; + +echo "'; + +echo "'; + +echo "'; + + $table->data = []; + $table->data[0][0] = __('Name'); -$table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true); +$table->data[0][1] = html_print_input_text( + 'name', + $name, + '', + 35, + 100, + true +); -$table->data[0][2] = __('Pass type').ui_print_help_tip(__('The fields with pass type enabled will be displayed like html input type pass in html'), true); -$table->data[0][3] = html_print_checkbox('is_password_type', 1, $is_password_type, true); +$table->data[1][0] = __('Pass type').ui_print_help_tip( + __('The fields with pass type enabled will be displayed like html input type pass in html'), + true +); +$table->data[1][1] = html_print_checkbox_switch( + 'is_password_type', + 1, + $is_password_type, + true +); -$table->data[0][4] = __('Display on front').ui_print_help_tip(__('The fields with display on front enabled will be displayed into the agent details'), true); -$table->data[0][5] = html_print_checkbox('display_on_front', 1, $display_on_front, true); +$table->data[2][0] = __('Display on front').ui_print_help_tip( + __('The fields with display on front enabled will be displayed into the agent details'), + true +); +$table->data[2][1] = html_print_checkbox_switch( + 'display_on_front', + 1, + $display_on_front, + true +); + +$table->data[3][0] = __('Enabled combo'); +$table->data[3][1] = html_print_checkbox_switch_extended( + 'is_combo_enable', + 0, + $config['is_combo_enable'], + false, + '', + '', + true +); + +$table->rowstyle[4] = 'display: none;'; +$table->data[4][0] = __('Combo values').ui_print_help_tip( + __('Set values separated by comma'), + true +); +$table->data[4][1] = html_print_input_text( + 'combo_values', + io_safe_output($combo_values), + '', + 35, + 200, + true +); echo '
'; html_print_table($table); @@ -67,3 +140,67 @@ if ($id_field) { echo '
'; echo ''; +?> + + diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 867942871d..0be7166062 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -26,7 +26,7 @@ if (!check_acl($config['id_user'], 0, 'PM')) { return; } -// Header +// Header. ui_print_page_header(__('Agents custom fields manager'), 'images/custom_field.png', false, '', true, ''); $create_field = (bool) get_parameter('create_field'); @@ -36,10 +36,12 @@ $id_field = (int) get_parameter('id_field', 0); $name = (string) get_parameter('name', ''); $display_on_front = (int) get_parameter('display_on_front', 0); $is_password_type = (int) get_parameter('is_password_type', 0); +$combo_values = (string) get_parameter('combo_values', ''); +$combo_value_selected = (string) get_parameter('combo_value_selected', ''); -// Create field +// Create field. if ($create_field) { - // Check if name field is empty + // Check if name field is empty. if ($name == '') { ui_print_error_message(__('The name must not be empty')); } else if ($name == db_get_value('name', 'tagent_custom_fields', 'name', $name)) { @@ -51,20 +53,22 @@ if ($create_field) { 'name' => $name, 'display_on_front' => $display_on_front, 'is_password_type' => $is_password_type, + 'combo_values' => $combo_values, ] ); ui_print_success_message(__('Field successfully created')); } } -// Update field +// Update field. if ($update_field) { - // Check if name field is empty + // Check if name field is empty. if ($name != '') { $values = [ 'name' => $name, 'display_on_front' => $display_on_front, 'is_password_type' => $is_password_type, + 'combo_values' => $combo_values, ]; $result = db_process_sql_update('tagent_custom_fields', $values, ['id_field' => $id_field]); @@ -79,7 +83,7 @@ if ($update_field) { } } -// Delete field +// Delete field. if ($delete_field) { $result = db_process_sql_delete( 'tagent_custom_fields', diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 9f321bff59..892228042a 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -431,7 +431,7 @@ if (modules_is_string_type($id_module_type) || $edit) { str_replace('"', '', $str_warning), '', 10, - 255, + 1024, true, $disabledBecauseInPolicy, false, @@ -484,7 +484,7 @@ if (modules_is_string_type($id_module_type) || $edit) { str_replace('"', '', $str_critical), '', 10, - 255, + 1024, true, $disabledBecauseInPolicy, false, diff --git a/pandora_console/godmode/agentes/status_monitor_custom_fields.php b/pandora_console/godmode/agentes/status_monitor_custom_fields.php new file mode 100644 index 0000000000..7e9ae48bdd --- /dev/null +++ b/pandora_console/godmode/agentes/status_monitor_custom_fields.php @@ -0,0 +1,272 @@ + 'status_monitor_fields', + 'value' => $status_monitor_fields, + ]; + + // update 'status_monitor_fields' in tconfig table to keep the value at update. + $result = db_process_sql_update( + 'tconfig', + $values, + ['token' => 'status_monitor_fields'] + ); + + ui_print_result_message($result, __('Successfully updated'), __('Could not be updated')); + + $config['status_monitor_fields'] = $status_monitor_fields; +} + +$fields_selected = []; +$status_monitor_fields = ''; +$fields_selected = explode(',', $config['status_monitor_fields']); + +$result_selected = []; + +// show list of fields selected. +if ($fields_selected[0] != '') { + foreach ($fields_selected as $field_selected) { + switch ($field_selected) { + case 'policy': + $result = __('Policy'); + break; + + case 'agent': + $result = __('Agent'); + break; + + case 'data_type': + $result = __('Data type'); + break; + + case 'module_name': + $result = __('Module name'); + break; + + case 'server_type': + $result = __('Server type'); + break; + + case 'interval': + $result = __('Interval'); + break; + + case 'status': + $result = __('Status'); + break; + + case 'graph': + $result = __('Graph'); + break; + + case 'warn': + $result = __('Warn'); + break; + + case 'data': + $result = __('Data'); + break; + + case 'timestamp': + $result = __('Timestamp'); + break; + + case 'to_critical': + $result = __('Last status change'); + break; + } + + $result_selected[$field_selected] = $result; + } +} + +echo '

'.__('Show monitor detail fields').'

'; + +$table = new stdClass(); +$table->width = '100%'; +$table->class = 'databox filters'; + +$table->size = []; +// ~ $table->size[0] = '20%'; +$table->size[1] = '10px'; +// ~ $table->size[2] = '20%'; +$table->style[0] = 'text-align:center;'; +$table->style[2] = 'text-align:center;'; + +$table->data = []; + +$fields_available = []; + +$fields_available['policy'] = __('Policy'); +$fields_available['agent'] = __('Agent'); +$fields_available['data_type'] = __('Data type'); +$fields_available['module_name'] = __('Module name'); +$fields_available['server_type'] = __('Server type'); +$fields_available['interval'] = __('Interval'); +$fields_available['status'] = __('Status'); +$fields_available['graph'] = __('Graph'); +$fields_available['warn'] = __('Warn'); +$fields_available['data'] = __('Data'); +$fields_available['timestamp'] = __('Timestamp'); +$fields_available['to_critical'] = __('Last status change'); + +// remove fields already selected +foreach ($fields_available as $key => $available) { + foreach ($result_selected as $selected) { + if ($selected == $available) { + unset($fields_available[$key]); + } + } +} + +$table->data[0][0] = ''.__('Fields available').''; +$table->data[1][0] = html_print_select($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px'); +$table->data[1][1] = ''.html_print_image( + 'images/darrowright.png', + true, + [ + 'id' => 'right', + 'title' => __('Add fields to select'), + ] +).''; +$table->data[1][1] .= '



'.html_print_image( + 'images/darrowleft.png', + true, + [ + 'id' => 'left', + 'title' => __('Delete fields to select'), + ] +).''; + +$table->data[0][1] = ''; +$table->data[0][2] = ''.__('Fields selected').''; +$table->data[1][2] = html_print_select( + $result_selected, + 'fields_selected[]', + true, + '', + '', + 0, + true, + true, + false, + '', + false, + 'width: 300px' +); + +echo '
'; +html_print_table($table); + +echo '
'; + html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"'); +echo ''; +echo '
'; +?> + + diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 2011eec564..74d05c10d0 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -689,6 +689,13 @@ foreach ($fields as $field) { __('This field allows url insertion using the BBCode\'s url tag').'.
'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.

'.__('e.g.: [url=google.com]Google web search[/url]'), true ); + $combo = []; + $combo = $field['combo_values']; + $combo = explode(',', $combo); + $combo_values = []; + foreach ($combo as $value) { + $combo_values[$value] = $value; + } $custom_value = db_get_value_filter('description', 'tagent_custom_data', ['id_field' => $field['id_field'], 'id_agent' => $id_agente]); @@ -714,6 +721,28 @@ foreach ($fields as $field) { $data[1] = html_print_textarea('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true); } + if ($field['combo_values'] !== '') { + $data[1] = html_print_select( + $combo_values, + 'customvalue_'.$field['id_field'], + $custom_value, + '', + __('No change'), + '', + true, + false, + false, + '', + false, + false, + false, + false, + false, + '', + false + ); + }; + array_push($table->data, $data); } diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 700aab40ee..568e74dbbb 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -562,7 +562,7 @@ $table->data['edit1'][1] = ''; '', '', 5, - 255, + 1024, true ); $table->data['edit1'][1] .= ''; @@ -631,7 +631,7 @@ $table->data['edit1'][1] = '
'; '', '', 5, - 255, + 1024, true ); $table->data['edit1'][3] .= ''; diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 69ec49cfce..0ed041d680 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -21,6 +21,21 @@ require_once 'include/functions_menu.php'; $menu_godmode = []; $menu_godmode['class'] = 'godmode'; + +if (check_acl($config['id_user'], 0, 'PM')) { + $sub = []; + $sub['godmode/servers/discovery']['text'] = __('Discover'); + $sub['godmode/servers/discovery']['id'] = 'Discover'; + $sub['godmode/servers/discovery']['subsecs'] = ['godmode/servers/discovery']; + + // Add to menu. + $menu_godmode['discover']['text'] = __('Discovery'); + $menu_godmode['discover']['sec2'] = 'godmode/servers/discovery'; + $menu_godmode['discover']['id'] = 'god-discovery'; + $menu_godmode['discover']['sub'] = $sub; +} + + $sub = []; if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AD')) { $sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents'); @@ -200,6 +215,7 @@ if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, ' $menu_godmode['gservers']['id'] = 'god-servers'; $sub = []; + if (check_acl($config['id_user'], 0, 'AW')) { $sub['godmode/servers/modificar_server']['text'] = __('Manage servers'); $sub['godmode/servers/modificar_server']['id'] = 'Manage servers'; @@ -269,6 +285,9 @@ if (check_acl($config['id_user'], 0, 'PM')) { $sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus'); $sub2['godmode/setup/setup&section=ehorus']['refr'] = 0; + $sub2['godmode/setup/setup&section=notifications']['text'] = __('Notifications'); + $sub2['godmode/setup/setup&section=notifications']['refr'] = 0; + if ($config['activate_gis']) { $sub2['godmode/setup/gis']['text'] = __('Map conections GIS'); } diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php index 1f51302db6..2e511c6f6f 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -190,7 +190,7 @@ $table->data[4][1] .= html_print_input_text( $str_warning, '', 5, - 64, + 1024, true ).''; $table->data[4][1] .= '
'.__('Inverse interval').''; @@ -225,7 +225,7 @@ $table->data[5][1] .= html_print_input_text( $str_critical, '', 5, - 64, + 1024, true ).''; $table->data[5][1] .= '
'.__('Inverse interval').''; diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php new file mode 100755 index 0000000000..41f7fd1ffc --- /dev/null +++ b/pandora_console/godmode/servers/discovery.php @@ -0,0 +1,136 @@ +run(); + if (is_array($result) === true) { + // Redirect control and messages to DiscoveryTasklist. + $classname_selected = 'DiscoveryTaskList'; + $wiz = new $classname_selected($page); + $result = $wiz->run($result['msg'], $result['result']); + } +} + +if ($classname_selected === null) { + // Load classes and print selector. + $wiz_data = []; + foreach ($classes as $classpath) { + $classname = basename($classpath, '.class.php'); + $obj = new $classname(); + + // DiscoveryTaskList must be first button. + if ($classname == 'DiscoveryTaskList') { + array_unshift($wiz_data, $obj->load()); + } else { + $wiz_data[] = $obj->load(); + } + } + + Wizard::printBigButtonsList($wiz_data); +} diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index 37947900b4..0a5967c784 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -291,9 +291,9 @@ $table->rowclass[17] = 'recon_script'; $table->data[0][0] = ''.__('Task name').''; $table->data[0][1] = html_print_input_text('name', $name, '', 25, 0, true); -// Recon server. -$table->data[1][0] = ''.__('Recon server').ui_print_help_tip( - __('You must select a Recon Server for the Task, otherwise the Recon Task will never run'), +// Discovery server. +$table->data[1][0] = ''.__('Discovery server').ui_print_help_tip( + __('You must select a Discovery Server to run the Task, otherwise the Recon Task will never run'), true ); diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index ff370a5c48..b04643e1c3 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -112,6 +112,7 @@ $edit_file = get_parameter('edit_file', false); $update_file = get_parameter('update_file', false); $plugin_command = get_parameter('plugin_command', ''); $tab = get_parameter('tab', ''); +$deploy_plugin = get_parameter('deploy_plugin', 0); if ($view != '') { $form_id = $view; @@ -192,9 +193,8 @@ if ($filemanager) { // If is win compatible and the compatibility must be unix if ($is_win_compatible !== false && $compatibility == 'unix') { $contentFile = str_replace("\r\n", "\n", $contentFile); - } - // If is unix compatible and the compatibility must be win - else if ($is_win_compatible === false && $compatibility == 'windows') { + } else if ($is_win_compatible === false && $compatibility == 'windows') { + // If is unix compatible and the compatibility must be win $contentFile = str_replace("\n", "\r\n", $contentFile); } @@ -268,12 +268,16 @@ if ($filemanager) { // ===================================================================== $sec = 'gservers'; -if (($create != '') or ($view != '')) { +if (($create != '') || ($view != '')) { enterprise_hook('open_meta_frame'); if (defined('METACONSOLE')) { components_meta_print_header(); $sec = 'advanced'; + $management_allowed = is_management_allowed(); + if (!$management_allowed) { + ui_print_warning_message(__('To manage plugin you must activate centralized management')); + } } else { if ($create != '') { ui_print_page_header( @@ -292,6 +296,16 @@ if (($create != '') or ($view != '')) { true ); } + + $management_allowed = !is_central_policies_on_node(); + if (!$management_allowed) { + ui_print_warning_message( + __( + 'This console is not manager of this environment, + please manage this feature from centralized manager console (Metaconsole).' + ) + ); + } } @@ -564,9 +578,53 @@ if (($create != '') or ($view != '')) { if (defined('METACONSOLE')) { components_meta_print_header(); $sec = 'advanced'; + $management_allowed = is_management_allowed(); + if (!$management_allowed) { + ui_print_warning_message(__('To manage plugin you must activate centralized management')); + } + + if (!$config['metaconsole_deploy_plugin_server'] && $management_allowed) { + $deploy_plugin_server = true; + + echo ''; + ?> + + '; @@ -576,9 +634,8 @@ if (($create != '') or ($view != '')) { } - // Update plugin + // Update plugin. if (isset($_GET['update_plugin'])) { - // if modified any parameter $plugin_id = get_parameter('update_plugin', 0); $plugin_name = get_parameter('form_name', ''); $plugin_description = get_parameter('form_description', ''); @@ -709,12 +766,15 @@ if (($create != '') or ($view != '')) { $result = db_process_sql_delete('tplugin', ['id' => $plugin_id]); - if (! $result) { - ui_print_error_message(__('Problem deleting plugin')); - } else { - ui_print_success_message(__('Plugin deleted successfully')); + if (!is_metaconsole()) { + if (!$result) { + ui_print_error_message(__('Problem deleting plugin')); + } else { + ui_print_success_message(__('Plugin deleted successfully')); + } } + if ($plugin_id != 0) { // Delete all the modules with this plugin $plugin_modules = db_get_all_rows_filter( @@ -737,6 +797,153 @@ if (($create != '') or ($view != '')) { policies_change_delete_pending_module($policies_id['id']); } } + + if (is_metaconsole()) { + enterprise_include_once('include/functions_plugins.php'); + $result = plugins_delete_plugin($plugin_id); + if (!$result) { + ui_print_error_message(__('Problem deleting plugin')); + } else { + ui_print_success_message(__('Plugin deleted successfully')); + } + } + } + } + + if ($deploy_plugin) { + if (is_metaconsole()) { + enterprise_include_once('include/functions_plugins.php'); + $result = plugins_deploy_plugin($deploy_plugin); + if (!$result) { + ui_print_error_message(__('Problem deploying plugin')); + } else { + ui_print_success_message(__('Plugin deployed successfully')); + } + } + } + + if ($deploy_plugin_server) { + $setup = db_get_all_rows_in_table('tmetaconsole_setup'); + // recorremos todos los nodos. + foreach ($setup as $key => $value) { + // Obtenemos los plugins de la meta. + $all_plugin_meta = db_get_all_rows_sql('SELECT SQL_NO_CACHE * FROM tplugin', false, false); + // Conectamos con el nodo. + if (metaconsole_connect($value) == NOERR) { + $values = []; + // Obtenemos los plugin del nodo. + $node_plugin_server = db_get_all_rows_sql('SELECT SQL_NO_CACHE * FROM tplugin', false, false); + foreach ($node_plugin_server as $key2 => $plugin) { + // Comprobamos si el id esta meta y nodo al mismo tiempo. + $key_exists = array_search($plugin['id'], array_column($all_plugin_meta, 'id')); + if ($key_exists !== false) { + // Si el plugin tiene el mismo id pero diferentes datos. + if ($all_plugin_meta[$key_exists] != $plugin) { + $old_id = $plugin['id']; + $new_id = ($plugin['id'] + (1000 * $value['id'])); + + // El plugin del nodo pasa a tener otro id y otro nombre. + $plugin['id'] = $new_id; + $plugin['name'] = $plugin['name'].'_'.$value['server_name']; + $result_update = db_process_sql_update( + 'tplugin', + [ + 'id' => $new_id, + 'name' => $plugin['name'], + ], + ['id' => $old_id] + ); + + if ($result_update) { + db_process_sql_update( + 'tagente_modulo', + ['id_plugin' => $new_id], + ['id_plugin' => $old_id] + ); + + db_process_sql_update( + 'tnetwork_component', + ['id_plugin' => $new_id], + ['id_plugin' => $old_id] + ); + + db_process_sql_update( + 'tpolicy_modules', + ['id_plugin' => $new_id], + ['id_plugin' => $old_id] + ); + } + + // New plugins to insert in the metaconsole. + $values[$plugin['id']] = $plugin; + } + } else { + // Exists in the node, but does not exist in the metaconsole. + $values[$plugin['id']] = $plugin; + } + } + + // Restore to metaconsole. + metaconsole_restore_db(); + + // Insert in metaconsole. + if (!empty($values)) { + foreach ($values as $key2 => $val) { + // Insert into metaconsole. + $result_insert = db_process_sql_insert('tplugin', $val); + } + } + } + } + + $all_plugin_meta = db_get_all_rows_sql('SELECT SQL_NO_CACHE * FROM tplugin', false, false); + + foreach ($setup as $key => $value) { + if (metaconsole_connect($value) == NOERR) { + $all_plugin_node = db_get_all_rows_sql('SELECT SQL_NO_CACHE * FROM tplugin', false, false); + + $array_diff = array_diff(array_column($all_plugin_meta, 'id'), array_column($all_plugin_node, 'id')); + foreach ($array_diff as $key2 => $pluginid) { + $other = []; + $plugin_meta = $all_plugin_meta[$key2]; + + unset($plugin_meta['id']); + $other['name'] = urlencode($plugin_meta['name']); + $other['description'] = urlencode($plugin_meta['description']); + $other['max_timeout'] = $plugin_meta['max_timeout']; + $other['max_retries'] = $plugin_meta['max_retries']; + $other['execute'] = urlencode($plugin_meta['execute']); + $other['net_dst_opt'] = $plugin_meta['net_dst_opt']; + $other['net_port_opt'] = $plugin_meta['net_port_opt']; + $other['user_opt'] = $plugin_meta['user_opt']; + $other['pass_opt'] = $plugin_meta['pass_opt']; + $other['plugin_type'] = $plugin_meta['plugin_type']; + $other['macros'] = urlencode($plugin_meta['macros']); + $other['parameters'] = urlencode($plugin_meta['parameters']); + $other = implode('%7C', $other); + + $auth_token = json_decode($value['auth_token']); + $url = $value['server_url'].'include/api.php?op=set&op2=push_plugin'.'&id='.$pluginid.'&other_mode=url_encode_separator_%7C&other='.$other."&apipass=$auth_token->api_password"."&user=$auth_token->console_user&pass=$auth_token->console_password"; + $file_path = realpath($plugin_meta['execute']); + $post = ''; + if (file_exists($file_path)) { + $post = ['file' => curl_file_create($file_path)]; + } + + $curlObj = curl_init(); + curl_setopt($curlObj, CURLOPT_URL, $url); + curl_setopt($curlObj, CURLOPT_POST, 1); + curl_setopt($curlObj, CURLOPT_POSTFIELDS, $post); + curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, false); + + $api_result = curl_exec($curlObj); + curl_close($curlObj); + } + } + + // restore to metaconsole + metaconsole_restore_db(); } } @@ -753,7 +960,10 @@ if (($create != '') or ($view != '')) { echo ''; echo ''; echo ''; - echo "'; + if ($management_allowed) { + echo "'; + } + $color = 0; foreach ($rows as $row) { @@ -767,7 +977,10 @@ if (($create != '') or ($view != '')) { echo ''; echo "'; echo "'; - echo "'; } - echo "".html_print_image('images/config.png', true, ['title' => __('Edit')]).'  '; - echo "".html_print_image('images/cross.png', true, ['border' => '0']).''; - echo ''; echo ''; } @@ -813,12 +1033,15 @@ if (($create != '') or ($view != '')) { ui_print_info_message(['no_close' => true, 'message' => __('There are no plugins in the system') ]); } - echo "
'.__('Name').''.__('Type').''.__('Command').'".''.__('Op.').''.'".''.__('Op.').''.'
"; - echo ""; + if ($management_allowed) { + echo ""; + } + echo $row['name']; echo '"; @@ -780,31 +993,38 @@ if (($create != '') or ($view != '')) { echo ""; echo $row['execute']; echo '"; + if ($management_allowed) { + echo ""; - // Show it is locket - $modules_using_plugin = db_get_value_filter( - 'count(*)', - 'tagente_modulo', - [ - 'delete_pending' => 0, - 'id_plugin' => $row['id'], - ] - ); - $components_using_plugin = db_get_value_filter( - 'count(*)', - 'tnetwork_component', - ['id_plugin' => $row['id']] - ); - if (($components_using_plugin + $modules_using_plugin) > 0) { - echo ''; - html_print_image('images/lock.png'); - echo ''; + // Show it is locket + $modules_using_plugin = db_get_value_filter( + 'count(*)', + 'tagente_modulo', + [ + 'delete_pending' => 0, + 'id_plugin' => $row['id'], + ] + ); + $components_using_plugin = db_get_value_filter( + 'count(*)', + 'tnetwork_component', + ['id_plugin' => $row['id']] + ); + if (($components_using_plugin + $modules_using_plugin) > 0) { + echo ''; + html_print_image('images/lock.png'); + echo ''; + } + + echo "".html_print_image('images/config.png', true, ['title' => __('Edit')]).'  '; + echo "".html_print_image('images/cross.png', true, ['border' => '0']).''; + if (is_metaconsole()) { + echo "   ".html_print_image('images/deploy.png', true, ['title' => __('Deploy'), 'width' => '21 px']).'  '; + } + + echo '
"; + if ($management_allowed) { + echo "
"; - echo '
'; - echo "
"; - echo ""; - echo '
'; + echo ''; + echo ""; + echo ""; + echo ''; + echo '