diff --git a/extras/Dockerfile b/extras/Dockerfile index fcd39254fb..8f27c730b8 100644 --- a/extras/Dockerfile +++ b/extras/Dockerfile @@ -1,3 +1,4 @@ +# Dockerfile for the Pandora FMS image. FROM debian:jessie # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added diff --git a/extras/chrome_extension/manifest.json b/extras/chrome_extension/manifest.json index 662eaf24ee..85e62c1f13 100644 --- a/extras/chrome_extension/manifest.json +++ b/extras/chrome_extension/manifest.json @@ -1,14 +1,14 @@ { "name": "__MSG_name__", - "version": "1.0", + "version": "2.0", "manifest_version": 2, - "description": "__MSG_description__", + "description": "Pandora FMS Event viewer Chrome extension", "homepage_url": "http://pandorafms.com", "browser_action": { "default_title": "__MSG_default_title__", "default_icon": "images/icon.png", "default_popup": "popup.html" - }, + }, "background": { "page": "background.html" }, diff --git a/extras/docker/Dockerfile b/extras/docker/Dockerfile new file mode 100644 index 0000000000..5ffe12f2d5 --- /dev/null +++ b/extras/docker/Dockerfile @@ -0,0 +1,50 @@ +FROM pandorafms/pandorafms-base + +# Build variables. +ARG BRANCH=develop +ARG DB_PASS=pandora + +# Clone the Pandora FMS repo. +RUN git clone --depth 1 -b "$BRANCH" https://github.com/pandorafms/pandorafms.git /tmp/pandorafms + +# Install the Pandora FMS Server. +RUN cd /tmp/pandorafms/pandora_server && \ +yes | ./pandora_server_installer --install && \ +sed -i "s/^dbuser.*/dbuser root/" /etc/pandora/pandora_server.conf && \ +sed -i "s/^dbpass.*/dbpass $DB_PASS/" /etc/pandora/pandora_server.conf + +# Install the Pandora FMS Agent. +RUN cd /tmp/pandorafms/pandora_agents/unix && \ +./pandora_agent_installer --install + +# Set the server's name in Apache's configuration file to avoid warnings. +RUN sed -i "s/#ServerName.*/ServerName localhost:80/" /etc/httpd/conf/httpd.conf + +# Install the Pandora FMS Console. +RUN service mysqld start && \ +/usr/bin/mysqladmin -u root password "$DB_PASS" && \ +service httpd start && \ +cp -r /tmp/pandorafms/pandora_console /var/www/html && \ +chown -R apache.apache /var/www/html/pandora_console/ && \ +python /tmp/pandorafms/tests/install_console.py + +# Redirect HTTP requests to / to the Pandora FMS Console. +RUN echo '' > /var/www/html/index.html + +# Create the entrypoint script. +RUN echo -e '#/bin/bash\n \ +service mysqld start &&\n \ +service httpd start &&\n \ +service crond start &&\n \ +/etc/init.d/pandora_agent_daemon start && \ +/etc/init.d/pandora_server start && \ +tail -f /var/log/pandora/pandora_server.log' \ +>> /entrypoint.sh && \ +chmod +x /entrypoint.sh + +# Clean-up. +RUN rm -rf /tmp/pandorafms +RUN yum clean all + +EXPOSE 80 3306 41121 +ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] diff --git a/extras/docker/build_and_push.sh b/extras/docker/build_and_push.sh new file mode 100755 index 0000000000..980087cfe5 --- /dev/null +++ b/extras/docker/build_and_push.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker build --rm=true --build-arg BRANCH="develop" --build-arg DB_PASS="pandora" -t pandorafms/pandorafms:7 . && \ +docker push pandorafms/pandorafms:7 diff --git a/extras/pandora_update_version.sh b/extras/pandora_update_version.sh index 2b77dd8e02..1953c7c834 100755 --- a/extras/pandora_update_version.sh +++ b/extras/pandora_update_version.sh @@ -56,6 +56,7 @@ 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_plugins/NGINX/nginx_requests_queued.pl \ $PANDHOME_ENT/pandora_plugins/Sybase/sybase_plugin.pl \ +$PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \ $PANDHOME_ENT/pandora_plugins/MarkLogic/pandora_marklogic.pl \ $PANDHOME_ENT/pandora_plugins/Apache/pandora_apache.pl \ $PANDHOME_ENT/pandora_plugins/Oracle/Database/pandora_oracle.pl \ @@ -65,7 +66,10 @@ $PANDHOME_ENT/pandora_plugins/MTL/pandora_mtl.pl \ $PANDHOME_ENT/pandora_plugins/Informix/informix.pl \ $PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl \ $PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \ -$PANDHOME_ENT/pandora_server/util/plugins/vmware-plugin.pl " +$PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \ +$PANDHOME_ENT/pandora_plugins/SNMP/dynamic_snmp.pl \ +$PANDHOME_ENT/pandora_plugins/MySQL/pandora_mysql.pl \ +$PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl " PLUGIN_LIB_FILE="$CODEHOME/pandora_server/lib/PandoraFMS/PluginTools.pm" # Update version in spec files diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index 02fd3c957c..eb20b095f1 100644 --- a/pandora_agents/pc/AIX/pandora_agent.conf +++ b/pandora_agents/pc/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, AIX version +# Version 7.0NG.723, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index 628da69b4b..93b3cdb927 100644 --- a/pandora_agents/pc/FreeBSD/pandora_agent.conf +++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, FreeBSD Version +# Version 7.0NG.723, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf index e11e409af7..41d482d6d3 100644 --- a/pandora_agents/pc/HP-UX/pandora_agent.conf +++ b/pandora_agents/pc/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, HP-UX Version +# Version 7.0NG.723, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index 965f1f6f34..534718ad29 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.723, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf index 3654c93f80..e4d585a062 100644 --- a/pandora_agents/pc/NT4/pandora_agent.conf +++ b/pandora_agents/pc/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.723, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf index bdc4b70c3c..ddce174eed 100644 --- a/pandora_agents/pc/SunOS/pandora_agent.conf +++ b/pandora_agents/pc/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, Solaris Version +# Version 7.0NG.723, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index 2a179f1c6d..1b3ea967ac 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2010 Artica Soluciones Tecnologicas -# Version 7.0NG.719 +# Version 7.0NG.723 # 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/pc/Win32/util/tentacle_server.exe b/pandora_agents/pc/Win32/util/tentacle_server.exe index fc0522d9b0..a1b10c214f 100644 Binary files a/pandora_agents/pc/Win32/util/tentacle_server.exe and b/pandora_agents/pc/Win32/util/tentacle_server.exe differ diff --git a/pandora_agents/pc/tentacle_server b/pandora_agents/pc/tentacle_server index 283324b5ff..d6b5d4d3bd 100755 --- a/pandora_agents/pc/tentacle_server +++ b/pandora_agents/pc/tentacle_server @@ -102,7 +102,7 @@ my $SERVICE_NAME="Tentacle Server"; my $SERVICE_PARAMS=join(' ', @ARGV); # Program version -our $VERSION = '0.6.1'; +our $VERSION = '0.6.2'; # IPv4 address to listen on my @t_addresses = ('0', '0.0.0.0'); @@ -217,6 +217,7 @@ sub print_help { print ("\t-d\t\tRun as daemon.\n"); print ("\t-e cert\t\tOpenSSL certificate file. Enables SSL.\n"); print ("\t-f ca_cert\tVerify that the peer certificate is signed by a ca.\n"); + print ("\t-F config_file\tConfiguration file full path.\n"); print ("\t-h\t\tShow help.\n"); print ("\t-I\t\tEnable insecure operations (file listing and moving).\n"); print ("\t-i\t\tFilters.\n"); @@ -278,11 +279,13 @@ sub daemonize { ################################################################################ sub parse_options { my %opts; + my $CONF = {}; + my $token_value; my $tmp; my @t_addresses_tmp; # Get options - if (getopts ('a:b:c:de:f:g:hIi:k:l:m:op:qr:s:S:t:TvVwx:', \%opts) == 0 || defined ($opts{'h'})) { + if (getopts ('a:b:c:de:f:F:g:hIi:k:l:m:op:qr:s:S:t:TvVwx:', \%opts) == 0 || defined ($opts{'h'})) { print_help (); exit 1; } @@ -304,10 +307,16 @@ sub parse_options { } } + # Configuration file + if (defined($opts{'F'})) { + parse_config_file($opts{'F'}, $CONF); + } + # Address - if (defined ($opts{'a'})) { + $token_value = get_config_value($opts{'a'}, $CONF->{'addresses'}); + if (defined ($token_value)) { @t_addresses = (); - @t_addresses_tmp = split(/,/, $opts{'a'}); + @t_addresses_tmp = split(/,/, $token_value); foreach my $t_address (@t_addresses_tmp) { $t_address =~ s/^ *(.*?) *$/$1/; @@ -323,15 +332,17 @@ sub parse_options { } # Maximum simultaneous connections - if (defined ($opts{'c'})) { - $t_max_conn = $opts{'c'}; + $token_value = get_config_value($opts{'c'}, $CONF->{'max_connections'}); + if (defined ($token_value)) { + $t_max_conn = $token_value; if ($t_max_conn !~ /^\d+$/ || $t_max_conn < 1) { error ("Invalid number of maximum simultaneous connections."); } } # Run as daemon - if (defined ($opts{'d'})) { + $token_value = get_config_value($opts{'d'}, $CONF->{'daemon'}, 1); + if (defined ($token_value)) { if ($^ eq 'MSWin32') { error ("-d flag not available for this OS."); } @@ -340,11 +351,12 @@ sub parse_options { } # Enable SSL - if (defined ($opts{'e'})) { + $token_value = get_config_value($opts{'e'}, $CONF->{'ssl_cert'}); + if (defined ($token_value)) { require IO::Socket::SSL; - $t_ssl_cert = $opts{'e'}; + $t_ssl_cert = $token_value; if (! -f $t_ssl_cert) { error ("File $t_ssl_cert does not exist."); } @@ -353,21 +365,24 @@ sub parse_options { } # Verify peer certificate - if (defined ($opts{'f'})) { - $t_ssl_ca = $opts{'f'}; + $token_value = get_config_value($opts{'f'}, $CONF->{'ssl_ca'}); + if (defined ($token_value)) { + $t_ssl_ca = $token_value; if (! -f $t_ssl_ca) { error ("File $t_ssl_ca does not exist."); } } # Insecure mode - if (defined ($opts{'I'})) { + $token_value = get_config_value($opts{'I'}, $CONF->{'insecure'}, 1); + if (defined ($token_value)) { $t_insecure = 1; } # Filters (regexp:dir;regexp:dir...) - if (defined ($opts{'i'})) { - my @filters = split (';', $opts{'i'}); + $token_value = get_config_value($opts{'i'}, $CONF->{'filters'}); + if (defined ($token_value)) { + my @filters = split (';', $token_value); foreach my $filter (@filters) { my ($regexp, $dir) = split (':', $filter); next unless defined ($regexp) && defined ($dir); @@ -381,51 +396,58 @@ sub parse_options { } # SSL private key file - if (defined ($opts{'k'})) { - $t_ssl_key = $opts{'k'}; + $token_value = get_config_value($opts{'k'}, $CONF->{'ssl_key'}); + if (defined ($token_value)) { + $t_ssl_key = $token_value; if (! -f $t_ssl_key) { error ("File $t_ssl_key does not exist."); } } # Maximum file size - if (defined ($opts{'m'})) { - $t_max_size = $opts{'m'}; + $token_value = get_config_value($opts{'m'}, $CONF->{'max_size'}); + if (defined ($token_value)) { + $t_max_size = $token_value; if ($t_max_size !~ /^\d+$/ || $t_max_size < 1) { error ("Invalid maximum file size."); } } # File overwrite - if (defined ($opts{'o'})) { + $token_value = get_config_value($opts{'o'}, $CONF->{'overwrite'}, 1); + if (defined ($token_value)) { $t_overwrite = 1; } # Port - if (defined ($opts{'p'})) { - $t_port = $opts{'p'}; + $token_value = get_config_value($opts{'p'}, $CONF->{'port'}); + if (defined ($token_value)) { + $t_port = $token_value; if ($t_port !~ /^\d+$/ || $t_port < 1 || $t_port > 65535) { error ("Port $t_port is not valid."); } } # Quiet mode - if (defined ($opts{'q'})) { + $token_value = get_config_value($opts{'q'}, $CONF->{'quiet'}, 1); + if (defined ($token_value)) { $t_quiet = 1; } # Retries - if (defined ($opts{'r'})) { - $t_retries = $opts{'r'}; + $token_value = get_config_value($opts{'r'}, $CONF->{'retries'}); + if (defined ($token_value)) { + $t_retries = $token_value; if ($t_retries !~ /^\d+$/ || $t_retries < 1) { error ("Invalid number of retries for network operations."); } } # Storage directory - if (defined ($opts{'s'})) { + $token_value = get_config_value($opts{'s'}, $CONF->{'directory'}); + if (defined ($token_value)) { - $t_directory = $opts{'s'}; + $t_directory = $token_value; # Check that directory exists if (! -d $t_directory) { @@ -444,25 +466,36 @@ sub parse_options { } } else { - if (! defined($opts{'b'})) { + $token_value = get_config_value($opts{'b'}, $CONF->{'proxy_ip'}); + if (! defined($token_value)) { print_help (); exit 1; } } # Timeout - if (defined ($opts{'t'})) { - $t_timeout = $opts{'t'}; + $token_value = get_config_value($opts{'t'}, $CONF->{'timeout'}); + if (defined ($token_value)) { + $t_timeout = $token_value; if ($t_timeout !~ /^\d+$/ || $t_timeout < 1) { error ("Invalid timeout for network operations."); } } + # Read verbose from config file + if (defined($CONF->{'verbose'})) { + if ($CONF->{'verbose'} eq "1") { + $t_log = 1; + } elsif ($CONF->{'verbose'} eq "2") { + $t_log = 1; + $t_log_hard = 1; + } + } # Be verbose if (defined ($opts{'v'})) { $t_log = 1; + $t_log_hard = 0; } - # Be verbose hard if (defined ($opts{'V'})) { $t_log = 1; @@ -470,18 +503,21 @@ sub parse_options { } # SSL private key password - if (defined ($opts{'w'})) { + $token_value = get_config_value($opts{'w'}, $CONF->{'ssl_password'}, 1); + if (defined ($token_value)) { $t_ssl_pwd = ask_passwd ("Enter private key file password: ", "Enter private key file password again for confirmation: "); } # Server password - if (defined ($opts{'x'})) { - $t_pwd = $opts{'x'}; + $token_value = get_config_value($opts{'x'}, $CONF->{'password'}); + if (defined ($token_value)) { + $t_pwd = $token_value; } #Proxy IP address - if (defined ($opts{'b'})) { - $t_proxy_ip = $opts{'b'}; + $token_value = get_config_value($opts{'b'}, $CONF->{'proxy_ip'}); + if (defined ($token_value)) { + $t_proxy_ip = $token_value; if ($t_proxy_ip !~ /^[a-zA-Z\.]+$/ && ($t_proxy_ip !~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ || $1 < 0 || $1 > 255 || $2 < 0 || $2 > 255 || $3 < 0 || $3 > 255 || $4 < 0 || $4 > 255) && @@ -491,15 +527,17 @@ sub parse_options { } # Proxy Port - if (defined ($opts{'g'})) { - $t_proxy_port = $opts{'g'}; + $token_value = get_config_value($opts{'g'}, $CONF->{'proxy_port'}); + if (defined ($token_value)) { + $t_proxy_port = $token_value; if ($t_proxy_port !~ /^\d+$/ || $t_proxy_port < 1 || $t_proxy_port > 65535) { error ("Proxy port $t_port is not valid."); } } # TCP wrappers support - if (defined ($opts{'T'})) { + $token_value = get_config_value($opts{'T'}, $CONF->{'use_libwrap'}, 1); + if (defined ($token_value)) { if ($t_libwrap_installed) { $t_use_libwrap = 1; } else { @@ -531,9 +569,76 @@ sub parse_options { } # Get the config file - if (defined ($opts{'l'})) { - $log_file = $opts{'l'}; + $token_value = get_config_value($opts{'l'}, $CONF->{'log_file'}); + if (defined ($token_value)) { + $log_file = $token_value; } + + # No command lines config values + + # Get the block size + if (defined ($CONF->{'block_size'})) { + if ($t_port !~ /^\d+$/ || $t_port < 1) { + error ("Invalid block size: " . $CONF->{'block_size'} . "."); + } + $t_block_size = $CONF->{'block_size'}; + } + + # Configuration file invalid chars + if (defined ($CONF->{'invalid_chars'})) { + $t_invalid_chars = $CONF->{'invalid_chars'}; + } +} + +################################################################################ +## SUB parse_config_file +## Get all options from a config file. +################################################################################ +sub parse_config_file { + my ($config_file, $CONF) = @_; + + # File should be writable + if (! -r $config_file) { + print "Configuration file $config_file is not readable.\n"; + return; + } + + # Open the file + my $FH; + if (! open ($FH, "< $config_file")) { + print "Cannot open configuration file $config_file.\n"; + return; + } + + # Read the file and only get the well formed lines + while (<$FH>) { + my $buffer_line = $_; + if ($buffer_line =~ /^[a-zA-Z]/){ # begins with letters + if ($buffer_line =~ m/([\w\-\_\.]+)\s+(.*)/){ + $CONF->{$1} = $2 unless $2 eq ""; + } + } + } + + close ($FH); + return; +} + +################################################################################ +## SUB parse_config_file +## Search in command line options and config hash from configuration file +## to get a value (command line is a priority) +################################################################################ +sub get_config_value { + my ($cmd_value, $conf_value, $bool) = @_; + $bool = 0 unless defined($bool); + + return $cmd_value if defined($cmd_value); + # The boolean type value is 1 or undef (0 should be translated like undefP) + if ($bool && defined($conf_value)) { + return undef if ($conf_value ne "1"); + } + return $conf_value; } ################################################################################ @@ -929,14 +1034,14 @@ sub recv_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (invalid file name)\n"); return; } # Check file size, empty files are not allowed if ($size < 1 || $size > $t_max_size) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " is too big"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file is too big)\n"); return; } @@ -946,7 +1051,7 @@ sub recv_file { # Check if file exists if (-f $file && $t_overwrite == 0) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " already exists"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file already exists)\n"); return; } @@ -979,7 +1084,7 @@ sub send_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("Requested file '$base_name' from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file has an invalid file name)\n"); return; } @@ -989,7 +1094,7 @@ sub send_file { # Check if file exists if (! -f $file) { print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " does not exist"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file does not exist)\n"); return; } diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf index c95b70a58d..0d6558aa12 100644 --- a/pandora_agents/shellscript/aix/pandora_agent.conf +++ b/pandora_agents/shellscript/aix/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.719, AIX version +# Version 7.0NG.723, AIX version # General Parameters # ================== diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf index ce6d91f8ab..7478d64f27 100644 --- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf +++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.719 +# Version 7.0NG.723 # FreeBSD/IPSO version # Licenced under GPL licence, 2003-2007 Sancho Lerena diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf index 483c8728bd..4f3694a530 100644 --- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf +++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.719, HPUX Version +# Version 7.0NG.723, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index b47b7b0ef2..374a998426 100644 --- a/pandora_agents/shellscript/linux/pandora_agent.conf +++ b/pandora_agents/shellscript/linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719 +# Version 7.0NG.723 # Licensed under GPL license v2, # (c) 2003-2010 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf index 993be45b74..3de4952d24 100644 --- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf +++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719 +# Version 7.0NG.723 # Licensed under GPL license v2, # (c) 2003-2009 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf index 0f703a7387..8cfc4f51aa 100644 --- a/pandora_agents/shellscript/openWRT/pandora_agent.conf +++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719 +# Version 7.0NG.723 # Licensed under GPL license v2, # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf index c0439c7b96..d962b005e4 100644 --- a/pandora_agents/shellscript/solaris/pandora_agent.conf +++ b/pandora_agents/shellscript/solaris/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.719, Solaris version +# Version 7.0NG.723, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 0c7bbcef39..6fb838938d 100644 --- a/pandora_agents/unix/AIX/pandora_agent.conf +++ b/pandora_agents/unix/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, AIX version +# Version 7.0NG.723, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com @@ -102,6 +102,9 @@ transfer_mode tentacle # Agent mode: Learn (default), No-learn, Autodisable # agent_mode autodisable +# Secondary groups. You can select several groups separated by comma. +# secondary_groups Group1,Group2 + # Secondary server configuration # ============================== diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index cb9d4332f2..82567e4815 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.719-180302 +Version: 7.0NG.723-180530 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 39a79290f5..492bd7e87e 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.719-180302" +pandora_version="7.0NG.723-180530" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 07a8fa36ce..2a03683bd8 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.723, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # http://www.pandorafms.com @@ -143,6 +143,9 @@ transfer_mode tentacle # Agent mode: Learn (default), No-learn, Autodisable # agent_mode autodisable +# Secondary groups. You can select several groups separated by comma. +# secondary_groups Group1,Group2 + # Secondary server configuration # ============================== diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf index 40212d2098..c1eb8072e6 100644 --- a/pandora_agents/unix/FreeBSD/pandora_agent.conf +++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, FreeBSD Version +# Version 7.0NG.723, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # http://www.pandorafms.com @@ -153,6 +153,9 @@ xml_buffer 1 # Minimum available bytes in the temporal directory to enable the XML buffer temporal_min_size 1024 +# Secondary groups. You can select several groups separated by comma. +# secondary_groups Group1,Group2 + #Secondary server configuration #============================== diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf index 04c521b395..3cf05b23eb 100644 --- a/pandora_agents/unix/HP-UX/pandora_agent.conf +++ b/pandora_agents/unix/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, HP-UX Version +# Version 7.0NG.723, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com @@ -104,6 +104,9 @@ transfer_mode tentacle # Agent mode: Learn (default), No-learn, Autodisable # agent_mode autodisable +# Secondary groups. You can select several groups separated by comma. +# secondary_groups Group1,Group2 + # Secondary server configuration # ============================== diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index fda0d82f2d..607bdc9d3c 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.723, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # http://www.pandorafms.com @@ -167,6 +167,9 @@ temporal_min_size 1024 # the eHorus agent's identifying key ehorus_conf /etc/ehorus/ehorus_agent.conf +# Secondary groups. You can select several groups separated by comma. +# secondary_groups Group1,Group2 + # Secondary server configuration # ============================== diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf index de203fa85c..846ced852c 100644 --- a/pandora_agents/unix/NT4/pandora_agent.conf +++ b/pandora_agents/unix/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, GNU/Linux +# Version 7.0NG.723, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf index bca26835ce..d67e9bd6c3 100644 --- a/pandora_agents/unix/NetBSD/pandora_agent.conf +++ b/pandora_agents/unix/NetBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, NetBSD Version +# Version 7.0NG.723, NetBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com @@ -116,6 +116,9 @@ transfer_mode tentacle # Agent mode: Learn (default), No-learn, Autodisable # agent_mode autodisable +# Secondary groups. You can select several groups separated by comma. +# secondary_groups Group1,Group2 + # Secondary server configuration # ============================== diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf index f7f6d4f192..b6197225dd 100644 --- a/pandora_agents/unix/SunOS/pandora_agent.conf +++ b/pandora_agents/unix/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.719, Solaris Version +# Version 7.0NG.723, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com @@ -107,6 +107,9 @@ transfer_mode tentacle # Agent mode: Learn (default), No-learn, Autodisable # agent_mode autodisable +# Secondary groups. You can select several groups separated by comma. +# secondary_groups Group1,Group2 + # Secondary server configuration # ============================== diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 41fe2e3152..0ea0e01bd1 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,8 +41,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.719'; -use constant AGENT_BUILD => '180302'; +use constant AGENT_VERSION => '7.0NG.723'; +use constant AGENT_BUILD => '180530'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; @@ -3065,7 +3065,11 @@ while (1) { if (defined ($Conf{'parent_agent_name'})) { $xml_header .= "' parent_agent_name='" .$Conf{'parent_agent_name'}; } - + + if (defined ($Conf{'secondary_groups'})) { + $xml_header .= "' secondary_groups='" .$Conf{'secondary_groups'}; + } + if (defined ($Conf{'agent_mode'})) { if ($Conf{'agent_mode'} =~ m/no.?learn/ig) { $xml_header .= "' agent_mode='0"; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 59a33164ce..6f080ae29c 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.719 -%define release 180302 +%define version 7.0NG.723 +%define release 180530 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index d2f6d674aa..34bf115ae1 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.719 -%define release 180302 +%define version 7.0NG.723 +%define release 180530 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 375238a319..f58de6f228 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -9,8 +9,8 @@ # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.719" -PI_BUILD="180302" +PI_VERSION="7.0NG.723" +PI_BUILD="180530" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/unix/plugins/grep_log_module b/pandora_agents/unix/plugins/grep_log_module index 0769128cbd..6fc1cff239 100755 --- a/pandora_agents/unix/plugins/grep_log_module +++ b/pandora_agents/unix/plugins/grep_log_module @@ -215,6 +215,7 @@ sub print_log (@) { $output .= "\n"; $output .= ""; @@ -229,6 +230,7 @@ sub print_log (@) { $output .= "\n"; $output .= "\n"; foreach my $line (@data) { + $line =~ s/\]\]/]]]]>\n"; } $output .= "\n"; diff --git a/pandora_agents/unix/plugins/inventory b/pandora_agents/unix/plugins/inventory index 3a32366be6..a6d9a8bc83 100755 --- a/pandora_agents/unix/plugins/inventory +++ b/pandora_agents/unix/plugins/inventory @@ -201,6 +201,8 @@ sub get_software_module_data ($$) { $module{'program'} =~ s/;/,/g; $module{'version'} =~ s/;/,/g; $module{'description'} =~ s/;/,/g; + # Replace ellipsis character to avoid encoding errors + $module{'description'} =~ s/…/.../g; $module{'_keys'} = ['program', 'version','description']; push (@{$modules->{$name}}, \%module); } diff --git a/pandora_agents/unix/tentacle_server b/pandora_agents/unix/tentacle_server index 283324b5ff..d6b5d4d3bd 100755 --- a/pandora_agents/unix/tentacle_server +++ b/pandora_agents/unix/tentacle_server @@ -102,7 +102,7 @@ my $SERVICE_NAME="Tentacle Server"; my $SERVICE_PARAMS=join(' ', @ARGV); # Program version -our $VERSION = '0.6.1'; +our $VERSION = '0.6.2'; # IPv4 address to listen on my @t_addresses = ('0', '0.0.0.0'); @@ -217,6 +217,7 @@ sub print_help { print ("\t-d\t\tRun as daemon.\n"); print ("\t-e cert\t\tOpenSSL certificate file. Enables SSL.\n"); print ("\t-f ca_cert\tVerify that the peer certificate is signed by a ca.\n"); + print ("\t-F config_file\tConfiguration file full path.\n"); print ("\t-h\t\tShow help.\n"); print ("\t-I\t\tEnable insecure operations (file listing and moving).\n"); print ("\t-i\t\tFilters.\n"); @@ -278,11 +279,13 @@ sub daemonize { ################################################################################ sub parse_options { my %opts; + my $CONF = {}; + my $token_value; my $tmp; my @t_addresses_tmp; # Get options - if (getopts ('a:b:c:de:f:g:hIi:k:l:m:op:qr:s:S:t:TvVwx:', \%opts) == 0 || defined ($opts{'h'})) { + if (getopts ('a:b:c:de:f:F:g:hIi:k:l:m:op:qr:s:S:t:TvVwx:', \%opts) == 0 || defined ($opts{'h'})) { print_help (); exit 1; } @@ -304,10 +307,16 @@ sub parse_options { } } + # Configuration file + if (defined($opts{'F'})) { + parse_config_file($opts{'F'}, $CONF); + } + # Address - if (defined ($opts{'a'})) { + $token_value = get_config_value($opts{'a'}, $CONF->{'addresses'}); + if (defined ($token_value)) { @t_addresses = (); - @t_addresses_tmp = split(/,/, $opts{'a'}); + @t_addresses_tmp = split(/,/, $token_value); foreach my $t_address (@t_addresses_tmp) { $t_address =~ s/^ *(.*?) *$/$1/; @@ -323,15 +332,17 @@ sub parse_options { } # Maximum simultaneous connections - if (defined ($opts{'c'})) { - $t_max_conn = $opts{'c'}; + $token_value = get_config_value($opts{'c'}, $CONF->{'max_connections'}); + if (defined ($token_value)) { + $t_max_conn = $token_value; if ($t_max_conn !~ /^\d+$/ || $t_max_conn < 1) { error ("Invalid number of maximum simultaneous connections."); } } # Run as daemon - if (defined ($opts{'d'})) { + $token_value = get_config_value($opts{'d'}, $CONF->{'daemon'}, 1); + if (defined ($token_value)) { if ($^ eq 'MSWin32') { error ("-d flag not available for this OS."); } @@ -340,11 +351,12 @@ sub parse_options { } # Enable SSL - if (defined ($opts{'e'})) { + $token_value = get_config_value($opts{'e'}, $CONF->{'ssl_cert'}); + if (defined ($token_value)) { require IO::Socket::SSL; - $t_ssl_cert = $opts{'e'}; + $t_ssl_cert = $token_value; if (! -f $t_ssl_cert) { error ("File $t_ssl_cert does not exist."); } @@ -353,21 +365,24 @@ sub parse_options { } # Verify peer certificate - if (defined ($opts{'f'})) { - $t_ssl_ca = $opts{'f'}; + $token_value = get_config_value($opts{'f'}, $CONF->{'ssl_ca'}); + if (defined ($token_value)) { + $t_ssl_ca = $token_value; if (! -f $t_ssl_ca) { error ("File $t_ssl_ca does not exist."); } } # Insecure mode - if (defined ($opts{'I'})) { + $token_value = get_config_value($opts{'I'}, $CONF->{'insecure'}, 1); + if (defined ($token_value)) { $t_insecure = 1; } # Filters (regexp:dir;regexp:dir...) - if (defined ($opts{'i'})) { - my @filters = split (';', $opts{'i'}); + $token_value = get_config_value($opts{'i'}, $CONF->{'filters'}); + if (defined ($token_value)) { + my @filters = split (';', $token_value); foreach my $filter (@filters) { my ($regexp, $dir) = split (':', $filter); next unless defined ($regexp) && defined ($dir); @@ -381,51 +396,58 @@ sub parse_options { } # SSL private key file - if (defined ($opts{'k'})) { - $t_ssl_key = $opts{'k'}; + $token_value = get_config_value($opts{'k'}, $CONF->{'ssl_key'}); + if (defined ($token_value)) { + $t_ssl_key = $token_value; if (! -f $t_ssl_key) { error ("File $t_ssl_key does not exist."); } } # Maximum file size - if (defined ($opts{'m'})) { - $t_max_size = $opts{'m'}; + $token_value = get_config_value($opts{'m'}, $CONF->{'max_size'}); + if (defined ($token_value)) { + $t_max_size = $token_value; if ($t_max_size !~ /^\d+$/ || $t_max_size < 1) { error ("Invalid maximum file size."); } } # File overwrite - if (defined ($opts{'o'})) { + $token_value = get_config_value($opts{'o'}, $CONF->{'overwrite'}, 1); + if (defined ($token_value)) { $t_overwrite = 1; } # Port - if (defined ($opts{'p'})) { - $t_port = $opts{'p'}; + $token_value = get_config_value($opts{'p'}, $CONF->{'port'}); + if (defined ($token_value)) { + $t_port = $token_value; if ($t_port !~ /^\d+$/ || $t_port < 1 || $t_port > 65535) { error ("Port $t_port is not valid."); } } # Quiet mode - if (defined ($opts{'q'})) { + $token_value = get_config_value($opts{'q'}, $CONF->{'quiet'}, 1); + if (defined ($token_value)) { $t_quiet = 1; } # Retries - if (defined ($opts{'r'})) { - $t_retries = $opts{'r'}; + $token_value = get_config_value($opts{'r'}, $CONF->{'retries'}); + if (defined ($token_value)) { + $t_retries = $token_value; if ($t_retries !~ /^\d+$/ || $t_retries < 1) { error ("Invalid number of retries for network operations."); } } # Storage directory - if (defined ($opts{'s'})) { + $token_value = get_config_value($opts{'s'}, $CONF->{'directory'}); + if (defined ($token_value)) { - $t_directory = $opts{'s'}; + $t_directory = $token_value; # Check that directory exists if (! -d $t_directory) { @@ -444,25 +466,36 @@ sub parse_options { } } else { - if (! defined($opts{'b'})) { + $token_value = get_config_value($opts{'b'}, $CONF->{'proxy_ip'}); + if (! defined($token_value)) { print_help (); exit 1; } } # Timeout - if (defined ($opts{'t'})) { - $t_timeout = $opts{'t'}; + $token_value = get_config_value($opts{'t'}, $CONF->{'timeout'}); + if (defined ($token_value)) { + $t_timeout = $token_value; if ($t_timeout !~ /^\d+$/ || $t_timeout < 1) { error ("Invalid timeout for network operations."); } } + # Read verbose from config file + if (defined($CONF->{'verbose'})) { + if ($CONF->{'verbose'} eq "1") { + $t_log = 1; + } elsif ($CONF->{'verbose'} eq "2") { + $t_log = 1; + $t_log_hard = 1; + } + } # Be verbose if (defined ($opts{'v'})) { $t_log = 1; + $t_log_hard = 0; } - # Be verbose hard if (defined ($opts{'V'})) { $t_log = 1; @@ -470,18 +503,21 @@ sub parse_options { } # SSL private key password - if (defined ($opts{'w'})) { + $token_value = get_config_value($opts{'w'}, $CONF->{'ssl_password'}, 1); + if (defined ($token_value)) { $t_ssl_pwd = ask_passwd ("Enter private key file password: ", "Enter private key file password again for confirmation: "); } # Server password - if (defined ($opts{'x'})) { - $t_pwd = $opts{'x'}; + $token_value = get_config_value($opts{'x'}, $CONF->{'password'}); + if (defined ($token_value)) { + $t_pwd = $token_value; } #Proxy IP address - if (defined ($opts{'b'})) { - $t_proxy_ip = $opts{'b'}; + $token_value = get_config_value($opts{'b'}, $CONF->{'proxy_ip'}); + if (defined ($token_value)) { + $t_proxy_ip = $token_value; if ($t_proxy_ip !~ /^[a-zA-Z\.]+$/ && ($t_proxy_ip !~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ || $1 < 0 || $1 > 255 || $2 < 0 || $2 > 255 || $3 < 0 || $3 > 255 || $4 < 0 || $4 > 255) && @@ -491,15 +527,17 @@ sub parse_options { } # Proxy Port - if (defined ($opts{'g'})) { - $t_proxy_port = $opts{'g'}; + $token_value = get_config_value($opts{'g'}, $CONF->{'proxy_port'}); + if (defined ($token_value)) { + $t_proxy_port = $token_value; if ($t_proxy_port !~ /^\d+$/ || $t_proxy_port < 1 || $t_proxy_port > 65535) { error ("Proxy port $t_port is not valid."); } } # TCP wrappers support - if (defined ($opts{'T'})) { + $token_value = get_config_value($opts{'T'}, $CONF->{'use_libwrap'}, 1); + if (defined ($token_value)) { if ($t_libwrap_installed) { $t_use_libwrap = 1; } else { @@ -531,9 +569,76 @@ sub parse_options { } # Get the config file - if (defined ($opts{'l'})) { - $log_file = $opts{'l'}; + $token_value = get_config_value($opts{'l'}, $CONF->{'log_file'}); + if (defined ($token_value)) { + $log_file = $token_value; } + + # No command lines config values + + # Get the block size + if (defined ($CONF->{'block_size'})) { + if ($t_port !~ /^\d+$/ || $t_port < 1) { + error ("Invalid block size: " . $CONF->{'block_size'} . "."); + } + $t_block_size = $CONF->{'block_size'}; + } + + # Configuration file invalid chars + if (defined ($CONF->{'invalid_chars'})) { + $t_invalid_chars = $CONF->{'invalid_chars'}; + } +} + +################################################################################ +## SUB parse_config_file +## Get all options from a config file. +################################################################################ +sub parse_config_file { + my ($config_file, $CONF) = @_; + + # File should be writable + if (! -r $config_file) { + print "Configuration file $config_file is not readable.\n"; + return; + } + + # Open the file + my $FH; + if (! open ($FH, "< $config_file")) { + print "Cannot open configuration file $config_file.\n"; + return; + } + + # Read the file and only get the well formed lines + while (<$FH>) { + my $buffer_line = $_; + if ($buffer_line =~ /^[a-zA-Z]/){ # begins with letters + if ($buffer_line =~ m/([\w\-\_\.]+)\s+(.*)/){ + $CONF->{$1} = $2 unless $2 eq ""; + } + } + } + + close ($FH); + return; +} + +################################################################################ +## SUB parse_config_file +## Search in command line options and config hash from configuration file +## to get a value (command line is a priority) +################################################################################ +sub get_config_value { + my ($cmd_value, $conf_value, $bool) = @_; + $bool = 0 unless defined($bool); + + return $cmd_value if defined($cmd_value); + # The boolean type value is 1 or undef (0 should be translated like undefP) + if ($bool && defined($conf_value)) { + return undef if ($conf_value ne "1"); + } + return $conf_value; } ################################################################################ @@ -929,14 +1034,14 @@ sub recv_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (invalid file name)\n"); return; } # Check file size, empty files are not allowed if ($size < 1 || $size > $t_max_size) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " is too big"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file is too big)\n"); return; } @@ -946,7 +1051,7 @@ sub recv_file { # Check if file exists if (-f $file && $t_overwrite == 0) { print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " already exists"); - send_data ("SEND ERR\n"); + send_data ("SEND ERR (file already exists)\n"); return; } @@ -979,7 +1084,7 @@ sub send_file { # Check file name if ($base_name =~ /[$t_invalid_chars]/) { print_log ("Requested file '$base_name' from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file has an invalid file name)\n"); return; } @@ -989,7 +1094,7 @@ sub send_file { # Check if file exists if (! -f $file) { print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " does not exist"); - send_data ("RECV ERR\n"); + send_data ("RECV ERR (file does not exist)\n"); return; } diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 77dc303572..70e1ae25f6 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2017 Artica Soluciones Tecnologicas -# Version 7.0NG.719 +# Version 7.0NG.723 # 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 @@ -104,6 +104,9 @@ xml_buffer 1 #It try to find the EKID and set it like a custom field. ehorus_conf "C:\Program Files\ehorus_agent\ehorus_agent.conf" +# Secondary groups. You can select several groups separated by comma. +# secondary_groups Group1,Group2 + # Secondary server configuration # ============================== diff --git a/pandora_agents/win32/bin/util/tentacle_server.exe b/pandora_agents/win32/bin/util/tentacle_server.exe index fc0522d9b0..a1b10c214f 100644 Binary files a/pandora_agents/win32/bin/util/tentacle_server.exe and b/pandora_agents/win32/bin/util/tentacle_server.exe differ diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8838c98cfa..029012417e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -3,7 +3,7 @@ AllowLanguageSelection {Yes} AppName -{Pandora FMS Windows Agent v7.0NG.719} +{Pandora FMS Windows Agent v7.0NG.723} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180302} +{180530} ViewReadme {Yes} diff --git a/pandora_agents/win32/modules/pandora_module.cc b/pandora_agents/win32/modules/pandora_module.cc index d7d5fb63c0..eac38c8fa1 100644 --- a/pandora_agents/win32/modules/pandora_module.cc +++ b/pandora_agents/win32/modules/pandora_module.cc @@ -532,6 +532,7 @@ Pandora_Module::getXml () { try { data_clean = strreplace (this->getDataOutput (data), "%", "%%" ); + data_clean = strreplace (data_clean, "]]>", "]]>front (); try { data_clean = strreplace (this->getDataOutput (data), "%", "%%" ); + data_clean = strreplace (data_clean, "]]>", "]]>getValue ("group") + "\" parent_agent_name=\"" + conf->getValue ("parent_agent_name") + + "\" secondary_groups=\"" + conf->getValue ("secondary_groups") + "\" agent_mode=\"" + agent_mode + "\">\n"; return xml; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index a422caf72d..d510659b2d 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.719(Build 180302))" + VALUE "ProductVersion", "(7.0NG.723(Build 180530))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DB_Dockerfile b/pandora_console/DB_Dockerfile index eb6465f6c1..5dec3b4f63 100644 --- a/pandora_console/DB_Dockerfile +++ b/pandora_console/DB_Dockerfile @@ -5,6 +5,7 @@ WORKDIR /pandorafms/pandora_console ADD pandoradb.sql /docker-entrypoint-initdb.d ADD pandoradb_data.sql /docker-entrypoint-initdb.d +RUN chown mysql /docker-entrypoint-initdb.d ENV MYSQL_DATABASE=pandora diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c3ebb69a11..ae06bada2a 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.719-180302 +Version: 7.0NG.723-180530 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 61bbda6f81..fc6b1872e3 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.719-180302" +pandora_version="7.0NG.723-180530" package_pear=0 package_pandora=1 diff --git a/pandora_console/Dockerfile b/pandora_console/Dockerfile index ccbcef4cdd..1bdf0363f0 100644 --- a/pandora_console/Dockerfile +++ b/pandora_console/Dockerfile @@ -45,13 +45,14 @@ RUN yum install -y \ php-zip \ nmap \ net-snmp-utils \ + mod_ssl \ xprobe2 #Clone the repo RUN git clone -b develop https://github.com/pandorafms/pandorafms.git /tmp/pandorafms #Exposing ports for: HTTP, SNMP Traps, Tentacle protocol -EXPOSE 80 162/udp 41121 +EXPOSE 80 162/udp 443 41121 # Simple startup script to avoid some issues observed with container restart ADD docker_entrypoint.sh /entrypoint.sh diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index 261babb5aa..b8b7481786 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -46,8 +46,19 @@ if (isset ($_GET["loginhash"])) { } } +$public_hash = get_parameter('hash', false); + // Check user -//check_login (); +if ($public_hash == false) { + check_login(); +} else { + enterprise_include_once('include/functions_dashboard.php'); + if (dashboard_check_public_hash($public_hash) === false) { + db_pandora_audit("Invalid public hash", "Trying to access public dashboard"); + require ("general/noaccess.php"); + exit; + } +} define ('AJAX', true); diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index f5cad20d74..ccc1539fdc 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -83,7 +83,7 @@ function mainAgentsAlerts() { } } - $refr = get_parameter('refr', 30); // By default 30 seconds + $refr = (int) get_parameter('refr', 30); // By default 30 seconds $show_modules = (bool) get_parameter ("show_modules",0); $group_id = get_parameter('group_id', 0); $offset = get_parameter('offset', 0); diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index da8f1c5550..98dacdc7e5 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -14,7 +14,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -$refr = get_parameter('refresh', 0); // By default 30 seconds +$refr = (int) get_parameter('refresh', 0); // By default 30 seconds function mainAgentsModules() { global $config; @@ -62,7 +62,7 @@ function mainAgentsModules() { $updated_time = $updated_info; $modulegroup = get_parameter('modulegroup', 0); - $refr = get_parameter('refresh', 0); // By default 30 seconds + $refr = (int) get_parameter('refresh', 0); // By default 30 seconds $recursion = get_parameter('recursion', 0); $group_id = (int)get_parameter('group_id', 0); diff --git a/pandora_console/extensions/api_checker.php b/pandora_console/extensions/api_checker.php index 6aecf21073..24f7bc31ed 100755 --- a/pandora_console/extensions/api_checker.php +++ b/pandora_console/extensions/api_checker.php @@ -101,7 +101,7 @@ function extension_api_checker() { $table->data[] = $row; $row = array(); - $row[] = __("Pandora Console URL"); + $row[] = __("%s Console URL", get_product_name()); $row[] = html_print_input_text('pandora_url', $pandora_url, '', 50, 255, true); $table->data[] = $row; diff --git a/pandora_console/extensions/db_status.php b/pandora_console/extensions/db_status.php index d184850a34..84cf67022d 100755 --- a/pandora_console/extensions/db_status.php +++ b/pandora_console/extensions/db_status.php @@ -180,10 +180,10 @@ function extension_db_check_tables_differences($connection_test, $diff_tables = array_diff($tables_test, $tables_system); ui_print_result_message( - empty($diff_tables), - __('Successful the DB Pandora has all tables'), - __('Pandora DB could not retrieve all tables. The missing tables are (%s)', - implode(", ", $diff_tables))); + !empty($diff_tables), + __('Success! %s DB contains all tables', get_product_name()), + __('%s DB could not retrieve all tables. The missing tables are (%s)', + get_product_name(), implode(", ", $diff_tables))); if (!empty($diff_tables)) { foreach ($diff_tables as $table) { diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index 114c3bf709..4bcaeac702 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -134,7 +134,13 @@ function dbmgr_extension_main () { ui_print_page_header (__('Database interface'), "images/gm_db.png", false, false, true); echo '
'; - echo "This is an advanced extension to interface with Pandora FMS database directly from WEB console using native SQL sentences. Please note that you can damage your Pandora FMS installation if you don't know exactly what are you are doing, this means that you can severily damage your setup using this extension. This extension is intended to be used only by experienced users with a depth knowledge of Pandora FMS internals."; + echo __("This is an advanced extension to interface with %s database directly from WEB console + using native SQL sentences. Please note that you can damage your %s installation + if you don't know exactly what are you are doing, + this means that you can severily damage your setup using this extension. + This extension is intended to be used only by experienced users + with a depth knowledge of %s internals.", + get_product_name(), get_product_name(), get_product_name()); echo '
'; echo "
"; diff --git a/pandora_console/extensions/insert_data.php b/pandora_console/extensions/insert_data.php index 8357c96113..7495c54600 100644 --- a/pandora_console/extensions/insert_data.php +++ b/pandora_console/extensions/insert_data.php @@ -167,6 +167,7 @@ function mainInsertData() { $params['use_hidden_input_idagent'] = true; $params['print_hidden_input_idagent'] = true; $params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent'; + $params['hidden_input_idagent_value'] = $id_agente; $table->data[0][1] = ui_print_agent_autocomplete_input($params); diff --git a/pandora_console/extensions/net_tools.php b/pandora_console/extensions/net_tools.php index 2f18a569d4..a223f6aa96 100644 --- a/pandora_console/extensions/net_tools.php +++ b/pandora_console/extensions/net_tools.php @@ -313,23 +313,23 @@ function godmode_net_tools() { $table->data = array(); $table->data[0][0] = __("Traceroute path"); - $table->data[0][0] .= ui_print_help_tip(__('If it is empty, Pandora searchs the traceroute system.'), true); + $table->data[0][0] .= ui_print_help_tip(__('If empty, %s will search the traceroute system.', get_product_name()), true); $table->data[0][1] = html_print_input_text('traceroute_path', $traceroute_path, '', 40, 255, true); $table->data[1][0] = __("Ping path"); - $table->data[1][0] .= ui_print_help_tip(__('If it is empty, Pandora searchs the ping system.'), true); + $table->data[1][0] .= ui_print_help_tip(__('If empty, %s will search the ping system.', get_product_name()), true); $table->data[1][1] = html_print_input_text('ping_path', $ping_path, '', 40, 255, true); $table->data[2][0] = __("Nmap path"); - $table->data[2][0] .= ui_print_help_tip(__('If it is empty, Pandora searchs the nmap system.'), true); + $table->data[2][0] .= ui_print_help_tip(__('If empty, %s will search the nmap system.', get_product_name()), true); $table->data[2][1] = html_print_input_text('nmap_path', $nmap_path, '', 40, 255, true); $table->data[3][0] = __("Dig path"); - $table->data[3][0] .= ui_print_help_tip(__('If it is empty, Pandora searchs the dig system.'), true); + $table->data[3][0] .= ui_print_help_tip(__('If empty, %s will search the dig system', get_product_name()), true); $table->data[3][1] = html_print_input_text('dig_path', $dig_path, '', 40, 255, true); $table->data[4][0] = __("Snmpget path"); - $table->data[4][0] .= ui_print_help_tip(__('If it is empty, Pandora searchs the snmpget system.'), true); + $table->data[4][0] .= ui_print_help_tip(__('If empty, %s will search the snmpget system.', get_product_name()), true); $table->data[4][1] = html_print_input_text('snmpget_path', $snmpget_path, '', 40, 255, true); echo '
'; diff --git a/pandora_console/extensions/pandora_logs.php b/pandora_console/extensions/pandora_logs.php index 4241018a16..71cf847fa5 100644 --- a/pandora_console/extensions/pandora_logs.php +++ b/pandora_console/extensions/pandora_logs.php @@ -69,7 +69,7 @@ function pandoralogs_extension_main () { ui_print_page_header (__("System logfile viewer"), "images/extensions.png", false, "", true, "" ); - echo "

