diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index 292f0f801e..29502b8ef2 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -254,6 +254,8 @@ server_dependencies=" \ perl(Geo::IP) \ perl(IO::Socket::INET6) \ perl(XML::Twig) \ + expect \ + openssh-clients \ http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm" execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies" @@ -270,10 +272,10 @@ vmware_dependencies=" \ execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl dependencies" # Instant client Oracle -oracle_dependencier=" \ +oracle_dependencies=" \ https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm \ https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm" -execute_cmd "yum install -y $vmware_dependencies" "Installing Oracle Instant client" +execute_cmd "yum install -y $oracle_dependencies" "Installing Oracle Instant client" # Disabling SELINUX and firewalld setenforce 0 diff --git a/extras/docker/centos8/base/Dockerfile b/extras/docker/centos8/base/Dockerfile index a35aea2937..2e66972229 100644 --- a/extras/docker/centos8/base/Dockerfile +++ b/extras/docker/centos8/base/Dockerfile @@ -11,7 +11,7 @@ RUN dnf install -y --setopt=tsflags=nodocs \ RUN dnf module reset -y php && dnf module install -y php:remi-7.3 RUN dnf config-manager --set-enabled powertools -# Install console +# Install console dependencies RUN dnf install -y --setopt=tsflags=nodocs \ php \ php-mcrypt \php-cli \ @@ -91,9 +91,9 @@ RUN dnf install -y --setopt=tsflags=nodocs \ php-yaml RUN mkdir -p /run/php-fpm/ ; chown -R root:apache /run/php-fpm/ -# not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts +# Not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts -# Install server +# Install server dependencies RUN dnf install -y --setopt=tsflags=nodocs \ GeoIP \ @@ -256,16 +256,18 @@ RUN dnf install -y --setopt=tsflags=nodocs \ nmap \ net-snmp-utils \ sudo \ + expect \ + openssh-clients \ http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ - http://firefly.artica.es/centos8/wmi-1.3.14-4.el7.art.x86_64.rpm + http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm -# install utils +# Install utils RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs # SDK VMware perl dependencies RUN dnf install -y http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm http://firefly.artica.es/centos8/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm perl-Net-HTTP perl-libwww-perl openssl-devel perl-Crypt-CBC perl-Bytes-Random-Secure perl-Crypt-Random-Seed perl-Math-Random-ISAAC perl-JSON http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm # Instant client Oracle RUN dnf install -y https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm - +# Install Phantom RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs diff --git a/extras/pandora_update_version.sh b/extras/pandora_update_version.sh index 23ea7a4627..71d29feb10 100755 --- a/extras/pandora_update_version.sh +++ b/extras/pandora_update_version.sh @@ -160,9 +160,9 @@ echo "Updating Pandora Server version..." sed -i -e "s/my\s\s*\$pandora_version\s*=.*/my \$pandora_version = \"$VERSION\";/" "$SERVER_FILE" sed -i -e "s/my\s\s*\$pandora_build\s*=.*/my \$pandora_build = \"$BUILD\";/" "$SERVER_FILE" echo "Updating DB maintenance script version..." -sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION PS$BUILD\";/" "$SERVER_DB_FILE" +sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION Build $BUILD\";/" "$SERVER_DB_FILE" echo "Updating CLI script version..." -sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION PS$BUILD\";/" "$SERVER_CLI_FILE" +sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION Build $BUILD\";/" "$SERVER_CLI_FILE" sed -i -e "s/\s*\#\s*\Version.*/\# Version $VERSION/" "$SERVER_CONF_FILE" sed -i -e "s/\s*\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"$VERSION\"/" "$SERVER_WIN_MPI_OPEN_FILE" sed -i -e "s/\s*\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"$VERSION\"/" "$SERVER_WIN_MPI_ENT_FILE" @@ -197,7 +197,7 @@ echo "Updating Pandora Unix Agent version..." sed -i -e "s/\s*use\s*constant\s*AGENT_VERSION =>.*/use constant AGENT_VERSION => '$VERSION';/" "$AGENT_UNIX_FILE" sed -i -e "s/\s*use\s*constant\s*AGENT_BUILD =>.*/use constant AGENT_BUILD => '$BUILD';/" "$AGENT_UNIX_FILE" echo "Updating Pandora Windows Agent version..." -sed -i -e "s/\s*#define\s*PANDORA_VERSION\s*.*/#define PANDORA_VERSION (\"$VERSION(Build $BUILD)\")/" "$AGENT_WIN_FILE" +sed -i -e "s/\s*#define\s*PANDORA_VERSION\s*.*/#define PANDORA_VERSION (\"$VERSION Build $BUILD\")/" "$AGENT_WIN_FILE" sed -i -e "s/{Pandora FMS Windows Agent v.*}/{Pandora FMS Windows Agent v$VERSION}/" "$AGENT_WIN_MPI_FILE" NUMERIC_VERSION=$(echo $VERSION | sed -e "s/\([0-9]*\.[0-9]*\).*/\1/") sed -i -n "1h;1!H;\${;g;s/[\r\n]InstallVersion[\r\n]{\S*}/\nInstallVersion\n{$NUMERIC_VERSION.0.0}/g;p;}" "$AGENT_WIN_MPI_FILE" diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 5d3f7b7610..1ad6b6641b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210429 +Version: 7.0NG.754-210525 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index b3a667efbb..093a808276 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.754-210429" +pandora_version="7.0NG.754-210525" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 590bb20c79..66492e4f70 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210429'; +use constant AGENT_BUILD => '210525'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; @@ -1229,7 +1229,8 @@ use constant MAX_LOOP_COUNTER => 1000000000; # Print usage information and exit. ################################################################################ sub print_usage () { - print "\nUsage: $0 \n\n"; + print "Pandora FMS Agent for Linux v" . AGENT_VERSION . " Build " . AGENT_BUILD . "\n\n"; + print "Usage: $0 \n\n"; print "\tPandora home is the directory where pandora_agent.conf is located,\n"; print "\tby default /etc/pandora.\n\n"; exit 1; @@ -2330,9 +2331,6 @@ sub launch_tentacle_proxy () { #Execute tentacle server as a daemon my $new_process = "tentacle_server -a ".$Conf{'proxy_address'}." -p ".$Conf{'proxy_port'}." -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'}." -c ".$Conf{'proxy_max_connection'}." -t ".$Conf{'proxy_timeout'}; - - $new_process .= ' -C' if ($Conf{'server_ssl'} eq '1'); - log_message ('setup', 'Proxy mode enabled'); exec ($new_process); } diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index cec1503f46..bab69faca4 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.754 -%define release 210429 +%define release 210525 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 096a381658..6c968a7eff 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.754 -%define release 210429 +%define release 210525 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 e92d00fedd..95c8e48240 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210429" +PI_BUILD="210525" OS_NAME=`uname -s` FORCE=0 @@ -152,8 +152,8 @@ uninstall () { fi # Stops the agent on uninstall - if [ -f $PANDORA_BASE/etc/init.d/pandora_agent_daemon ]; then - $PANDORA_BASE/etc/init.d/pandora_agent_daemon stop 12> /dev/null + if [ -f /etc/init.d/pandora_agent_daemon ]; then + /etc/init.d/pandora_agent_daemon stop 12> /dev/null else echo "$PANDORA_BASE/etc/init.d/pandora_agent_daemon not found to stop agent" fi diff --git a/pandora_agents/unix/pandora_revent b/pandora_agents/unix/pandora_revent index 3af581decb..5f1bc8c3bd 100755 --- a/pandora_agents/unix/pandora_revent +++ b/pandora_agents/unix/pandora_revent @@ -3,7 +3,7 @@ ######################################################################## # Pandora FMS - Remote Event Tool (via WEB API) ######################################################################## -# Copyright (c) 2013 Artica Soluciones Tecnologicas S.L +# Copyright (c) 2021 Artica Soluciones Tecnologicas S.L # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 2 @@ -12,6 +12,7 @@ # Includes list use strict; use LWP::Simple; +use LWP::UserAgent; use MIME::Base64; use lib '/usr/lib/perl5'; use PandoraFMS::Tools; @@ -32,40 +33,41 @@ sub help_screen{ \t$0 -p -u -create_event Where options:\n - -u : API credentials separated by comma: ,, - -name : Free text - -group : Group ID (use 0 for 'all') - -agent : Agent ID + -u : API credentials separated by comma: ,, + -name : Free text (surrounded by single-quotes, for security reasons) + -group : Group ID (use 0 for 'all') Optional parameters: - - [-status ] : 0 New, 1 Validated, 2 In process - [-user ] : User comment (use in combination with -comment option) - [-type ] : unknown, alert_fired, alert_recovered, alert_ceased + + [-agent ] : 0 New, 1 Validated, 2 In process + [-user ] : User comment (use in combination with -comment option) + [-type ] : unknown, alert_fired, alert_recovered, alert_ceased alert_manual_validation, system, error, new_agent configuration_change, going_unknown, going_down_critical, going_down_warning, going_up_normal - [-severity ] : 0 Maintance, + [-severity ] : 0 Maintance, 1 Informative, 2 Normal, 3 Warning, 4 Crit, 5 Minor, 6 Major - [-am ] : ID Agent Module linked to event - [-alert ] : ID Alert Module linked to event + [-am ] : ID Agent Module linked to event + [-alert ] : ID Alert Module linked to event [-c_instructions ] [-w_instructions ] [-u_instructions ] - [-user_comment ] - [-owner_user ] : Use the login name, not the descriptive - [-source ] : (By default 'Pandora') - [-tag ] : Tag (must exist in the system to be imported) + [-user_comment ] : Free text (surrounded by single-quotes, for security reasons) + [-owner_user ] : Use the login name, not the descriptive + [-source ] : (By default 'Pandora') + [-tag ] : Tag (must exist in the system to be imported) [-custom_data ]: Custom data has to be in JSON format. Example: -custom_data \'{\"test1\" : \"t1\", \"test2\": \"2\"}\' - [-id_extra ] : Id extra - [-agent_name ] : Agent name, Not to be confused with the alias. - [-force_create_agent<0 o 1>]: Force the creation of agent through an event this will create when it is 1. - [-server_id ] : The pandora node server_id\n\n"; + [-id_extra ] : Id extra + [-agent_name ] : Agent name, Not to be confused with the alias. + [-force_create_agent<0 o 1>] : Force the creation of agent through an event this will create when it is 1. + [-separator ''] : If you use the vertical bar `|` in the event name, you must set other character for send the info. This must be surrounded by single-quotes + [-server_id ] : The pandora node server_id\n\n"; print "Example of event generation:\n\n"; @@ -88,7 +90,7 @@ Optional parameters: ############################################################################## sub tool_api_init () { - print "\nPandora FMS Remote Event Tool Copyright (c) 2013-2015 Artica ST\n"; + print "\nPandora FMS Remote Event Tool Copyright (c) 2013-2021 Artica ST\n"; print "This program is Free Software, licensed under the terms of GPL License v2\n"; print "You can download latest versions and documentation at http://www.pandorafms.org\n\n"; @@ -120,7 +122,7 @@ sub tool_api_main () { my $db_user; my $db_pass; my @db_info; - my $id_agent; + my $id_agent = '0'; my $id_user = ''; my $status = ''; my $id_agent_module = ''; @@ -141,6 +143,7 @@ sub tool_api_main () { my $call_api; my $custom_data = ""; my $server_id = 0; + my $separator = '|'; #~ help or api path (required) if ($ARGV[0] eq '-h') { @@ -185,12 +188,18 @@ sub tool_api_main () { if ($line eq '-agent') { $id_agent = $ARGV[$i + 1]; + # If not defined, send 0 for API. + if ($id_agent eq undef) { + $id_agent = '0'; + } + } if ($line eq '-group') { $id_group = $ARGV[$i + 1]; } if ($line eq '-name') { $event_name = $ARGV[$i + 1]; + $event_name =~ s/#/%23/g; } if ($line eq '-type') { $event_type = $ARGV[$i + 1]; @@ -250,50 +259,49 @@ sub tool_api_main () { if ($line eq '-server_id') { $server_id = $ARGV[$i + 1]; } + if ($line eq '-separator') { + $separator = $ARGV[$i + 1]; + } $i++; } if ($event_name eq "") { - print "[ERROR] Missing id agent! Read help info:\n\n"; + print "[ERROR] Missing event name! Read help info:\n\n"; help_screen (); } if ($id_group eq "") { print "[ERROR] Missing event group! Read help info:\n\n"; help_screen (); } - if ($id_agent eq "" && $agent_name eq "") { - print "[ERROR] Missing id agent! and agent_name Read help info:\n\n"; - help_screen (); - } $data_event = $event_name . - "|" . $id_group . - "|" . $id_agent . - "|" . $status . - "|" . $id_user . - "|" . $event_type . - "|" . $severity . - "|" . $id_agent_module . - "|" . $id_alert_am . - "|" . $critical_instructions . - "|" . $warning_instructions . - "|" . $unknown_instructions . - "|" . $user_comment . - "|" . $owner_user . - "|" . $source . - "|" . $tags . - "|" . $custom_data . - "|" . $server_id . - "|" . $id_extra . - "|" . $agent_name . - "|" . $force_create_agent; + $separator . $id_group . + $separator . $id_agent . + $separator . $status . + $separator . $id_user . + $separator . $event_type . + $separator . $severity . + $separator . $id_agent_module . + $separator . $id_alert_am . + $separator . $critical_instructions . + $separator . $warning_instructions . + $separator . $unknown_instructions . + $separator . $user_comment . + $separator . $owner_user . + $separator . $source . + $separator . $tags . + $separator . $custom_data . + $separator . $server_id . + $separator . $id_extra . + $separator . $agent_name . + $separator . $force_create_agent; $call_api = $api_path . '?' . 'op=set&' . 'op2=create_event&' . 'other=' . $data_event .'&' . - 'other_mode=url_encode_separator_|&' . + 'other_mode=url_encode_separator_'.$separator.'&' . 'apipass=' . $api_pass . '&' . 'user=' . $db_user . '&' . 'pass=' . $db_pass; @@ -321,7 +329,8 @@ sub tool_api_main () { exit; } else { - my $content = get($call_api); + my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 }); + my $content = $ua->get($call_api); if ($option eq '-create_event') { if ($content eq undef) { @@ -329,7 +338,7 @@ sub tool_api_main () { help_screen(); } else { - print "Event ID: $content"; + print "Event ID: $content->{'_content'}"; } } elsif ($option eq '-validate_event') { diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 54658484ab..756b2ebe26 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210429} +{210525} ViewReadme {Yes} diff --git a/pandora_agents/win32/main.cc b/pandora_agents/win32/main.cc index 70f35e66e9..802a4e3a65 100644 --- a/pandora_agents/win32/main.cc +++ b/pandora_agents/win32/main.cc @@ -115,8 +115,8 @@ main (int argc, char *argv[]) { return 0; } else if (_stricmp(argv[i], HELP_CMDLINE_PARAM) == 0) { /* Help parameter */ - cout << "Pandora agent for Windows. "; - cout << "Version " << getPandoraAgentVersion () << endl; + cout << "Pandora agent for Windows "; + cout << "v" << getPandoraAgentVersion () << endl << endl; cout << "Usage: " << argv[0] << " [OPTION]" << endl << endl; cout << "Available options are:" << endl; cout << "\t" << SERVICE_INSTALL_CMDLINE_PARAM; diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ecc63c8fe6..dae380d06d 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.754(Build 210429)") +#define PANDORA_VERSION ("7.0NG.754 Build 210525") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc index 70ce28b1f1..900694183c 100644 --- a/pandora_agents/win32/pandora_windows_service.cc +++ b/pandora_agents/win32/pandora_windows_service.cc @@ -423,7 +423,7 @@ Pandora_Windows_Service::killTentacleProxy() { int Pandora_Windows_Service::launchTentacleProxy() { - string server_ip, server_port, proxy_max_connections, proxy_timeout, server_ssl; + string server_ip, server_port, proxy_max_connections, proxy_timeout; string proxy_cmd, proxy_address, proxy_port; PROCESS_INFORMATION pi; STARTUPINFO si; @@ -451,15 +451,6 @@ Pandora_Windows_Service::launchTentacleProxy() { server_port = "41121"; } - server_ssl = conf->getValue("server_ssl"); - - if (server_ssl == "1") { - proxy_cmd = "tentacle_server.exe -C"; - } - else { - proxy_cmd = "tentacle_server.exe"; - } - // Proxy address. proxy_address = conf->getValue("proxy_address"); if (proxy_address == "") { @@ -472,7 +463,7 @@ Pandora_Windows_Service::launchTentacleProxy() { proxy_port = "41121"; } - proxy_cmd += " -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout + " -a " + proxy_address + " -p " + proxy_port; + proxy_cmd = "tentacle_server.exe -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout + " -a " + proxy_address + " -p " + proxy_port; ZeroMemory (&si, sizeof (si)); ZeroMemory (&pi, sizeof (pi)); diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 8ef58993d2..4a1723f4a9 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.754(Build 210429))" + VALUE "ProductVersion", "(7.0NG.754(Build 210525))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7d4f90a639..dd03c46298 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210429 +Version: 7.0NG.754-210525 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 1647bf5e6e..2ad5dbadee 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.754-210429" +pandora_version="7.0NG.754-210525" package_pear=0 package_pandora=1 diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index fca916d796..f0032476e2 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -31,18 +31,18 @@ require 'vendor/autoload.php'; define('AJAX', true); -if (!defined('__PAN_XHPROF__')) { +if (defined('__PAN_XHPROF__') === false) { define('__PAN_XHPROF__', 0); } if (__PAN_XHPROF__ === 1) { - if (function_exists('tideways_xhprof_enable')) { + if (function_exists('tideways_xhprof_enable') === true) { tideways_xhprof_enable(); } } -if ((! file_exists('include/config.php')) - || (! is_readable('include/config.php')) +if (file_exists('include/config.php') === false + || is_readable('include/config.php') === false ) { exit; } @@ -57,11 +57,11 @@ require_once 'include/auth/mysql.php'; if (isset($config['console_log_enabled']) === true && $config['console_log_enabled'] == 1 ) { - ini_set('log_errors', 1); + ini_set('log_errors', true); ini_set('error_log', $config['homedir'].'/log/console.log'); } else { - ini_set('log_errors', 0); - ini_set('error_log', null); + ini_set('log_errors', false); + ini_set('error_log', ''); } // Sometimes input is badly retrieved from caller... @@ -98,9 +98,11 @@ if (isset($_GET['loginhash']) === true) { } } +// Another auth class example: PandoraFMS\Dashboard\Manager. $auth_class = io_safe_output( - get_parameter('auth_class', 'PandoraFMS\Dashboard\Manager') + get_parameter('auth_class', 'PandoraFMS\User') ); + $public_hash = get_parameter('auth_hash', false); $public_login = false; // Check user. @@ -124,7 +126,7 @@ if (class_exists($auth_class) === false || $public_hash === false) { ob_start(); // Enterprise support. -if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { +if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php') === true) { include_once ENTERPRISE_DIR.'/load_enterprise.php'; } @@ -142,12 +144,12 @@ if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { ); } -if (is_metaconsole()) { +if (is_metaconsole() === true) { // Backward compatibility. define('METACONSOLE', true); } -if (file_exists($page)) { +if (file_exists($page) === true) { include_once $page; } else { echo '
Sorry! I can\'t find the page '.$page.'!'; @@ -172,7 +174,7 @@ if (isset($config['force_instant_logout']) === true header_remove('Set-Cookie'); setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); - if ($config['auth'] == 'saml') { + if ($config['auth'] === 'saml') { include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php'; $as = new SimpleSAML_Auth_Simple('PandoraFMS'); $as->logout(); diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index 51d987ae25..cd417e3a43 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -42,6 +42,10 @@ function pandora_realtime_graphs() global $config; check_login(); + if ($config['style'] === 'pandora_black') { + ui_require_css_file('pandora_black', 'include/styles/', true); + } + $id_network = get_parameter('id_network', 0); $action = get_parameter('action', 'list'); @@ -77,8 +81,8 @@ function pandora_realtime_graphs() $long_index = []; $no_data_image = ''; - $canvas = '
'; - $canvas .= '
'; + $canvas = '
'; + $canvas .= '
'; $width = 800; $height = 300; @@ -250,7 +254,9 @@ function pandora_realtime_graphs() echo ''; echo ''; - echo ''; + if ($config['style'] !== 'pandora_black') { + echo ''; + } // Store servers timezone offset to be retrieved from js. set_js_value('timezone_offset', date('Z', time())); diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index 7e9650d18c..1d8e1ec96e 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -74,7 +74,12 @@ enterprise/extensions/ipam enterprise/extensions/disabled/visual_console_manager.php enterprise/extensions/visual_console_manager.php pandora_console/extensions/net_tools.php +enterprise/godmode/agentes/module_manager_editor_web.php +enterprise/include/ajax/web_server_module_debug.php +enterprise/include/class/WebServerModuleDebug.class.php +enterprise/include/styles/WebServerModuleDebug.css include/lib/WSManager.php include/lib/WebSocketServer.php include/lib/WebSocketUser.php operation/network/network_explorer.php +operation/vsual_console/pure_ajax.php diff --git a/pandora_console/extras/mr/46.sql b/pandora_console/extras/mr/46.sql index 315180102a..04d2b030cd 100644 --- a/pandora_console/extras/mr/46.sql +++ b/pandora_console/extras/mr/46.sql @@ -20,12 +20,17 @@ ALTER TABLE `tevent_rule` MODIFY COLUMN `group_recursion` TEXT; ALTER TABLE `tevent_rule` MODIFY COLUMN `log_content` TEXT; ALTER TABLE `tevent_rule` MODIFY COLUMN `log_source` TEXT; ALTER TABLE `tevent_rule` MODIFY COLUMN `log_agent` TEXT; +ALTER TABLE tevent_filter ADD COLUMN `server_id` int(10) NOT NULL default 0; UPDATE `talert_commands` SET `fields_descriptions` = '[\"Event name\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event severity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"\",\"\"]' WHERE `name` = "Monitoring Event"; - UPDATE `tskin` SET `name` = 'Default theme' , `relative_path` = 'pandora.css' WHERE `id` = 1; UPDATE `tskin` SET `name` = 'Black theme' , `relative_path` = 'Black theme' , `description` = 'Black theme' WHERE `id` = 2; -ALTER TABLE tevent_filter ADD COLUMN `server_id` int(10) NOT NULL default 0; +UPDATE `tevent_rule` SET `criticity` = NULL, `operator_criticity` = NULL WHERE `criticity` = 99; +UPDATE `tevent_rule` SET `id_grupo` = NULL, `operator_id_grupo` = NULL WHERE `id_grupo` = 0; +UPDATE `tevent_rule` SET `id_tag` = NULL, `operator_id_tag` = NULL WHERE `id_tag` = 0; +UPDATE `tevent_rule` SET `operator_criticity` = '==' WHERE `criticity` != 99 AND `criticity` IS NOT NULL AND `criticity` != ''; +UPDATE `tevent_rule` SET `operator_id_grupo` = '==' WHERE `id_grupo` != 0 AND `id_grupo` IS NOT NULL AND `id_grupo` != ''; +UPDATE `tevent_rule` SET `operator_id_tag` = '==' WHERE `id_tag` != 0 AND `id_tag` IS NOT NULL AND `id_tag` != ''; COMMIT; diff --git a/pandora_console/extras/mr/47.sql b/pandora_console/extras/mr/47.sql new file mode 100644 index 0000000000..9a7bf687a7 --- /dev/null +++ b/pandora_console/extras/mr/47.sql @@ -0,0 +1,24 @@ +START TRANSACTION; + +ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_user` VARCHAR(60); +ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_pass` VARCHAR(45); +ALTER TABLE `tperfil` DROP COLUMN `incident_view`; +ALTER TABLE `tperfil` DROP COLUMN `incident_edit`; +ALTER TABLE `tperfil` DROP COLUMN `incident_management`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field16` TEXT NOT NULL AFTER `al_field15`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field17` TEXT NOT NULL AFTER `al_field16`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field18` TEXT NOT NULL AFTER `al_field17`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field19` TEXT NOT NULL AFTER `al_field18`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field20` TEXT NOT NULL AFTER `al_field19`; + +SET @st_oum755 = (SELECT IF( + (SELECT COUNT(*) FROM tconfig WHERE token LIKE 'meta_custom_logo' AND value like 'logo_pandora_metaconsola.png') > 0, + "UPDATE `tconfig` set value = 'pandoraFMS_metaconsole_full.svg' WHERE token LIKE 'meta_custom_logo'", + "SELECT 1" +)); + +PREPARE pr_oum755 FROM @st_oum755; +EXECUTE pr_oum755; +DEALLOCATE PREPARE pr_oum755; + +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 fce9be7024..6096c8143d 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 @@ -1334,6 +1334,11 @@ ALTER TABLE talert_snmp_action ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp_action ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp_action ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp_action ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field16` TEXT NOT NULL AFTER `al_field15`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field17` TEXT NOT NULL AFTER `al_field16`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field18` TEXT NOT NULL AFTER `al_field17`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field19` TEXT NOT NULL AFTER `al_field18`; +ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field20` TEXT NOT NULL AFTER `al_field19`; -- ---------------------------------------------------------------------- -- Table `tserver` @@ -1527,6 +1532,8 @@ ALTER TABLE `tusuario` MODIFY COLUMN `default_event_filter` int(10) unsigned NOT ADD CONSTRAINT `fk_filter_id` FOREIGN KEY `fk_filter_id` (`id_filter`) REFERENCES `tevent_filter` (`id_filter`) ON DELETE SET NULL ON UPDATE RESTRICT, DROP FOREIGN KEY `fk_id_filter`, DROP INDEX `fk_id_filter`; +ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_user` VARCHAR(60); +ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_pass` VARCHAR(45); -- --------------------------------------------------------------------- @@ -4025,3 +4032,6 @@ DELETE FROM `tconfig` WHERE `token` = 'ipam_installed'; DELETE FROM `tconfig` WHERE `token` = 'ipam_recon_script_id'; +ALTER TABLE `tperfil` DROP COLUMN `incident_view`; +ALTER TABLE `tperfil` DROP COLUMN `incident_edit`; +ALTER TABLE `tperfil` DROP COLUMN `incident_management`; \ No newline at end of file diff --git a/pandora_console/general/first_task/planned_downtime.php b/pandora_console/general/first_task/planned_downtime.php index 7a3e323dc4..6bfbe5627b 100644 --- a/pandora_console/general/first_task/planned_downtime.php +++ b/pandora_console/general/first_task/planned_downtime.php @@ -15,14 +15,14 @@ global $config; check_login(); ui_require_css_file('first_task'); ?> - true, 'message' => __('There are no planned downtime defined yet.') ]); ?> + true, 'message' => __('There are no scheduled downtime defined yet.') ]); ?>
- __('Planned Downtime')]); ?> + __('Scehduled Downtime')]); ?>
-