" . __('Use this tool to view your Pandora FMS logfiles directly on the console') . "

"; + echo "

" . __('Use this tool to view your %s logfiles directly on the console', get_product_name()) . "

"; echo "

" . __('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), ' . $config['max_log_size'] * 1000 . 'B at the moment') . "

"; diff --git a/pandora_console/extensions/plugin_registration.php b/pandora_console/extensions/plugin_registration.php index 8807fbe153..3efa7ff183 100644 --- a/pandora_console/extensions/plugin_registration.php +++ b/pandora_console/extensions/plugin_registration.php @@ -16,6 +16,8 @@ function pluginreg_extension_main () { global $config; + + check_login(); if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) { db_pandora_audit("ACL Violation", "Trying to access Setup Management"); @@ -31,10 +33,10 @@ function pluginreg_extension_main () { echo ''; echo '
'; echo '

' . __("Plugin registration") . '

'; - echo '

' . - __("This extension makes registration of server plugins more easy. - Here you can upload a server plugin in Pandora FMS 3.x zipped format (.pspz). - Please refer to documentation on how to obtain and use Pandora FMS Server Plugins. + echo '

' . + __("This extension makes registering server plugins an easier task. + Here you can upload a server plugin in .pspz zipped format. + Please refer to the official documentation on how to obtain and use Server Plugins.

You can get more plugins in our Public Resource Library ") . '

'; // Upload form echo ""; diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index b4fade177d..e8cac701bb 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -14,8 +14,10 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -include_once('include/graphs/fgraph.php'); -include_once('include/functions_snmp_browser.php'); +global $config; + +include_once($config['homedir'] . '/include/graphs/fgraph.php'); +include_once($config['homedir'] . '/include/functions_snmp_browser.php'); function pandora_realtime_graphs () { global $config; @@ -25,8 +27,11 @@ function pandora_realtime_graphs () { $action = get_parameter('action', 'list'); $onheader = array(); - - ui_print_page_header (__("Realtime graphs"), "images/extensions.png", false, "", false, $onheader); + + $hide_header = get_parameter('hide_header', 0); + if (!$hide_header) { + ui_print_page_header (__("Realtime graphs"), "images/extensions.png", false, "", false, $onheader); + } $chart[time()]['graph'] = '0'; $interactive_graph = true; @@ -58,37 +63,51 @@ function pandora_realtime_graphs () { $table->style['snmp_oid'] = 'font-weight: bold;'; $table->data = array (); - $graph_fields['cpu_load'] = __('Pandora Server CPU'); - $graph_fields['pending_packets'] = __('Pandora Server Pending packets'); - $graph_fields['disk_io_wait'] = __('Pandora Server Disk IO Wait'); - $graph_fields['apache_load'] = __('Pandora Server Apache load'); - $graph_fields['mysql_load'] = __('Pandora Server MySQL load'); - $graph_fields['server_load'] = __('Pandora Server load'); + $graph_fields['cpu_load'] = __('%s Server CPU', get_product_name()); + $graph_fields['pending_packets'] = __('Pending packages from %s Server', get_product_name()); + $graph_fields['disk_io_wait'] = __('%s Server Disk IO Wait', get_product_name()); + $graph_fields['apache_load'] = __('%s Server Apache load', get_product_name()); + $graph_fields['mysql_load'] = __('%s Server MySQL load', get_product_name()); + $graph_fields['server_load'] = __('%s Server load', get_product_name()); $graph_fields['snmp_interface'] = __('SNMP Interface throughput'); $graph = get_parameter('graph', 'cpu_load'); $refresh = get_parameter('refresh', '1000'); - $data['graph'] = __('Graph') . '  ' . html_print_select ($graph_fields, 'graph', $graph, '', '', 0, true); + if ($graph != 'snmp_module') { + $data['graph'] = __('Graph') . '  ' . html_print_select ($graph_fields, 'graph', $graph, '', '', 0, true); + } $refresh_fields[1000] = human_time_description_raw(1, true, 'large'); $refresh_fields[5000] = human_time_description_raw(5, true, 'large'); $refresh_fields[10000] = human_time_description_raw(10, true, 'large'); $refresh_fields[30000] = human_time_description_raw(30, true, 'large'); + if ($graph == 'snmp_module') { + $agent_alias = get_parameter('agent_alias', ''); + $module_name = get_parameter('module_name', ''); + $module_incremental = get_parameter ('incremental', 0); + $data['module_info'] = "$agent_alias: $module_name"; + + // Append all the hidden in this cell + $data['module_info'] .= html_print_input_hidden ('incremental', $module_incremental, true); + $data['module_info'] .= html_print_select ( + array('snmp_module' => '-'), 'graph', 'snmp_module', '', '', 0, true, false, true, '', false, 'display: none;' + ); + } $data['refresh'] = __('Refresh interval') . '  ' . html_print_select ($refresh_fields, 'refresh', $refresh, '', '', 0, true); - $data['incremental'] = __('Incremental') . '  ' . html_print_checkbox ('incremental', 1, 0, true); + if ($graph != 'snmp_module') { + $data['incremental'] = __('Incremental') . '  ' . html_print_checkbox ('incremental', 1, 0, true); + } $data['reset'] = html_print_button(__('Clear graph'), 'reset', false, 'clearGraph()', 'class="sub delete" style="margin-top:0px;"', true); $table->data[] = $data; - - - if ($graph == 'snmp_interface') { - $snmp_address = ''; - $snmp_community = ''; - $snmp_oid = ''; - $snmp_ver = '1'; - $snmp_inc = false; - + + if ($graph == 'snmp_interface' || $graph == 'snmp_module') { + $snmp_address = get_parameter('snmp_address', ''); + $snmp_community = get_parameter('snmp_community', ''); + $snmp_oid = get_parameter('snmp_oid', ''); + $snmp_ver = get_parameter('snmp_ver', ''); + $data = array(); $data['snmp_address'] = __('Target IP') . '  ' . html_print_input_text ('ip_target', $snmp_address, '', 50, 255, true); @@ -111,23 +130,32 @@ function pandora_realtime_graphs () { $data['snmp_ver'] = __('Version') . '  ' . html_print_select ($snmp_versions, 'snmp_version', $snmp_ver, '', '', 0, true); $data['snmp_ver'] .= '  ' . html_print_button (__('SNMP walk'), 'snmp_walk', false, 'snmpBrowserWindow()', 'class="sub next"', true); $table->colspan[2]['snmp_ver'] = 2; - + $table->data[] = $data; - + + // Hide some options in snmp_module graphs + if ($graph == 'snmp_module') { + $table->rowstyle[1] = "display: none;"; + $table->rowstyle[2] = "display: none;"; + } snmp_browser_print_container (false, '100%', '60%', 'none'); } + // Print the relative path to AJAX calls: + html_print_input_hidden('rel_path', get_parameter('rel_path', '')); + + // Print the form echo ''; html_print_table($table); echo ''; // Define a custom action to save the OID selected in the SNMP browser to the form - html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false); + html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false); html_print_input_hidden ('incremental_base', '0'); - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; // Store servers timezone offset to be retrieved from js set_js_value('timezone_offset', date('Z', time())); diff --git a/pandora_console/extensions/realtime_graphs/ajax.php b/pandora_console/extensions/realtime_graphs/ajax.php index 89ea428ee2..7c3eb0c3b5 100644 --- a/pandora_console/extensions/realtime_graphs/ajax.php +++ b/pandora_console/extensions/realtime_graphs/ajax.php @@ -59,6 +59,7 @@ switch($graph) { $data = exec("ps aux | grep pandora_server | grep -v grep | awk '{ print $3 }'"); break; case 'snmp_interface': + case 'snmp_module': $snmp_address = $_POST['snmp_address']; $snmp_community = $_POST['snmp_community']; $snmp_ver = $_POST['snmp_ver']; diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.js b/pandora_console/extensions/realtime_graphs/realtime_graphs.js index 538a68f144..6c535f2e5d 100644 --- a/pandora_console/extensions/realtime_graphs/realtime_graphs.js +++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.js @@ -37,7 +37,7 @@ var plot = $.plot("#" + id, data, options); var refresh = parseInt($('#refresh').val()); -var incremental = $('#checkbox-incremental').is(':checked'); +var incremental = $('#checkbox-incremental').is(':checked') || $('#hidden-incremental').val() == 1; var incremental_base = 0; var last_inc = 0; var to; @@ -58,9 +58,11 @@ function refresh_graph () { postvars['snmp_address'] = $('#text-ip_target').val(); postvars['refresh'] = refresh; - + + var rel_path = $("#hidden-rel_path").val(); + $.ajax({ - url: "extensions/realtime_graphs/ajax.php", + url: rel_path + "extensions/realtime_graphs/ajax.php", type: "POST", dataType: "json", data: postvars, diff --git a/pandora_console/extensions/resource_exportation.php b/pandora_console/extensions/resource_exportation.php index 4bdc7d2046..3e6ba7f540 100755 --- a/pandora_console/extensions/resource_exportation.php +++ b/pandora_console/extensions/resource_exportation.php @@ -338,8 +338,9 @@ function resource_exportation_extension_main() { ui_print_page_header (__('Resource exportation'), "images/extensions.png", false, "", true, "" ); echo "
"; - echo __("This extension makes exportation of resource template more easy. " . - "Here you can export as a resource template in Pandora FMS 3.x format (.ptr). "); + echo __("This extension makes exportation of resource template more easy.") . + " " . + __("You can export resource templates in .ptr format."); echo "
"; echo "