+

- +
diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 9a5e4168b4..5a45058c58 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -88,7 +88,6 @@ if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'LM') || check_acl($config['id_user'], 0, 'UM') || check_acl($config['id_user'], 0, 'LW') - || check_acl($config['id_user'], 0, 'IW') || check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'DW') ) { diff --git a/pandora_console/godmode/agentes/agent_incidents.php b/pandora_console/godmode/agentes/agent_incidents.php index 16cdd9370c..3917c2f81a 100644 --- a/pandora_console/godmode/agentes/agent_incidents.php +++ b/pandora_console/godmode/agentes/agent_incidents.php @@ -39,7 +39,7 @@ $offset = (int) get_parameter('offset', 0); // See if id_agente is set (either POST or GET, otherwise -1 $id_agent = (int) get_parameter('id_agente'); -$groups = users_get_groups($config['id_user'], 'IR'); +$groups = users_get_groups($config['id_user'], 'AR'); $filter = ' AND id_agent = '.$id_agent; $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agent; @@ -55,7 +55,7 @@ $params = [ agents_get_name($id_agent), ]; -$result = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incidents', $params, false, 'json', ','); +$result = integria_api_call(null, null, null, null, 'get_incidents', $params, false, 'json', ','); $result = json_decode($result, true); diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index bc8d247994..d486be0e7b 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -1004,9 +1004,9 @@ echo '
"; + echo ""; } else { - echo ""; + echo "