"; diff --git a/pandora_console/extensions/resource_registration.php b/pandora_console/extensions/resource_registration.php index a4dff69997..9158876901 100755 --- a/pandora_console/extensions/resource_registration.php +++ b/pandora_console/extensions/resource_registration.php @@ -855,11 +855,12 @@ function resource_registration_extension_main() { } echo "
"; - printf(__("This extension makes registration of resource template more easy. " . - "Here you can upload a resource template in Pandora FMS 3.x format (.ptr). " . - "Please refer to documentation on how to obtain and use Pandora FMS resources. " . - "

You can get more resurces in our Public Resource Library") , - "http://pandorafms.org/index.php?sec=community&sec2=repository&lng=en"); + echo __("This extension makes registering resource templates easier.") . " " . + __("Here you can upload a resource template in .ptr format.") . " " . + __("Please refer to our documentation for more information on how to obtain and use %s resources.", get_product_name()) . " " . + "

" . + __("You can get more resurces in our Public Resource Library") + ; echo "
"; echo "

"; diff --git a/pandora_console/extras/mr/13.sql b/pandora_console/extras/mr/13.sql index 96aae03cb9..0438d41b57 100644 --- a/pandora_console/extras/mr/13.sql +++ b/pandora_console/extras/mr/13.sql @@ -10,6 +10,55 @@ START TRANSACTION; EXECUTE pr_oum720; DEALLOCATE PREPARE pr_oum720; - INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES (21, 'Cluster', 'Cluster agent', 'so_cluster.png'); + INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES (100, 'Cluster', 'Cluster agent', 'so_cluster.png'); + + UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `tconfig_os` WHERE `id_os` = 21 and `name` = 'Cluster'); -COMMIT; \ No newline at end of file + DELETE FROM `tconfig_os` where `id_os` = 21 and `name` = 'Cluster'; + + CREATE TABLE IF NOT EXISTS `tprovisioning`( + `id` int unsigned NOT NULL auto_increment, + `name` varchar(100) NOT NULL, + `description` TEXT default '', + `order` int(11) NOT NULL default 0, + `config` TEXT default '', + PRIMARY KEY (`id`) + ) engine=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE IF NOT EXISTS `tprovisioning_rules`( + `id` int unsigned NOT NULL auto_increment, + `id_provisioning` int unsigned NOT NULL, + `order` int(11) NOT NULL default 0, + `operator` enum('AND','OR') default 'OR', + `type` enum('alias','ip-range') default 'alias', + `value` varchar(100) NOT NULL default '', + PRIMARY KEY (`id`), + FOREIGN KEY (`id_provisioning`) REFERENCES tprovisioning(`id`) + ON DELETE CASCADE + ) engine=InnoDB DEFAULT CHARSET=utf8; + + create table IF NOT EXISTS `tmigration_queue`( + `id` int unsigned not null auto_increment, + `id_source_agent` int unsigned not null, + `id_target_agent` int unsigned not null, + `id_source_node` int unsigned not null, + `id_target_node` int unsigned not null, + `priority` int unsigned default 0, + `step` int default 0, + `running` tinyint(2) default 0, + `active_db_only` tinyint(2) default 0, + PRIMARY KEY(`id`) + ) engine=InnoDB DEFAULT CHARSET=utf8; + + create table IF NOT EXISTS `tmigration_module_queue`( + `id` int unsigned not null auto_increment, + `id_migration` int unsigned not null, + `id_source_agentmodule` int unsigned not null, + `id_target_agentmodule` int unsigned not null, + `last_replication_timestamp` bigint(20) NOT NULL default 0, + PRIMARY KEY(`id`), + FOREIGN KEY(`id_migration`) REFERENCES tmigration_queue(`id`) + ON DELETE CASCADE ON UPDATE CASCADE + ) engine=InnoDB DEFAULT CHARSET=utf8; + +COMMIT; diff --git a/pandora_console/extras/mr/14.sql b/pandora_console/extras/mr/14.sql new file mode 100644 index 0000000000..240ca3563a --- /dev/null +++ b/pandora_console/extras/mr/14.sql @@ -0,0 +1,54 @@ +START TRANSACTION; + +UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `tconfig_os` WHERE `id_os` = 21 and `name` = 'Cluster'); + +DELETE FROM `tconfig_os` where `id_os` = 21 and `name` = 'Cluster'; + +-- --------------------------------------------------------------------- +-- Table `tagent_secondary_group` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tagent_secondary_group`( + `id` int unsigned not null auto_increment, + `id_agent` int(10) unsigned NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + PRIMARY KEY(`id`), + FOREIGN KEY(`id_agent`) REFERENCES tagente(`id_agente`) + ON DELETE CASCADE, + FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`) + ON DELETE CASCADE +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tmetaconsole_agent_secondary_group` +-- --------------------------------------------------------------------- +create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`( + `id` int unsigned not null auto_increment, + `id_agent` int(10) unsigned NOT NULL, + `id_tagente` int(10) unsigned NOT NULL, + `id_tmetaconsole_setup` int(10) NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + PRIMARY KEY(`id`), + FOREIGN KEY(`id_agent`) REFERENCES tmetaconsole_agent(`id_agente`) + ON DELETE CASCADE, + FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`) + ON DELETE CASCADE, + FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`) + ON DELETE CASCADE +) engine=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; +ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; +ALTER TABLE tusuario_perfil ADD COLUMN `is_secondary` tinyint(1) NOT NULL default '0'; + +SET @st_oum721 = (SELECT IF( + (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tuser_task_scheduled') > 0, + "ALTER TABLE tuser_task_scheduled ADD (id_grupo int(10) unsigned NOT NULL Default 0)", + "0" +)); + +PREPARE pr_oum721 FROM @st_oum721; +EXECUTE pr_oum721; +DEALLOCATE PREPARE pr_oum721; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/mr/15.sql b/pandora_console/extras/mr/15.sql new file mode 100644 index 0000000000..fff6c4e440 --- /dev/null +++ b/pandora_console/extras/mr/15.sql @@ -0,0 +1,9 @@ +START TRANSACTION; + +ALTER TABLE tcluster DROP FOREIGN KEY tcluster_ibfk_1; + +ALTER TABLE tcluster_agent DROP FOREIGN KEY tcluster_agent_ibfk_1; + +ALTER TABLE tcluster_agent DROP FOREIGN KEY tcluster_agent_ibfk_2; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/mr/16.sql b/pandora_console/extras/mr/16.sql new file mode 100644 index 0000000000..65bbe43c7d --- /dev/null +++ b/pandora_console/extras/mr/16.sql @@ -0,0 +1,9 @@ +START TRANSACTION; + +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 talert_actions SET name='Monitoring Event' WHERE name='Pandora FMS Event'; + +COMMIT; \ No newline at end of file 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 4e292b4f0d..436081f2b1 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 @@ -1123,6 +1123,7 @@ UPDATE talert_actions SET `field4` = 'integria', `field9` = 'admin', `field10` = '_alert_description_' WHERE `id` = 4 AND `id_alert_command` = 11; +UPDATE talert_actions SET name='Monitoring Event' WHERE name='Pandora FMS Event'; ALTER TABLE talert_actions ADD COLUMN `field11` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_actions ADD COLUMN `field12` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_actions ADD COLUMN `field13` TEXT NOT NULL DEFAULT ""; @@ -1160,10 +1161,23 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge 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', 13); +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', '720'); +-- --------------------------------------------------------------------- +-- Table `tconfig_os` +-- --------------------------------------------------------------------- + +INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES (100, 'Cluster', 'Cluster agent', 'so_cluster.png'); + +UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `tconfig_os` WHERE `id_os` = 21 and `name` = 'Cluster'); + +DELETE FROM `tconfig_os` where `id_os` = 21 and `name` = 'Cluster'; + -- --------------------------------------------------------------------- -- Table `tplanned_downtime_agents` -- --------------------------------------------------------------------- @@ -1358,6 +1372,7 @@ END IF; SET @vv2 = (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tuser_task_scheduled'); IF @vv2>0 THEN ALTER TABLE tuser_task_scheduled MODIFY args TEXT NOT NULL; + ALTER TABLE tuser_task_scheduled ADD (id_grupo int(10) unsigned NOT NULL Default 0); END IF; END; // @@ -1498,9 +1513,7 @@ create table IF NOT EXISTS `tcluster`( `description` text not null default '', `group` int(10) unsigned NOT NULL default '0', `id_agent` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`) - ON UPDATE CASCADE + PRIMARY KEY (`id`) ) engine=InnoDB DEFAULT CHARSET=utf8; -- --------------------------------------------------------------------- @@ -1528,8 +1541,103 @@ create table IF NOT EXISTS `tcluster_agent`( `id_cluster` int unsigned not null, `id_agent` int(10) unsigned not null, PRIMARY KEY (`id_cluster`,`id_agent`), - FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`) - ON UPDATE CASCADE, FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`) ON UPDATE CASCADE ) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tprovisioning` +-- --------------------------------------------------------------------- +create table IF NOT EXISTS `tprovisioning`( + `id` int unsigned NOT NULL auto_increment, + `name` varchar(100) NOT NULL, + `description` TEXT default '', + `order` int(11) NOT NULL default 0, + `config` TEXT default '', + PRIMARY KEY (`id`) +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tprovisioning_rules` +-- --------------------------------------------------------------------- +create table IF NOT EXISTS `tprovisioning_rules`( + `id` int unsigned NOT NULL auto_increment, + `id_provisioning` int unsigned NOT NULL, + `order` int(11) NOT NULL default 0, + `operator` enum('AND','OR') default 'OR', + `type` enum('alias','ip-range') default 'alias', + `value` varchar(100) NOT NULL default '', + PRIMARY KEY (`id`), + FOREIGN KEY (`id_provisioning`) REFERENCES tprovisioning(`id`) + ON DELETE CASCADE +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tmigration_queue` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tmigration_queue`( + `id` int unsigned not null auto_increment, + `id_source_agent` int unsigned not null, + `id_target_agent` int unsigned not null, + `id_source_node` int unsigned not null, + `id_target_node` int unsigned not null, + `priority` int unsigned default 0, + `step` int default 0, + `running` tinyint(2) default 0, + `active_db_only` tinyint(2) default 0, + PRIMARY KEY(`id`) +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tmigration_module_queue` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tmigration_module_queue`( + `id` int unsigned not null auto_increment, + `id_migration` int unsigned not null, + `id_source_agentmodule` int unsigned not null, + `id_target_agentmodule` int unsigned not null, + `last_replication_timestamp` bigint(20) NOT NULL default 0, + PRIMARY KEY(`id`), + FOREIGN KEY(`id_migration`) REFERENCES tmigration_queue(`id`) + ON DELETE CASCADE + ON UPDATE CASCADE +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tagent_secondary_group` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tagent_secondary_group`( + `id` int unsigned not null auto_increment, + `id_agent` int(10) unsigned NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + PRIMARY KEY(`id`), + FOREIGN KEY(`id_agent`) REFERENCES tagente(`id_agente`) + ON DELETE CASCADE, + FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`) + ON DELETE CASCADE +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tmetaconsole_agent_secondary_group` +-- --------------------------------------------------------------------- +create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`( + `id` int unsigned not null auto_increment, + `id_agent` int(10) unsigned NOT NULL, + `id_tagente` int(10) unsigned NOT NULL, + `id_tmetaconsole_setup` int(10) NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + PRIMARY KEY(`id`), + FOREIGN KEY(`id_agent`) REFERENCES tmetaconsole_agent(`id_agente`) + ON DELETE CASCADE, + FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`) + ON DELETE CASCADE, + FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`) + ON DELETE CASCADE +) engine=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; +ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; +ALTER TABLE tusuario_perfil ADD COLUMN `is_secondary` tinyint(1) NOT NULL default '0'; diff --git a/pandora_console/general/alert_enterprise.php b/pandora_console/general/alert_enterprise.php index 66d6e36b09..ea5d1d97e5 100644 --- a/pandora_console/general/alert_enterprise.php +++ b/pandora_console/general/alert_enterprise.php @@ -93,15 +93,17 @@ switch ($tipo) { case "helpmodal": - echo __("This is the online help for Pandora FMS console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use Pandora FMS. Official documentation of Pandora FMS is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.

- Download the official documentation"); + echo __("This is the online help for %s console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use %s. Official documentation of %s is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.

+ Download the official documentation", + get_product_name(), get_product_name(), get_product_name(), $config['custom_docs_url']); break; case "noaccess": - echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance.

- Please know that all attempts to access this page are recorded in security logs of Pandora System Database'); + echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance.

+ Please know that all attempts to access this page are recorded in security logs of %s System Database.', + get_product_name()); break; @@ -111,13 +113,13 @@ switch ($tipo) { echo '

' . - __('The Update Manager client is included on Pandora FMS. It helps system administrators update their Pandora FMS automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.') . + __('The Update Manager client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()) . '

' . '

' . __('OpenSource version updates are automated packages generated each week. These updates come WITHOUT ANY warranty or support. If your system is corrupted or a feature stops working properly, you will need to recover a backup by yourself.') . '

' . '

' . - __('The Enterprise version comes with a different update system, with fully tested, professionally-supported packages, and our support team is there to help you in case of problems or queries. Update Manager is another feature present in the Enterprise version and not included in the OpenSource version. There are lots of advanced business-oriented features contained in Pandora FMS Enterprise Edition. For more information visit pandorafms.com') . + __('The Enterprise version comes with a different update system, with fully tested, professionally-supported packages, and our support team is there to help you in case of problems or queries. Update Manager is another feature present in the Enterprise version and not included in the OpenSource version. There are lots of advanced business-oriented features contained in %s Enterprise Edition. For more information visit pandorafms.com', get_product_name()) . '

' ; @@ -125,13 +127,13 @@ switch ($tipo) { echo '

' . - __('The new Update Manager client is shipped with Pandora FMS It helps system administrators to update their Pandora FMS automatically, since the Update Manager does the task of getting new modules, new plugins and new features (even full migrations tools for future versions) automatically.') . + __('The new Update Manager client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()) . '

' . '

' . - __('Update Manager is one of the most advanced features of Pandora FMS Enterprise version, for more information visit http://pandorafms.com.') . + __('The Update Manager is one of the most advanced features on the %s Enterprise Edition. For more information visit http://pandorafms.com.', get_product_name()) . '

' . '

' . - __('Update Manager sends anonymous information about Pandora FMS usage (number of agents and modules running). To disable it, please remove the remote server address from the Update Manager plugin setup.') . + __('Update Manager sends anonymous information about %s usage (number of agents and modules running). To disable it, please remove the remote server address from the Update Manager plugin setup.', get_product_name()) . '

' ; } @@ -142,13 +144,13 @@ switch ($tipo) {



* Todos los logotipos pertenecen a marcas registradas"); break; case "massivemodal": - echo __("Do you want to consolidate all your system monitoring? Do you have many systems, making it difficult to manage them in a comprehensive manner? Would you like to deploy monitoring, alerts and even local plugins with a single click? Pandora FMS Enterprise Policies are exactly what you need; you'll save time, effort and annoyances. More information pandorafms.com"); + echo __("Do you want to consolidate all your system monitoring? Do you have many systems, making it difficult to manage them in a comprehensive manner? Would you like to deploy monitoring, alerts and even local plugins with a single click? %s Enterprise Policies are exactly what you need; you'll save time, effort and annoyances. More information pandorafms.com", get_product_name()); break; case "eventsmodal": - echo __("Pandora FMS Enterprise also features event correlation. Through correlation you can generate realtime alerts and / or new events based on logical rules. This allows you to automate troubleshooting. If you know the value of working with events, event correlation will take you to a new level."); + echo __("%s Enterprise also features event correlation. Through correlation you can generate realtime alerts and / or new events based on logical rules. This allows you to automate troubleshooting. If you know the value of working with events, event correlation will take you to a new level.", get_product_name()); break; case "reportingmodal": - echo __("Report generating on the Enterprise version is also more powerful: it has wizards, you can schedule emails in PDF to be sent according to the schedule you decide, and it has a template system to create personalized reports quickly for each of your customers. It will even allow your customers to generate their own reports from templates created by you. If reports are key to your business, Pandora FMS Enterprise version is for you."); + echo __("Report generating on the Enterprise version is also more powerful: it has wizards, you can schedule emails in PDF to be sent according to the schedule you decide, and it has a template system to create personalized reports quickly for each of your customers. It will even allow your customers to generate their own reports from templates created by you. If reports are key to your business, %s Enterprise version is for you.", get_product_name()); break; case "visualmodal": echo __("These options are only effective on the Enterprise version."); diff --git a/pandora_console/general/firts_task/cluster_builder.php b/pandora_console/general/firts_task/cluster_builder.php index eb2e8d0e71..dc1e1a3ea3 100644 --- a/pandora_console/general/firts_task/cluster_builder.php +++ b/pandora_console/general/firts_task/cluster_builder.php @@ -49,8 +49,17 @@ ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no cl echo __('Clusters to guarantee service: these are active - passive (A/P) mode clusters. It means that one of the nodes (or machines that make up the cluster) will be running (primary) and another won\'t (secondary). When the primary goes down, the secondary must take over and give the service instead. Although many of the elements of this cluster are active-passive, it will also have active elements in both of them that indicate that the passive node is "online", so that in the case of a service failure in the master, the active node collects this information.'); ?>

+ + +
+ +
\ No newline at end of file diff --git a/pandora_console/general/firts_task/custom_graphs.php b/pandora_console/general/firts_task/custom_graphs.php index 2d63aa4382..a951bb4966 100644 --- a/pandora_console/general/firts_task/custom_graphs.php +++ b/pandora_console/general/firts_task/custom_graphs.php @@ -29,9 +29,10 @@ ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no cu

-

+

diff --git a/pandora_console/general/firts_task/incidents.php b/pandora_console/general/firts_task/incidents.php index 32924ac626..a694874cb3 100644 --- a/pandora_console/general/firts_task/incidents.php +++ b/pandora_console/general/firts_task/incidents.php @@ -33,13 +33,13 @@ if ($incident_w || $incident_m) {

-

+

diff --git a/pandora_console/general/firts_task/map_builder.php b/pandora_console/general/firts_task/map_builder.php index 26409ce803..e9f7451236 100755 --- a/pandora_console/general/firts_task/map_builder.php +++ b/pandora_console/general/firts_task/map_builder.php @@ -33,11 +33,15 @@ if ($vconsoles_write || $vconsoles_manage) {

-

+

diff --git a/pandora_console/general/firts_task/planned_downtime.php b/pandora_console/general/firts_task/planned_downtime.php index 052e12df9c..e8f38d35e9 100644 --- a/pandora_console/general/firts_task/planned_downtime.php +++ b/pandora_console/general/firts_task/planned_downtime.php @@ -26,10 +26,11 @@ ui_require_css_file ('firts_task');

-

+

diff --git a/pandora_console/general/firts_task/tags.php b/pandora_console/general/firts_task/tags.php index 037f7ef2e5..e0069e55c0 100755 --- a/pandora_console/general/firts_task/tags.php +++ b/pandora_console/general/firts_task/tags.php @@ -26,9 +26,9 @@ ui_require_css_file ('firts_task');

-

+

diff --git a/pandora_console/general/footer.php b/pandora_console/general/footer.php index 99cebe8f2d..33c8493e26 100644 --- a/pandora_console/general/footer.php +++ b/pandora_console/general/footer.php @@ -45,11 +45,11 @@ else{ $build_package_version = $current_package; } -echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_package_version, $config["MR"])); +echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config["MR"])); echo '
'; echo ''. __('Page generated at') . ' '. date('F j, Y h:i a'); //Always use timestamp here -echo '
'.__("® Ártica ST").''; +echo '
® '.get_copyright_notice().''; if (isset ($config['debug'])) { $cache_info = array(); diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 2ac1e34df4..ac18da48d1 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -31,14 +31,14 @@ config_check(); $custom_logo = 'images/custom_logo/' . $config['custom_logo']; if (!defined ('PANDORA_ENTERPRISE')) { - $logo_title = 'Pandora FMS Opensource'; + $logo_title = get_product_name() . ' Opensource'; $custom_logo = 'images/custom_logo/pandora_logo_head_3.png'; } else { if (file_exists(ENTERPRISE_DIR . '/' . $custom_logo)) { $custom_logo = ENTERPRISE_DIR . '/' . $custom_logo; } - $logo_title = 'Pandora FMS Enterprise'; + $logo_title = get_product_name() . ' Enterprise'; } echo html_print_image($custom_logo, true, @@ -158,7 +158,7 @@ config_check(); data[0]['clippy'] = '' . html_print_image( @@ -166,8 +166,8 @@ config_check(); true, array("id" => 'clippy', "class" => 'clippy', - "alt" => __('Pandora FMS assistant'), - 'title' => __('Pandora FMS assistant'))) . + "alt" => __('%s assistant', get_product_name()), + 'title' => __('%s assistant', get_product_name()))) . ''; } @@ -307,11 +307,15 @@ config_check(); $table->data[0][3] = $maintenance_img; // Main help icon - $table->data[0][4] = ''.html_print_image("images/header_help.png", - true, array( - "title" => __('Main help'), - "id" => "helpmodal", - "class" => "modalpopup")).''; + if (!$config['disable_help']) { + $table->data[0][4] = + '' . + html_print_image("images/header_help.png", true, array( + "title" => __('Main help'), + "id" => "helpmodal", + "class" => "modalpopup")) . + ''; + } // Logout $table->data[0][5] = ''; @@ -461,14 +465,9 @@ config_check(); - refr_time = parseInt(""); - if (isNaN(refr_time)) { - refr_time = 0; - } - - t = new Date(); + var refr_time = ; + var t = new Date(); t.setTime (t.getTime () + parseInt()); $("#refrcounter").countdown ({until: t, diff --git a/pandora_console/general/login_help_dialog.php b/pandora_console/general/login_help_dialog.php index 631d9d5ce1..6e38d4ece0 100644 --- a/pandora_console/general/login_help_dialog.php +++ b/pandora_console/general/login_help_dialog.php @@ -36,10 +36,11 @@ if (is_ajax()) { // Prints help dialog information echo '
'; + __('Welcome to %s', get_product_name()) . '" style="">'; echo '
'; - echo __('If this is your first time with Pandora FMS, we propose you a few links to learn more about Pandora FMS. Monitoring could be overwhelm, but take your time to learn how to use the power of Pandora FMS!'); + echo __("If this is your first time using %s, we suggest a few links that'll help you learn more about the software. Monitoring can be overwhelming, but take your time to learn how to harness the power of %s!", + get_product_name(), get_product_name()); echo '
'; echo '
'; @@ -70,11 +71,11 @@ echo '
'; - echo '' . + echo '' . html_print_image('images/documentation.png', true, array("alt" => __('Documentation'), "border" => 0)) . ''; echo '
'; - echo '' . __('Documentation') . ''; + echo '' . __('Documentation') . ''; echo ''; echo ''; echo ''; diff --git a/pandora_console/general/login_identification_wizard.php b/pandora_console/general/login_identification_wizard.php index 1f5cabd740..57b5b63ba3 100644 --- a/pandora_console/general/login_identification_wizard.php +++ b/pandora_console/general/login_identification_wizard.php @@ -138,17 +138,17 @@ if ($email == 'admin@example.com') $email = ''; // Prints accept register license echo '
'; + __('The %s community wizard', get_product_name()) . '" style="">'; echo '
'; echo html_print_image ('images/pandora_circle_big.png', true); echo '
'; echo '
'; - echo __('Stay up to date with the Pandora FMS community') . "."; + echo __('Stay up to date with the %s community', get_product_name()) . "."; echo '
'; echo '
'; - echo '

' . __("When you subscribe to the Pandora FMS Update Manager service, you accept that we register your Pandora instance as an identifier on the database owned by Artica TS. This data will solely be used to provide you with information about Pandora FMS and will not be conceded to third parties. You'll be able to unregister from said database at any time from the Update Manager options") . '.

'; - echo '

' . __("In the same fashion, when subscribed to the newsletter you accept that your email will pass on to a database property of Artica TS. This data will solely be used to provide you with information about Pandora FMS and will not be conceded to third parties. You'll be able to unregister from said database at any time from the newsletter subscription options") . '.

'; + echo '

' . __("When you subscribe to the %s Update Manager service, you accept that we register your %s instance as an identifier on the database owned by Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the Update Manager options.", get_product_name(), get_product_name(), get_product_name()) . '

'; + echo '

' . __("In the same fashion, when subscribed to the newsletter you accept that your email will pass on to a database property of Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the newsletter subscription options.", get_product_name()) . '

'; echo '
'; echo '
'; @@ -161,7 +161,7 @@ echo '
'; html_print_checkbox('register', 1, false, false, false, 'cursor: \'pointer\''); - echo ' ' .__("Join the Pandora FMS community") . '!
'; + echo ' ' .__('Join the %s community!', get_product_name()) . '!
'; html_print_checkbox('newsletter', 1, false, false, false, 'cursor: \'pointer\''); echo ' ' .__("Subscribe to our newsletter") . ''; echo "
"; @@ -176,7 +176,7 @@ echo '
'; // Print yes or not dialog echo '
'; + __("%s instance identification wizard", get_product_name()) . '" style="">'; echo '
'; echo __("Do you want to continue without any registration") . "?"; echo '
'; diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 7a99ae494c..737148751d 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -50,7 +50,7 @@ if (!isset($login_screen)) { switch ($login_screen) { case 'login': $logo_link = 'http://www.pandorafms.com'; - $logo_title = __('Go to Pandora FMS Website'); + $logo_title = __('Go to %s Website', get_product_name()); break; case 'logout': case 'double_auth': @@ -86,31 +86,39 @@ if (!empty($config['login_background'])) { $background_url = "images/backgrounds/" . $config['login_background']; $login_body_style = "style=\"background-image: url('$background_url');\""; } +// Get the custom icons +$docs_logo = ui_get_docs_logo(); +$support_logo = ui_get_support_logo(); echo '
'; echo '
'; echo '
'; if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) { if(isset ($config['custom_logo'])){ - echo 'pandora_console'; + echo 'monitoring_console'; } else{ - echo 'pandora_console'; + echo 'monitoring_console'; } } else{ - echo 'pandora_console'; + echo 'monitoring_console'; } echo '
'; - echo '
    '; - echo '
  • docs pandora
  • '; - echo '
  • ' . __('Docs') . '
  • '; - if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) { - echo '
  • support pandora
  • '; - } else { - echo '
  • support pandora
  • '; + echo '
    '; @@ -250,17 +258,17 @@ echo ''; echo '
'; // Is possible manage actions if have LW permissions in the agent group of the alert module - if (check_acl ($config['id_user'], $agent_group, "LW")) { + if (check_acl_one_of_groups ($config['id_user'], $all_groups, "LW")) { //~ $data[2] .= '
'; $data[2] .= ''; // Is possible manage actions if have LW permissions in the agent group of the alert module - if (check_acl ($config['id_user'], $agent_group, "LW") || check_acl ($config['id_user'], $template_group, "LM")) { + if (check_acl_one_of_groups ($config['id_user'], $all_groups, "LW") || check_acl ($config['id_user'], $template_group, "LM")) { $own_info = get_user_info($config['id_user']); if (check_acl ($config['id_user'], $template_group, "LW")) $own_groups = users_get_groups($config['id_user'], 'LW', true); @@ -666,7 +671,7 @@ foreach ($simple_alerts as $alert) { $data[4] .= ''; // To manage alert is necessary LW permissions in the agent group - if(check_acl ($config['id_user'], $agent_group, "LW")) { + if(check_acl_one_of_groups ($config['id_user'], $all_groups, "LW")) { $data[4] .= '  
'; if (!$alert['standby']) { $data[4] .= html_print_input_image ('standby_off', 'images/bell.png', 1, 'padding:0px;', true); @@ -681,7 +686,7 @@ foreach ($simple_alerts as $alert) { } // To access to policy page is necessary have AW permissions in the agent - if(check_acl ($config['id_user'], $agent_group, "AW")) { + if(check_acl_one_of_groups ($config['id_user'], $all_groups, "AW")) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { $policyInfo = policies_is_alert_in_policy2($alert['id'], false); if ($policyInfo === false) @@ -697,7 +702,7 @@ foreach ($simple_alerts as $alert) { } // To manage alert is necessary LW permissions in the agent group - if(check_acl ($config['id_user'], $agent_group, "LW")) { + if(check_acl_one_of_groups ($config['id_user'], $all_groups, "LW")) { $data[4] .= '  '; if ($alert['disabled']) { $data[4] .= html_print_image('images/add.disabled.png', @@ -714,7 +719,7 @@ foreach ($simple_alerts as $alert) { $data[4] .= '
'; } - if(check_acl ($config['id_user'], $agent_group, "LM")) { + if(check_acl_one_of_groups ($config['id_user'], $all_groups, "LM")) { $data[4] .= '
'; $data[4] .= html_print_input_image ('view_alert', 'images/eye.png', 1, '', true, array('title' => __('View alert advanced details'))); $data[4] .= html_print_input_hidden ('id_alert', $alert['id'], true); @@ -737,7 +742,7 @@ if (isset($dont_display_alert_create_bttn)) if ($dont_display_alert_create_bttn) $display_create = false; -if ($display_create && (check_acl ($config['id_user'], 0, "LW") || check_acl ($config['id_user'], $template_group, "LM"))) { +if ($display_create && (check_acl ($config['id_user'], 0, "LW") || check_acl ($config['id_user'], $template_group, "LM")) && !$id_cluster) { echo '
'; echo ''; html_print_submit_button (__('Create'), 'crtbtn', false, 'class="sub next"'); diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index a56ed8bcac..a65b925a44 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -90,14 +90,17 @@ if ($create_alert) { "tagente_modulo","id_agente_modulo", $id_agent_module)); // Audit the creation only when the alert creation is correct + $unsafe_alert_template_name = io_safe_output($alert_template_name); + $unsafe_module_name = io_safe_output($module_name); + $unsafe_agent_alias = io_safe_output($agent_alias); if ($id) { db_pandora_audit("Alert management", - "Added alert '$alert_template_name' for module '$module_name' in agent '$agent_alias'", + "Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'", false, false, 'ID: ' . $id); } else { db_pandora_audit("Alert management", - "Fail Added alert '$alert_template_name' for module '$module_name' in agent '$agent_alias'"); + "Fail Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'"); } $messageAction = ui_print_result_message ($id, @@ -143,6 +146,20 @@ if ($delete_alert) { $messageAction = ui_print_result_message ($result, __('Successfully deleted'), __('Could not be deleted'), '', true); + + $id_cluster = db_get_all_rows_sql('select id,cluster_type from tcluster where id_agent = '.$id_agente); + + if($id_cluster){ + + if($id_cluster[0]['cluster_type'] == 'AA'){ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=5&update=1&message_delete_alert='.$result); + } + else{ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=7&update=1&message_delete_alert='.$result); + } + + } + } if ($add_action) { @@ -211,6 +228,20 @@ if ($delete_action) { $messageAction = ui_print_result_message ($result, __('Successfully deleted'), __('Could not be deleted'), '', true); + + $id_cluster = db_get_all_rows_sql('select id,cluster_type from tcluster where id_agent = '.$id_agente); + + if($id_cluster){ + + if($id_cluster[0]['cluster_type'] == 'AA'){ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=5&update=1&message_delete_action='.$result); + } + else{ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=7&update=1&message_delete_action='.$result); + } + + } + } if ($enable_alert) { @@ -228,6 +259,19 @@ if ($enable_alert) { $messageAction = ui_print_result_message ($result, __('Successfully enabled'), __('Could not be enabled'), '', true); + + $id_cluster = db_get_all_rows_sql('select id,cluster_type from tcluster where id_agent = '.$id_agente); + + if($id_cluster){ + + if($id_cluster[0]['cluster_type'] == 'AA'){ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=5&update=1&message_enable_alert='.$result); + } + else{ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=7&update=1&message_enable_alert='.$result); + } + + } } if ($disable_alert) { @@ -245,6 +289,20 @@ if ($disable_alert) { $messageAction = ui_print_result_message ($result, __('Successfully disabled'), __('Could not be disabled'), '', true); + + $id_cluster = db_get_all_rows_sql('select id,cluster_type from tcluster where id_agent = '.$id_agente); + + if($id_cluster){ + + if($id_cluster[0]['cluster_type'] == 'AA'){ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=5&update=1&message_disable_alert='.$result); + } + else{ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=7&update=1&message_disable_alert='.$result); + } + + } + } if ($standbyon_alert) { @@ -262,6 +320,19 @@ if ($standbyon_alert) { $messageAction = ui_print_result_message ($result, __('Successfully set standby'), __('Could not be set standby'), '', true); + + $id_cluster = db_get_all_rows_sql('select id,cluster_type from tcluster where id_agent = '.$id_agente); + + if($id_cluster){ + + if($id_cluster[0]['cluster_type'] == 'AA'){ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=5&update=1&message_standbyon='.$result); + } + else{ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=7&update=1&message_standbyon='.$result); + } + + } } if ($standbyoff_alert) { @@ -279,6 +350,19 @@ if ($standbyoff_alert) { $messageAction = ui_print_result_message ($result, __('Successfully set off standby'), __('Could not be set off standby'), '', true); + + $id_cluster = db_get_all_rows_sql('select id,cluster_type from tcluster where id_agent = '.$id_agente); + + if($id_cluster){ + + if($id_cluster[0]['cluster_type'] == 'AA'){ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=5&update=1&message_standbyoff='.$result); + } + else{ + header('Location: index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&id_cluster='.$id_cluster[0]['id'].'&step=7&update=1&message_standbyoff='.$result); + } + + } } if ($id_agente) { @@ -294,8 +378,8 @@ if ($id_agente) { echo $messageAction; require_once('godmode/alerts/alert_list.list.php'); - - if(check_acl ($config['id_user'], $agent['id_grupo'], "LW") || check_acl ($config['id_user'], $agent['id_grupo'], "LM")) { + $all_groups = agents_get_all_groups_agent ($id_agente, $agent['id_grupo']); + if(check_acl_one_of_groups ($config['id_user'], $all_groups, "LW") || check_acl_one_of_groups ($config['id_user'], $all_groups, "LM")) { require_once('godmode/alerts/alert_list.builder.php'); } diff --git a/pandora_console/godmode/alerts/alert_special_days.php b/pandora_console/godmode/alerts/alert_special_days.php index 8a872267e6..c221f963af 100644 --- a/pandora_console/godmode/alerts/alert_special_days.php +++ b/pandora_console/godmode/alerts/alert_special_days.php @@ -133,7 +133,7 @@ if ($create_special_day) { } else { $result = alerts_create_alert_special_day ($date, $same_day, $values); - $info = 'Date: ' . $date . ' Same day of the week: ' . $same_day . ' Description: ' . $values['description']; + $info = '{"Date":"'.$date.'","Same day of the week":"'.$same_day.'","Description":"'.$values['description'].'"}'; } } @@ -186,12 +186,12 @@ if ($update_special_day) { } else { $result = alerts_update_alert_special_day ($id, $values); - $info = 'Date: ' . $date . ' Same day of the week: ' . $same_day . ' Description: ' . $description; + $info = '{"Date":"'.$date.'","Same day of the week":"'.$same_day.'","Description":"'.$description.'"}'; } } else { $result = alerts_update_alert_special_day ($id, $values); - $info = 'Date: ' . $date . ' Same day of the week: ' . $same_day . ' Description: ' . $description; + $info = '{"Date":"'.$date.'","Same day of the week":"'.$same_day.'","Description":"'.$description.'"}'; } } diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 3e744c712b..d1fe842469 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -111,6 +111,13 @@ $table->size[0] = '20%'; $table->data = array (); $table->data[0][0] = __('Name'); $table->data[0][1] = html_print_input_text ('name', $name, '', 35, 255, true); +if (io_safe_output($name) == "Monitoring Event") { + $table->data[0][1] .= '  ' . ui_print_help_tip( + __("This action may stop working, if you change its name."), + true, + "images/header_yellow.png" + ); +} $table->colspan[0][1] = 2; $table->data[1][0] = __('Group'); @@ -156,7 +163,6 @@ $table->data[5][1] = html_print_textarea ('command_preview', 5, 30, '', $table->data[5][2] = html_print_textarea ('command_recovery_preview', 5, 30, '', 'disabled="disabled"', true); -$row = 6; for ($i = 1; $i <= $config['max_macro_fields']; $i++) { $table->data['field' . $i][0] = html_print_image( 'images/spinner.gif', true); @@ -164,7 +170,7 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) { 'images/spinner.gif', true); $table->data['field' . $i][2] = html_print_image( 'images/spinner.gif', true); - + // Store the value in a hidden to keep it on first execution $table->data['field' . $i][1] .= html_print_input_hidden( 'field' . $i . '_value', @@ -178,6 +184,7 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) { true); } + echo 'data[0][3] = html_print_checkbox ('special_day', 1, $special_day, true); $table->data[1][0] = __('Time from') . ' ' . - ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true); + ui_print_help_tip(__('Watch format is hours (24h):minutes:seconds'), true); $table->data[1][1] = html_print_input_text ('time_from', $time_from, '', 7, 8, true); $table->data[1][2] = __('Time to') . ' ' . - ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true); + ui_print_help_tip(__('Watch format is hours (24h):minutes:seconds'), true); $table->data[1][3] = html_print_input_text ('time_to', $time_to, '', 7, 8, true); diff --git a/pandora_console/godmode/audit_log_csv.php b/pandora_console/godmode/audit_log_csv.php index b5020bc9a4..b09b90f827 100644 --- a/pandora_console/godmode/audit_log_csv.php +++ b/pandora_console/godmode/audit_log_csv.php @@ -12,22 +12,19 @@ $ownDir = dirname(__FILE__) . '/'; $ownDir = str_replace("\\", "/", $ownDir); -require_once ($ownDir.'../include/config.php'); +require_once($ownDir . "../include/config.php"); + +require_once($config["homedir"] . "/include/functions.php"); +require_once($config["homedir"] . "/include/functions_db.php"); +require_once($config["homedir"] . "/include/auth/mysql.php"); global $config; -require_once ($config["homedir"]."/include/functions.php"); -require_once ($config["homedir"]."/include/functions_db.php"); -require_once ($config["homedir"]."/include/auth/mysql.php"); -error_reporting(E_ALL); -ini_set("display_errors", 1); - -if (! isset ($_SESSION["id_usuario"])) { - session_start (); - session_write_close (); +if (! isset($_SESSION["id_usuario"])) { + session_start(); + session_write_close(); } - // Login check if (!isset($_SESSION["id_usuario"])) { $config['id_user'] = null; @@ -36,94 +33,56 @@ else { $config['id_user'] = $_SESSION["id_usuario"]; } -if (!check_login()) { - db_pandora_audit("ACL Violation", "Trying to access graph builder"); - include ($config["homedir"]."/general/noaccess.php"); - return; -} +check_login(); -if (! check_acl ($config['id_user'], 0, "PM")) { - db_pandora_audit( "ACL Violation", - "Trying to access event viewer"); - require ("general/noaccess.php"); +if (! check_acl($config['id_user'], 0, "PM")) { + db_pandora_audit("ACL Violation", "Trying to access audit CSV export"); + require("general/noaccess.php"); exit; } -$tipo_log = get_parameter ("tipo_log", 'all'); -$user_filter = get_parameter('user_filter', 'all'); -$filter_text = get_parameter('filter_text', ''); -$filter_hours_old = get_parameter('filter_hours_old', 24); -$filter_ip = get_parameter('filter_ip', ''); +$filter_type = (string) get_parameter("filter_type"); +$filter_user = (string) get_parameter("filter_user"); +$filter_text = (string) get_parameter("filter_text"); +$filter_period = get_parameter("filter_period", null); +$filter_period = ($filter_period !== null) ? (int) $filter_period : 24; +$filter_ip = (string) get_parameter("filter_ip"); -$filter = 'WHERE 1 = 1'; +$filter = "1=1"; -if ($tipo_log != 'all') { - $filter .= " AND accion = '$tipo_log'"; -} -switch ($config['dbtype']) { - case "mysql": - if ($user_filter != 'all') { - $filter .= sprintf(' AND id_usuario = "%s"', $user_filter); - } - - $filter .= ' AND (accion LIKE "%' . $filter_text . '%" OR descripcion LIKE "%' . $filter_text . '%")'; - - if ($filter_ip != '') { - $filter .= sprintf(' AND ip_origen LIKE "%s"', $filter_ip); - } - break; - case "postgresql": - case "oracle": - if ($user_filter != 'all') { - $filter .= sprintf(' AND id_usuario = \'%s\'', $user_filter); - } - - $filter .= ' AND (accion LIKE \'%' . $filter_text . '%\' OR descripcion LIKE \'%' . $filter_text . '%\')'; - - if ($filter_ip != '') { - $filter .= sprintf(' AND ip_origen LIKE \'%s\'', $filter_ip); - } - break; +if (!empty($filter_type)) { + $filter .= sprintf (" AND accion = '%s'", $filter_type); } -if ($filter_hours_old != 0) { +if (!empty($filter_user)) { + $filter .= sprintf(" AND id_usuario = '%s'", $filter_user); +} + +if (!empty($filter_text)) { + $filter .= sprintf(" AND (accion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%')", $filter_text, $filter_text); +} + +if (!empty($filter_ip)) { + $filter .= sprintf(" AND ip_origen LIKE '%%%s%%'", $filter_ip); +} + +if (!empty($filter_period)) { switch ($config["dbtype"]) { case "mysql": - $filter .= ' AND fecha >= DATE_ADD(NOW(), INTERVAL -' . $filter_hours_old . ' HOUR)'; + $filter .= ' AND fecha >= DATE_ADD(NOW(), INTERVAL -' . $filter_period . ' HOUR)'; break; case "postgresql": - $filter .= ' AND fecha >= NOW() - INTERVAL \'' . $filter_hours_old . ' HOUR \''; + $filter .= ' AND fecha >= NOW() - INTERVAL \'' . $filter_period . ' HOUR \''; break; case "oracle": - $filter .= ' AND fecha >= (SYSTIMESTAMP - INTERVAL \'' . $filter_hours_old . '\' HOUR)'; + $filter .= ' AND fecha >= (SYSTIMESTAMP - INTERVAL \'' . $filter_period . '\' HOUR)'; break; } } -switch ($config["dbtype"]) { - case "mysql": - $sql = sprintf ("SELECT * - FROM tsesion - %s - ORDER BY fecha DESC", $filter); - break; - case "postgresql": - $sql = sprintf ("SELECT * - FROM tsesion - %s - ORDER BY fecha DESC", $filter); - break; - case "oracle": - $sql = sprintf ("SELECT * - FROM tsesion - %s - ORDER BY fecha DESC", $filter); - $result = oracle_recode_query ($sql, $set); - break; -} +$sql = sprintf( "SELECT * FROM tsesion WHERE %s ORDER BY fecha DESC", $filter); +$result = db_get_all_rows_sql($sql); -$result = db_get_all_rows_sql ($sql); - -print_audit_csv ($result); +print_audit_csv($result); ?> diff --git a/pandora_console/godmode/db/db_main.php b/pandora_console/godmode/db/db_main.php index 7246a62ed7..6b0138e908 100644 --- a/pandora_console/godmode/db/db_main.php +++ b/pandora_console/godmode/db/db_main.php @@ -197,7 +197,7 @@ echo ""; echo ''; echo '


'; -echo '(*) '.__('Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\'s very important to keep up-to-date database to get the best performance and results in Pandora'); +echo '(*) '.__("Please make sure your %s Server settings are correct and that the database maintenance daemon is running. It's very important to keep your database up to date in order to get the best performance and results from %s.", get_product_name(), get_product_name()); echo '
'; echo ''; ?> diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index c1c4a91cef..cda1a32143 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -193,7 +193,7 @@ if (defined('METACONSOLE')) { } else { - ui_print_page_header (__("Groups defined in Pandora"), + ui_print_page_header (__("Groups defined in %s", get_product_name()), "images/group.png", false, "", true, ""); $sec = 'gagente'; @@ -404,7 +404,8 @@ if (!empty($groups)) { $symbolBranchs = ' symbol_branch_' . $group['parent']; - $data = groups_get_group_to_list($group, $groups_count, $symbolBranchs); + $has_children = isset($sons[$group['id_grupo']]); + $data = groups_get_group_to_list($group, $groups_count, $symbolBranchs, $has_children); array_push ($table->data, $data); $table->rowstyle[$iterator] = ''; if ($group['id_grupo'] != 0) { diff --git a/pandora_console/godmode/groups/modu_group_list.php b/pandora_console/godmode/groups/modu_group_list.php index e9f538f619..508e6d32bd 100644 --- a/pandora_console/godmode/groups/modu_group_list.php +++ b/pandora_console/godmode/groups/modu_group_list.php @@ -52,7 +52,7 @@ if (is_ajax ()) { if (!is_metaconsole()) { // Header - ui_print_page_header (__("Module groups defined in Pandora"), "images/module_group.png", false, "", true, ""); + ui_print_page_header (__("Module groups defined in %s", get_product_name()), "images/module_group.png", false, "", true, ""); } $create_group = (bool) get_parameter ('create_group'); $update_group = (bool) get_parameter ('update_group'); diff --git a/pandora_console/godmode/massive/massive_add_action_alerts.php b/pandora_console/godmode/massive/massive_add_action_alerts.php index ca4c33e262..faec370e12 100755 --- a/pandora_console/godmode/massive/massive_add_action_alerts.php +++ b/pandora_console/godmode/massive/massive_add_action_alerts.php @@ -104,11 +104,12 @@ if ($add) { $results = false; } } - - db_pandora_audit("Massive management", "Add alert action " . json_encode($id_agents), false, false, 'Agents: ' . - json_encode($id_agents) . ' Alerts : ' . json_encode($agent_alerts) . - ' Fires Min: ' . $fires_min . ' Fires Max: ' . $fires_max . ' Actions: ' . implode(',',$actions)); - + $info = array('Agents' => implode(',',$id_agents), + 'Alerts' => addslashes(io_json_mb_encode($agent_alerts)), + 'Fires Min' => $fires_min, + 'Fires_max' => $fires_max, + 'Actions' => implode(',',$actions)); + db_pandora_audit("Massive management", "Add alert action " . json_encode($id_agents), false, false, json_encode($info)); ui_print_result_message ($results, __('Successfully added'), __('Could not be added')); } } diff --git a/pandora_console/godmode/massive/massive_copy_modules.php b/pandora_console/godmode/massive/massive_copy_modules.php index 3d51a85a51..aae7d4e2df 100755 --- a/pandora_console/godmode/massive/massive_copy_modules.php +++ b/pandora_console/godmode/massive/massive_copy_modules.php @@ -43,15 +43,18 @@ $do_operation = (bool) get_parameter ('do_operation'); if ($do_operation) { $result = agents_process_manage_config($source_id_agent, $destiny_id_agents); + + $info = array('Source agent' => $source_id_agent, + 'Destinity agent' => implode(",",$destiny_id_agents)); if ($result) { + + db_pandora_audit("Massive management", "Copy modules", false, - false, - 'Source agent: ' . json_encode($source_id_agent) . ' Destinity agent: ' . json_encode($destiny_id_agents)); + false, json_encode($info)); } else { db_pandora_audit("Massive management", - "Fail to try copy modules", false, false, - 'Source agent: ' . json_encode($source_id_agent) . ' Destinity agent: ' . json_encode($destiny_id_agents)); + "Fail to try copy modules", false, false,json_encode($info)); } } diff --git a/pandora_console/godmode/massive/massive_delete_action_alerts.php b/pandora_console/godmode/massive/massive_delete_action_alerts.php index a36363d19f..cc80206a20 100644 --- a/pandora_console/godmode/massive/massive_delete_action_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_action_alerts.php @@ -98,16 +98,15 @@ if ($delete) { } } } - + $info = array('Agents' => implode(',',$id_agents), + 'Alert templates' => implode(",",$id_alert_templates), + 'Actions' => implode(',',$actions)); + if ($results) { - db_pandora_audit("Massive management", "Delete alert action", false, false, - 'Agent: ' . json_encode($id_agents) . ' Alert templates: ' . json_encode($id_alert_templates) . - ' Actions: ' . implode(',',$actions)); + db_pandora_audit("Massive management", "Delete alert action", false, false,json_encode($info)); } else { - db_pandora_audit("Massive management", "Fail try to delete alert action", false, false, - 'Agent: ' . json_encode($id_agents) . ' Alert templates: ' . json_encode($id_alert_templates) . - ' Actions: ' . implode(',',$actions)); + db_pandora_audit("Massive management", "Fail try to delete alert action", false, false, json_encode($info)); } ui_print_result_message ($results, diff --git a/pandora_console/godmode/massive/massive_delete_agents.php b/pandora_console/godmode/massive/massive_delete_agents.php index 295411c92a..a9e8dcc08c 100755 --- a/pandora_console/godmode/massive/massive_delete_agents.php +++ b/pandora_console/godmode/massive/massive_delete_agents.php @@ -76,13 +76,12 @@ $delete = (bool) get_parameter_post ('delete'); if ($delete) { $result = process_manage_delete ($id_agents); + $info = '{"Agent":"'.implode(",",$id_agents).'"}'; if ($result) { - db_pandora_audit("Massive management", "Delete agent ", false, false, - 'Agent: ' . json_encode($id_agents)); + db_pandora_audit("Massive management", "Delete agent ", false, false,$info); } else { - db_pandora_audit("Massive management", "Fail try to delete agent", false, false, - 'Agent: ' . json_encode($id_agents)); + db_pandora_audit("Massive management", "Fail try to delete agent", false, false,$info); } } diff --git a/pandora_console/godmode/massive/massive_delete_alerts.php b/pandora_console/godmode/massive/massive_delete_alerts.php index fd7d04f860..eb0fd60dc3 100755 --- a/pandora_console/godmode/massive/massive_delete_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_alerts.php @@ -170,13 +170,14 @@ $delete = (bool) get_parameter_post ('delete'); if ($delete) { $result = process_manage_delete ($id_alert_template, $id_agents, $module_names); + $info = array('Agent' => implode(",",$id_agents), + 'Template' => $id_alert_template, 'Module' => implode(",",$module_names)); + if ($result) { - db_pandora_audit("Massive management", "Delete alert ", false, false, - 'Agent: ' . json_encode($id_agents) . ' Template: ' . $id_alert_template . ' Module: ' . $module_names); + db_pandora_audit("Massive management", "Delete alert ", false, false,json_encode($info)); } else { - db_pandora_audit("Massive management", "Fail try to delete alert", false, false, - 'Agent: ' . json_encode($id_agents) . ' Template: ' . $id_alert_template . ' Module: ' . $module_names); + db_pandora_audit("Massive management", "Fail try to delete alert", false, false,json_encode($info)); } } diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php index 580c86c26c..d1dd485db2 100755 --- a/pandora_console/godmode/massive/massive_delete_modules.php +++ b/pandora_console/godmode/massive/massive_delete_modules.php @@ -349,13 +349,12 @@ if ($delete) { $result = process_manage_delete ($modules_, $agents_, $modules_selection_mode); } + $info = array('Agent' => implode(",",$agents_), 'Module' => implode(",",$modules_)); if ($result) { - db_pandora_audit("Massive management", "Delete module ", false, false, - 'Agent: ' . json_encode($agents_) . ' Module: ' . $module_name); + db_pandora_audit("Massive management", "Delete module ", false, false, json_encode($info)); } else { - db_pandora_audit("Massive management", "Fail try to delete module", false, false, - 'Agent: ' . json_encode($agents_) . ' Module: ' . $module_name); + db_pandora_audit("Massive management", "Fail try to delete module", false, false, json_encode($info)); } } diff --git a/pandora_console/godmode/massive/massive_delete_profiles.php b/pandora_console/godmode/massive/massive_delete_profiles.php index daf9e91246..3d958d7a94 100644 --- a/pandora_console/godmode/massive/massive_delete_profiles.php +++ b/pandora_console/godmode/massive/massive_delete_profiles.php @@ -74,13 +74,12 @@ if ($delete_profiles) { } } + $info = array('Profiles' => implode(",",$profiles_id), 'Groups' => implode(",",$groups_id), 'Users' => implode(",",$users_id)); if ($result) { - db_pandora_audit("Massive management", "Delete profile ", false, false, - 'Profiles: ' . json_encode($profiles_id) . ' Groups: ' . $groups_id . ' Users: ' . $users_id); + db_pandora_audit("Massive management", "Delete profile ", false, false, json_encode($info)); } else { - db_pandora_audit("Massive management", "Fail try to delete profile", false, false, - 'Profiles: ' . json_encode($profiles_id) . ' Groups: ' . $groups_id . ' Users: ' . $users_id); + db_pandora_audit("Massive management", "Fail try to delete profile", false, false, json_encode($info)); } ui_print_result_message ($result, diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 99837ca824..849101f169 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -197,14 +197,18 @@ if ($update_agents) { } } + $info = array(); // Update Custom Fields foreach ($fields as $field) { + $info[$field['id_field']] = $field['name']; if (get_parameter_post ('customvalue_' . $field['id_field'], '') != '') { $key = $field['id_field']; $value = get_parameter_post ('customvalue_' . $field['id_field'], ''); $old_value = db_get_all_rows_filter('tagent_custom_data', array('id_agent' => $id_agent, 'id_field' => $key)); + + if ($old_value === false) { // Create custom field if not exist $result = db_process_sql_insert ('tagent_custom_data', @@ -225,11 +229,11 @@ if ($update_agents) { if ($result !== false) { - db_pandora_audit("Massive management", "Update agent " . $id_agent, false, false, json_encode($fields)); + db_pandora_audit("Massive management", "Update agent " . $id_agent, false, false, json_encode($info)); } else { if (isset ($id_agent)) { - db_pandora_audit("Massive management", "Try to update agent " . $id_agent, false, false, json_encode($fields)); + db_pandora_audit("Massive management", "Try to update agent " . $id_agent, false, false, json_encode($info)); } } @@ -503,7 +507,7 @@ foreach ($fields as $field) { . '.
' . __('The format is: [url=\'url to navigate\']\'text to show\'[/url]') . '.

' - . __('e.g.: [url=pandorafms.org]Pandora FMS Community[/url]') + . __('e.g.: [url=google.com]Google web search[/url]') , true); $custom_value = db_get_value_filter('description', 'tagent_custom_data', array('id_field' => $field['id_field'], 'id_agent' => $id_agente)); diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index b0889bd5ea..a7c8626fce 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -162,7 +162,7 @@ if ($update) { __('Successfully updated') . "(" . $success . "/" . $count . ")", $error_msg); - $info = 'Modules: ' . json_encode($modules_) . ' Agents: ' . json_encode($agents_); + $info = '{"Modules":"'.implode(",",$modules_).'","Agents":"'.implode(",",$agents_).'"}'; if ($success > 0) { db_pandora_audit("Massive management", "Edit module", false, false, $info); } diff --git a/pandora_console/godmode/massive/massive_enable_disable_alerts.php b/pandora_console/godmode/massive/massive_enable_disable_alerts.php index 7d799c1f70..aa82305865 100644 --- a/pandora_console/godmode/massive/massive_enable_disable_alerts.php +++ b/pandora_console/godmode/massive/massive_enable_disable_alerts.php @@ -77,7 +77,7 @@ switch ($action) { ui_print_result_message ($result, __('Successfully enabled'), __('Could not be enabled')); - $info = 'Alert: ' . json_encode($id_disabled_alerts); + $info = '{"Alert":"'.implode(",",$id_disabled_alerts).'"}'; if ($result) { db_pandora_audit("Massive management", "Enable alert", false, false, $info); } @@ -95,7 +95,7 @@ switch ($action) { ui_print_result_message ($result, __('Successfully disabled'), __('Could not be disabled')); - $info = 'Alert: ' . json_encode($id_enabled_alerts); + $info = '{"Alert":"'.implode(",",$id_enabled_alerts).'"}'; if ($result) { db_pandora_audit("Massive management", "Disable alert", false, false, $info); } diff --git a/pandora_console/godmode/massive/massive_standby_alerts.php b/pandora_console/godmode/massive/massive_standby_alerts.php index 6af3940680..496e72707c 100644 --- a/pandora_console/godmode/massive/massive_standby_alerts.php +++ b/pandora_console/godmode/massive/massive_standby_alerts.php @@ -77,7 +77,7 @@ switch($action) { ui_print_result_message ($result, __('Successfully set off standby'), __('Could not be set off standby')); - $info = 'Alert: ' . json_encode($id_standby_alerts); + $info = '{"Alert":"'.implode(",",$id_standby_alerts).'"}'; if ($result) { db_pandora_audit("Massive management", "Set off standby alerts", false, false, $info); } @@ -95,7 +95,7 @@ switch($action) { ui_print_result_message ($result, __('Successfully set standby'), __('Could not be set standby')); - $info = 'Alert: ' . json_encode($id_not_standby_alerts); + $info = '{"Alert":"'.implode(",",$id_not_standby_alerts).'"}'; if ($result) { db_pandora_audit("Massive management", "Set on standby alerts", false, false, $info); } diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 11f510349a..2735619b16 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -435,7 +435,7 @@ foreach ($rows as $row) { $menu_godmode["links"]["sub"] = $sub; // Update Manager -if (check_acl ($config['id_user'], 0, "PM")) { +if (check_acl ($config['id_user'], 0, "PM") && $config['enable_update_manager']) { $menu_godmode["messages"]["text"] = __('Update manager'); $menu_godmode["messages"]["sec2"] = ""; $menu_godmode["messages"]["id"] = "god-um_messages"; diff --git a/pandora_console/godmode/reporting/graph_builder.main.php b/pandora_console/godmode/reporting/graph_builder.main.php index 185f87f5ee..fcc654ab12 100644 --- a/pandora_console/godmode/reporting/graph_builder.main.php +++ b/pandora_console/godmode/reporting/graph_builder.main.php @@ -59,8 +59,6 @@ if ($edit_graph) { $graphInTgraph = db_get_row_sql("SELECT * FROM tgraph WHERE id_graph = " . $id_graph); $stacked = $graphInTgraph['stacked']; $period = $graphInTgraph['period']; - $name = $graphInTgraph['name']; - $description = $graphInTgraph['description']; $id_group = $graphInTgraph['id_group']; $width = $graphInTgraph['width']; $height = $graphInTgraph['height']; @@ -80,7 +78,6 @@ else { $id_agent = 0; $id_module = 0; $id_group = 0; - $name = "Pandora FMS combined graph"; $width = 550; $height = 210; $period = SECONDS_1DAY; diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 02cbb7283c..c844ccc4d3 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -290,18 +290,22 @@ if (!defined('METACONSOLE')) { else { $url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&recursion='.$recursion.'&ag_group='.$ag_group.'&search='.$search.'&pagination='.$pagination; } + + + + if ($own_info['is_admin'] || $vconsoles_read) { if($ag_group){ - $maps = visual_map_get_user_layouts (0,false,$filters,false); + $maps = visual_map_get_user_layouts ($config['id_user'],false,$filters,false); unset($filters['offset']); unset($filters['limit']); - $count_maps = visual_map_get_user_layouts (0,false,$filters,false); + $count_maps = visual_map_get_user_layouts ($config['id_user'],false,$filters,false); $total_maps = count($count_maps); }else{ - $maps = visual_map_get_user_layouts (0,false,$filters, false); + $maps = visual_map_get_user_layouts ($config['id_user'],false,$filters, false); unset($filters['offset']); unset($filters['limit']); - $count_maps = visual_map_get_user_layouts (0,false,$filters,false); + $count_maps = visual_map_get_user_layouts ($config['id_user'],false,$filters,false); $total_maps = count($count_maps); } } @@ -309,7 +313,7 @@ else { $maps = visual_map_get_user_layouts ($config['id_user'], false, $filters, false); unset($filters['offset']); unset($filters['limit']); - $count_maps = visual_map_get_user_layouts (0,false,$filters,false); + $count_maps = visual_map_get_user_layouts ($config['id_user'],false,$filters,false); $total_maps = count($count_maps); } if (!$maps && !is_metaconsole()) { diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 3730319347..4033e7616f 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -130,6 +130,7 @@ switch ($action) { $show_in_same_row = 0; $show_in_landscape = 0; $hide_notinit_agents = 0; + $priority_mode = REPORT_PRIORITY_MODE_OK; $server_name = ''; $server_id = 0; $dyn_height = 230; @@ -272,6 +273,9 @@ switch ($action) { $time_from = $item['time_from']; $time_to = $item['time_to']; $show_graph = $item['show_graph']; + $priority_mode = isset($style['priority_mode']) + ? $style['priority_mode'] + : REPORT_PRIORITY_MODE_OK; // 'top_n' filed will be reused for SLA sort option $sla_sorted_by = $item['top_n']; $period = $item['period']; @@ -884,7 +888,7 @@ You can of course remove the warnings, that's why we include the source and do n @@ -893,7 +897,7 @@ You can of course remove the warnings, that's why we include the source and do n @@ -1589,6 +1593,33 @@ You can of course remove the warnings, that's why we include the source and do n + + + + '; + html_print_radio_button ( + 'priority_mode', + REPORT_PRIORITY_MODE_OK, + '', + $priority_mode == REPORT_PRIORITY_MODE_OK, + '' + ); + + echo (''); + + echo __('Priority unknown mode').''; + html_print_radio_button ( + 'priority_mode', + REPORT_PRIORITY_MODE_UNKNOWN, + '', + $priority_mode == REPORT_PRIORITY_MODE_UNKNOWN, + '' + ); + ?> + + + @@ -2801,6 +2832,7 @@ function chooseType() { $("#row_visual_format").hide(); $("#row_show_in_landscape").hide(); $('#row_hide_notinit_agents').hide(); + $('#row_priority_mode').hide(); $("#row_module_group").hide(); $("#row_servers").hide(); $("#row_sort").hide(); @@ -2946,6 +2978,7 @@ function chooseType() { $("#sla_list").show(); $("#row_working_time").show(); $("#row_historical_db_check").hide(); + $("#row_priority_mode").show(); break; case 'module_histogram_graph': @@ -2963,6 +2996,7 @@ function chooseType() { $("#sla_list").show(); $("#row_working_time").show(); $("#row_sort").show(); + $("#row_priority_mode").show(); $("#row_historical_db_check").hide(); break; diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index 877d9eac78..81bc5b7286 100755 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -352,9 +352,8 @@ foreach ($items as $item) { $row[1] = get_report_name($item['type']); - $custom_graph_name = db_get_row_sql('select name from tgraph where id_graph = '.$item['id_gs']); - if($item['type'] == 'custom_graph'){ + $custom_graph_name = db_get_row_sql('select name from tgraph where id_graph = '.$item['id_gs']); $row[1] = get_report_name($item['type']).' ('.$custom_graph_name['name'].')'; } diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 5c16b60150..f07ee98f86 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1212,6 +1212,7 @@ switch ($action) { $style['show_in_same_row'] = get_parameter('show_in_same_row', 0); $style['show_in_landscape'] = get_parameter('show_in_landscape', 0); $style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0); + $style['priority_mode'] = get_parameter('priority_mode', REPORT_PRIORITY_MODE_OK); $style['dyn_height'] = get_parameter('dyn_height', 230); switch ($values['type']) { @@ -1552,6 +1553,7 @@ switch ($action) { $style['show_in_same_row'] = get_parameter('show_in_same_row', 0); $style['show_in_landscape'] = get_parameter('show_in_landscape', 0); $style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0); + $style['priority_mode'] = get_parameter('priority_mode', REPORT_PRIORITY_MODE_OK); $style['dyn_height'] = get_parameter('dyn_height', 230); switch ($values['type']) { diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index bf77d65d89..eb0e9b19b1 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -35,7 +35,6 @@ var img_handler_end; function toggle_advance_options_palette(close) { if ($("#advance_options").css('display') == 'none') { $("#advance_options").css('display', ''); - $("#advance_options *").css('display', ''); } else { $("#advance_options").css('display', 'none'); @@ -3763,6 +3762,8 @@ function updateDB_visual(type, idElement , values, event, top, left) { set_static_graph_status(idElement, values['image']); } } + $("#" + idElement).css('left', left + 'px'); + $("#" + idElement).css('top', top + 'px'); break; case 'percentile_item': case 'simple_value': @@ -3849,8 +3850,8 @@ function updateDB_visual(type, idElement , values, event, top, left) { function updateDB(type, idElement , values, event) { metaconsole = $("input[name='metaconsole']").val(); - var top = 0; - var left = 0; + var top = typeof(values.top) != 'undefined' ? values.top : 0; + var left = typeof(values.left) != 'undefined' ? values.left : 0; action = "update"; @@ -5021,8 +5022,10 @@ function showPreviewIcon(icon) { params.push("get_image_path=1"); params.push("img_src=" + imgBase + ".png"); params.push("page=include/ajax/skins.ajax"); - parameter.push ({name: "id_visual_console", - value: id_visual_console}); + params.push ({ + name: "id_visual_console", + value: id_visual_console + }); jQuery.ajax ({ data: params.join ("&"), type: 'POST', diff --git a/pandora_console/godmode/reporting/visual_console_builder.wizard.php b/pandora_console/godmode/reporting/visual_console_builder.wizard.php index 42d6d608cd..dea672b5eb 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.wizard.php +++ b/pandora_console/godmode/reporting/visual_console_builder.wizard.php @@ -328,7 +328,7 @@ $table->data["all_8"][2] = '' . __('Item in the map') . '' . '' . ui_print_help_tip( - __('The parent relationships in Pandora will be drawn in the map.'), true) . + __('The parenting relationships in %s will be drawn on the map.', get_product_name()), true) . ''; $table->data["all_8"][3] = '' . html_print_select($parents, 'item_in_the_map', 0, '', diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index 9725af7ef6..d33e0ee19c 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -186,11 +186,10 @@ if (!$modify){ ui_print_page_header (__('Manage recontask'), "", false, "recontask", true); } - $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; if ($is_windows) { echo '
'; - echo __('Warning') . ": " . __("By default, in Windows, Pandora FMS only support Standard network sweep, not custom scripts"); + echo __('Warning') . ": " . __("By default, in Windows, %s only support Standard network sweep, not custom scripts", get_product_name()); echo '
'; } diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index 2a45ce650e..aab4a3f918 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -82,7 +82,7 @@ elseif (isset($_GET["server_remote"])) { } else { // Header - ui_print_page_header (__('Pandora servers'), "images/gm_servers.png", false, "servers", true); + ui_print_page_header (__('%s servers', get_product_name()), "images/gm_servers.png", false, "servers", true); // Move SNMP modules back to the enterprise server if (isset($_GET["server_reset_snmp_enterprise"])) { diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index b8d130715f..93ed8841f7 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -561,7 +561,7 @@ else { $sec = 'advanced'; } else { - ui_print_page_header (__('Plugins registered in Pandora FMS'), "images/gm_servers.png", false, "", true); + ui_print_page_header (__('Plug-ins registered on %s', get_product_name()), "images/gm_servers.png", false, "", true); $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; if ($is_windows) { diff --git a/pandora_console/godmode/servers/recon_script.php b/pandora_console/godmode/servers/recon_script.php index 0d0965c10f..be8af68434 100644 --- a/pandora_console/godmode/servers/recon_script.php +++ b/pandora_console/godmode/servers/recon_script.php @@ -225,7 +225,7 @@ if (($create != "") OR ($view != "")) { echo ''; } else { - ui_print_page_header (__('Recon scripts registered in Pandora FMS'), "images/gm_servers.png", false, "", true); + ui_print_page_header (__('Recon scripts registered on %s', get_product_name()), "images/gm_servers.png", false, "", true); // Update reconscript if (isset($_GET["update_reconscript"])) { // if modified any parameter diff --git a/pandora_console/godmode/setup/gis_step_2.php b/pandora_console/godmode/setup/gis_step_2.php index 8a35de9e32..3de03185f2 100644 --- a/pandora_console/godmode/setup/gis_step_2.php +++ b/pandora_console/godmode/setup/gis_step_2.php @@ -123,6 +123,15 @@ switch ($action) { 'image_height' => $image_height ); break; + case 'WMS': + $url = get_parameter('url'); + $layers = get_parameter('layers'); + $mapConnectionData = array( + 'type' => 'WMS', + 'url' => $url, + 'layers' => $layers + ); + break; } //TODO VALIDATE PARAMETERS @@ -168,6 +177,7 @@ $table->data = array(); $types["OSM"] = __('Open Street Maps'); $types["Gmap"] = __('Google Maps'); $types["Static_Image"] = __('Static Image'); +$types["WMS"] = __('WMS Server'); $table->data[0][0] = __('Type') . ":"; $table->data[0][1] = html_print_select($types, 'sel_type', $mapConnection_type, "selMapConnectionType();", __('Please select the connection type'), 0, true); @@ -184,6 +194,7 @@ $bb_bottom = ''; $bb_top = ''; $image_width = ''; $image_height = ''; +$layers = ''; if ($mapConnectionData != null) { switch ($mapConnection_type) { case 'OSM': @@ -202,6 +213,10 @@ if ($mapConnectionData != null) { $image_width= $mapConnectionData['image_width']; $image_height= $mapConnectionData['image_height']; break; + case 'WMS': + $mapConnectionDataUrl = $mapConnectionData['url']; + $layers = $mapConnectionData['layers']; + break; } } // Open Street Map Connection @@ -260,6 +275,27 @@ $optionsConnectionImageTable = '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '
' . __("WMS Server URL") . '' . + '' . + html_print_input_text('url', $mapConnectionDataUrl, '', 90, 255, true) . + '
' . + __("Layers") . + ui_print_help_tip (__('Enter a single element or a comma separated list'), true) . + '' . + html_print_input_text('layers', $layers, '', 90, 255, true) . + '
'; + if ($mapConnectionData != null) { switch ($mapConnection_type) { case 'OSM': @@ -271,6 +307,9 @@ if ($mapConnectionData != null) { case 'Static_Image': $optionsConnectionTypeTable = $optionsConnectionImageTable; break; + case 'WMS': + $optionsConnectionTypeTable = $optionsConnectionWMSTable; + break; } } @@ -434,6 +473,8 @@ function refreshMapViewSecondStep() { objBaseLayers[0]['bb_top'] = $('input[name=bb_top]').val(); objBaseLayers[0]['image_width'] = $('input[name=image_width]').val(); objBaseLayers[0]['image_height'] = $('input[name=image_height]').val(); + // type WMS + objBaseLayers[0]['layers'] = $('input[name=layers]').val(); arrayControls = null; arrayControls = Array('Navigation', 'PanZoom', 'MousePosition'); @@ -487,6 +528,9 @@ function selMapConnectionType() { case 'Static_Image': $('#form_map_connection_type').html('').hide(); break; + case 'WMS': + $('#form_map_connection_type').html('').hide(); + break; default: $('#form_map_connection_type').html('').hide(); break; diff --git a/pandora_console/godmode/setup/license.php b/pandora_console/godmode/setup/license.php index e06a617ed1..a772c0e015 100644 --- a/pandora_console/godmode/setup/license.php +++ b/pandora_console/godmode/setup/license.php @@ -103,9 +103,9 @@ if (enterprise_installed()) { echo ''; echo '