From a94e45a7c7cf75e1f157bb4e276592fbc2dec9de Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 28 Jun 2021 16:44:26 +0200 Subject: [PATCH 01/15] fixed compatibility with newer systemd versions --- pandora_agents/unix/plugins/autodiscover | 35 ++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/pandora_agents/unix/plugins/autodiscover b/pandora_agents/unix/plugins/autodiscover index 78a70cddba..93c579b085 100644 --- a/pandora_agents/unix/plugins/autodiscover +++ b/pandora_agents/unix/plugins/autodiscover @@ -12,9 +12,15 @@ # ################################################### -from sys import argv, path, stderr, exit +from sys import argv +from sys import path +from sys import stderr +from sys import exit +from subprocess import Popen +from subprocess import PIPE +from subprocess import DEVNULL +from subprocess import getstatusoutput import psutil -from subprocess import * global module_list module_list = [] @@ -116,7 +122,7 @@ def service_module(name, value, parent=None): "value" : value, "module_parent" : parent, }] - #print ("service_module END "+str(now(0,1))) + #print ("service_module END "+str(now(0,1))) return (module) def get_memcpu (process, servicename): @@ -169,7 +175,7 @@ def win_service(servicelist, option=False, memcpu=False): if output != None and output["modules"]: modules += PSCheck.check_service(srvc.strip(), option, memcpu)["modules"] module_list.append(srvc) - winprocess = output["name"] + #winprocess = output["name"] #if memcpu == True: # modules += get_memcpu(winprocess) ## Only available for parent service ATM. else: @@ -189,18 +195,19 @@ def lnx_service(services_list, memcpu=False): status = None if sysctl == 0: ### Systemd available - syscall = Popen(["systemctl", "is-active", srvc], stdout=PIPE, + syscall = Popen(["systemctl", "show", "-pLoadState", "-pActiveState", srvc], stdout=PIPE, stdin=DEVNULL, universal_newlines=True) result = syscall.communicate() - result = result[0].strip().lower() - if result == "active": - modules += service_module(srvc, 1) - status = 1 - elif result == "inactive": - modules += service_module(srvc, 0) - status = 0 - elif result == "unknown": + srvstatus= result[0].strip().lower().split("\n") + if srvstatus[0] == "loadstate=not-found": next + else: + if srvstatus[1] == "activestate=active": + modules += service_module(srvc, 1) + status = 1 + elif srvstatus[1] == "activestate=inactive": + modules += service_module(srvc, 0) + status = 0 elif sysctl != 0 and servic == 0: ### Systemd not available, switch to service command syscall = Popen(["service", srvc, "status"], stdout=PIPE, @@ -382,7 +389,7 @@ def discover(osyst, servicelist): print ("--help") print ("\tPrints this help screen") print ("--default") - print ("\tRuns this tool with default monitoring.".format(argv[0])) + print ("\tRuns this tool with default monitoring.") print ("\tServices monitored by default for {}:".format(osyst)) print ("\t",", ".join(servicelist)) print ("--list \"\"") From e073e634b95952e9d87640dbac449e4b3e65765d Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 28 Jun 2021 17:15:50 +0200 Subject: [PATCH 02/15] Add a base pandora_ha.service. --- pandora_server/util/pandora_ha.service | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 pandora_server/util/pandora_ha.service diff --git a/pandora_server/util/pandora_ha.service b/pandora_server/util/pandora_ha.service new file mode 100644 index 0000000000..d513572f27 --- /dev/null +++ b/pandora_server/util/pandora_ha.service @@ -0,0 +1,11 @@ +[Unit] +Description=Pandora FMS Database HA Tool + +[Service] +Type=forking +PIDFile=/var/run/pandora_ha.pid +Restart=always +ExecStart=/usr/bin/pandora_ha -d -p /var/run/pandora_ha.pid /etc/pandora/pandora_server.conf + +[Install] +WantedBy=multi-user.target From 6f99eca5f7422f3d29565653412be3e394e28289 Mon Sep 17 00:00:00 2001 From: rafael Date: Mon, 28 Jun 2021 18:12:13 +0200 Subject: [PATCH 03/15] addapt open install script for EL8 --- .../pandora_deploy_community_el8.sh | 614 ++++++++++++++++++ 1 file changed, 614 insertions(+) create mode 100644 extras/deploy-scripts/pandora_deploy_community_el8.sh diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh new file mode 100644 index 0000000000..a92930e7c4 --- /dev/null +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -0,0 +1,614 @@ +#!/bin/bash + +# define variables +PANDORA_CONSOLE=/var/www/html/pandora_console +CONSOLE_PATH=/var/www/html/pandora_console +PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf +DBHOST=127.0.0.1 +DBNAME=pandora +DBUSER=pandora +DBPASS=pandora +DBPORT=3306 +S_VERSION='2021072801' +LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" + +# Ansi color code variables +red="\e[0;91m" +green="\e[0;92m" +cyan="\e[0;36m" +reset="\e[0m" + +# Functions + +execute_cmd () { + local cmd="$1" + local msg="$2" + + echo -e "${cyan}$msg...${reset}" + $cmd &>> "$LOGFILE" + if [ $? -ne 0 ]; then + echo -e "${red}Fail${reset}" + [ "$3" ] && echo "$3" + echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE" + rm -rf "$HOME"/pandora_deploy_tmp &>> "$LOGFILE" + exit 1 + else + echo -e "\e[1A\e ${cyan}$msg...${reset} ${green}OK${reset}" + return 0 + fi +} + +check_cmd_status () { + if [ $? -ne 0 ]; then + echo -e "${red}Fail${reset}" + [ "$1" ] && echo "$1" + echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE" + rm -rf "$HOME"/pandora_deploy_tmp/*.rpm* &>> "$LOGFILE" + exit 1 + else + echo -e "${green}OK${reset}" + return 0 + fi +} + +check_pre_pandora () { + export MYSQL_PWD=$DBPASS + + echo -en "${cyan}Checking environment ... ${reset}" + rpm -qa | grep pandora &>> /dev/null && local fail=true + [ -d "$CONSOLE_PATH" ] && local fail=true + [ -f /usr/bin/pandora_server ] && local fail=true + echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true + + [ ! $fail ] + check_cmd_status 'Error there is a current Pandora FMS installation on this node, please remove it to execute a clean install' +} + +check_repo_connection () { + execute_cmd "ping -c 2 8.8.8.8" "Checking internet connection" + execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo" + execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo" +} + +check_root_permissions () { + echo -en "${cyan}Checking root account... ${reset}" + if [ "$(whoami)" != "root" ]; then + echo -e "${red}Fail${reset}" + echo "Please use a root account or sudo for installing PandoraFMS" + echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE" + exit 1 + + else + echo -e "${green}OK${reset}" + fi +} + +## Main +echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION" + +# Centos Version +if [ ! "$(grep -i centos /etc/redhat-release)" ]; then + printf "${red}Error this is not a Centos Base system, this installer is compatible with Centos systems only${reset}\n" + exit 1 +fi + +execute_cmd "grep -i centos /etc/redhat-release" "Checking Centos" 'Error This is not a Centos Base system' + +echo -en "${cyan}Check Centos Version...${reset}" +[ $(sed -nr 's/VERSION_ID+=\s*"([0-9])"$/\1/p' /etc/os-release) -eq '8' ] +check_cmd_status 'Error OS version, Centos 8 is expected' + +# initialice logfile +execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE" +echo "Community installer version: $S_VERSION" >> "$LOGFILE" + +# Pre checks +# Root permisions +check_root_permissions + +# Pre installed pandora +check_pre_pandora + +# Connectivity +check_repo_connection + +# Systemd +execute_cmd "systemctl status" "Checking SystemD" 'This is not a SystemD enable system, if tryng to use in a docker env please check: https://github.com/pandorafms/pandorafms/tree/develop/extras/docker/centos8' + +# Check memomry greather or equal to 2G +execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]" 'Checking memory (required: 2 GB)' + +# Check disk size at least 10 Gb free space +execute_cmd "[ $(df -BM / | tail -1 | awk '{print $4}' | tr -d M) -gt 10000 ]" 'Checking Disk (required: 10 GB free min)' + +# Execute tools check +execute_cmd "awk --version" 'Checking needed tools: awk' +execute_cmd "grep --version" 'Checking needed tools: grep' +execute_cmd "sed --version" 'Checking needed tools: sed' +execute_cmd "dnf --version" 'Checking needed tools: dnf' + +# Creating working directory +rm -rf "$HOME"/pandora_deploy_tmp/*.rpm* &>> "$LOGFILE" +mkdir "$HOME"/pandora_deploy_tmp &>> "$LOGFILE" +execute_cmd "cd $HOME/pandora_deploy_tmp" "Moving to workspace: $HOME/pandora_deploy_tmp" + +#Installing wget +execute_cmd "dnf install -y wget" "Installing wget" + +#Installing extra repositiries +extra_repos=" \ + tar \ + dnf-utils \ + epel-release \ + http://rpms.remirepo.net/enterprise/remi-release-8.rpm \ + https://repo.percona.com/yum/percona-release-latest.noarch.rpm" + +execute_cmd "dnf install -y $extra_repos" "Installing extra repositories" +execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools" +execute_cmd "dnf module reset -y php " "Disabling standard PHP module" +execute_cmd "dnf module install -y php:remi-7.3" "Configuring PHP" + +# Install percona Database +execute_cmd "dnf module disable -y mysql" "Disabiling mysql module" +rm -rf /etc/my.cnf +execute_cmd "dnf install -y Percona-Server-server-57" "Installing Percona Server" + +# Console dependencies +console_dependencies=" \ + php \ + postfix \ + php-mcrypt \ + php-cli \ + php-gd \ + php-curl \ + php-session \ + php-mysqlnd \ + php-ldap \ + php-zip \ + php-zlib \ + php-fileinfo \ + php-gettext \ + php-snmp \ + php-mbstring \ + php-pecl-zip \ + php-xmlrpc \ + libxslt \ + wget \ + php-xml \ + httpd \ + mod_php \ + atk \ + avahi-libs \ + cairo \ + cups-libs \ + fribidi \ + gd \ + gdk-pixbuf2 \ + ghostscript \ + graphite2 \ + graphviz \ + gtk2 \ + harfbuzz \ + hicolor-icon-theme \ + hwdata \ + jasper-libs \ + lcms2 \ + libICE \ + libSM \ + libXaw \ + libXcomposite \ + libXcursor \ + libXdamage \ + libXext \ + libXfixes \ + libXft \ + libXi \ + libXinerama \ + libXmu \ + libXrandr \ + libXrender \ + libXt \ + libXxf86vm \ + libcroco \ + libdrm \ + libfontenc \ + libglvnd \ + libglvnd-egl \ + libglvnd-glx \ + libpciaccess \ + librsvg2 \ + libthai \ + libtool-ltdl \ + libwayland-client \ + libwayland-server \ + libxshmfence \ + mesa-libEGL \ + mesa-libGL \ + mesa-libgbm \ + mesa-libglapi \ + pango \ + pixman \ + xorg-x11-fonts-75dpi \ + xorg-x11-fonts-misc \ + poppler-data \ + php-yaml \ + http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ + http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \ + http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm" +execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies" + +# Server dependencies +server_dependencies=" \ + perl \ + vim \ + fping \ + perl-IO-Compress \ + nmap \ + sudo \ + perl-Time-HiRes \ + nfdump \ + net-snmp-utils \ + perl(NetAddr::IP) \ + perl(Sys::Syslog) \ + perl(DBI) \ + perl(XML::Simple) \ + perl(Geo::IP) \ + perl(IO::Socket::INET6) \ + perl(XML::Twig) \ + expect \ + openssh-clients \ + http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ + http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm" +execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies" + +# SDK VMware perl dependencies +vmware_dependencies=" \ + perl-Net-HTTP \ + perl-libwww-perl \ + openssl-devel \ + perl-Crypt-CBC \ + perl-Bytes-Random-Secure \ + perl-Crypt-Random-Seed \ + perl-Math-Random-ISAAC \ + perl-JSON \ + http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm \ + http://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm \ + http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm" +execute_cmd "dnf install -y $vmware_dependencies" "Installing SDK VMware perl dependencies" + +# Instant client Oracle +oracle_dependencies=" \ + https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm \ + https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm" +execute_cmd "dnf install -y $oracle_dependencies" "Installing Oracle Instant client" + +ipam_dependencies=" \ + http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ + perl(NetAddr::IP) \ + perl(Sys::Syslog) \ + perl(DBI) \ + perl(XML::Simple) \ + perl(Geo::IP) \ + perl(IO::Socket::INET6) \ + perl(XML::Twig)" +execute_cmd "dnf install -y $ipam_dependencies" "Installing Oracle Instant client" + +# Disabling SELINUX and firewalld +setenforce 0 &>> "$LOGFILE" +sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config &>> "$LOGFILE" +systemctl disable firewalld --now &>> "$LOGFILE" + + +#Configuring Database +execute_cmd "systemctl start mysqld" "Starting database engine" +export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev) +echo """ + SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!'); + UNINSTALL PLUGIN validate_password; + SET PASSWORD FOR 'root'@'localhost' = PASSWORD('pandora'); + """ | mysql --connect-expired-password -uroot + +export MYSQL_PWD=$DBPASS +echo -en "${cyan}Creating Pandora FMS database...${reset}" +echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST +check_cmd_status 'Error creating database pandora, is this an empty node? if you have a previus installation please contact with support.' + +echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%' identified by \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST + +#Generating my.cnf +POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g") +cat > /etc/my.cnf << EO_CONFIG_F +[mysqld] +datadir=/var/lib/mysql +socket=/var/lib/mysql/mysql.sock +user=mysql +character-set-server=utf8 +skip-character-set-client-handshake +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 +# Mysql optimizations for Pandora FMS +# Please check the documentation in http://pandorafms.com for better results + +max_allowed_packet = 64M +innodb_buffer_pool_size = $POOL_SIZE +innodb_lock_wait_timeout = 90 +innodb_file_per_table +innodb_flush_log_at_trx_commit = 0 +innodb_flush_method = O_DIRECT +innodb_log_file_size = 64M +innodb_log_buffer_size = 16M +innodb_io_capacity = 100 +thread_cache_size = 8 +thread_stack = 256K +max_connections = 100 + +key_buffer_size=4M +read_buffer_size=128K +read_rnd_buffer_size=128K +sort_buffer_size=128K +join_buffer_size=4M + +query_cache_type = 1 +query_cache_size = 64M +query_cache_min_res_unit = 2k +query_cache_limit = 256K + +sql_mode="" + +[mysqld_safe] +log-error=/var/log/mysqld.log +pid-file=/var/run/mysqld/mysqld.pid + +EO_CONFIG_F + +execute_cmd "systemctl restart mysqld" "Configuring database engine" + +# Downloading Pandora Packages +execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm" "Downloading Pandora FMS Server community" +execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm" "Downloading Pandora FMS Console community" +execute_cmd "wget http://firefly.artica.es/centos7/pandorafms_agent_unix-7.0NG.751_x86_64.rpm" "Downloading Pandora FMS Agent community" + +# Install Pandora +execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages" + +# Copy gotty utility +execute_cmd "wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' +tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE +execute_cmd "mv gotty /usr/bin/" 'Installing gotty util' + +# Enable Services +execute_cmd "systemctl enable mysqld --now" "Enabling Database service" +execute_cmd "systemctl enable httpd --now" "Enabling HTTPD service" +execute_cmd "systemctl enable php-fpm --now" "Enabling PHP-FPM service" + + +# Populate Database +echo -en "${cyan}Loading pandoradb.sql to $DBNAME database...${reset}" +mysql -u$DBUSER -P$DBPORT -h$DBHOST $DBNAME < $PANDORA_CONSOLE/pandoradb.sql &>> "$LOGFILE" +check_cmd_status 'Error Loading database schema' + +echo -en "${cyan}Loading pandoradb_data.sql to $DBNAME database...${reset}" +mysql -u$DBUSER -P$DBPORT -h$DBHOST $DBNAME < $PANDORA_CONSOLE/pandoradb_data.sql &>> "$LOGFILE" +check_cmd_status 'Error Loading database schema data' + +# Configure console +cat > $CONSOLE_PATH/include/config.php << EO_CONFIG_F + /etc/httpd/conf.d/pandora.conf << EO_CONFIG_F + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + + +EO_CONFIG_F + +# Add ws proxy options to apache. +cat >> /etc/httpd/conf.modules.d/00-proxy.conf << 'EO_HTTPD_MOD' +LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so + +EO_HTTPD_MOD + +cat >> /etc/httpd/conf.d/wstunnel.conf << 'EO_HTTPD_WSTUNNEL' +ProxyRequests Off + + Require all granted + + +ProxyPass /ws ws://127.0.0.1:8080 +ProxyPassReverse /ws ws://127.0.0.1:8080 + +EO_HTTPD_WSTUNNEL + +# Temporal quitar htaccess +sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/images/.htaccess +sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess + +# Fixing console permissions +chmod 600 $CONSOLE_PATH/include/config.php +chown apache. $CONSOLE_PATH/include/config.php +mv $CONSOLE_PATH/install.php $CONSOLE_PATH/install.done + +# Prepare php.ini +sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini +sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini +sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini +sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini + +cat > /var/www/html/index.html << EOF_INDEX + +EOF_INDEX + +execute_cmd "systemctl restart httpd" "Restarting httpd after configuration" +execute_cmd "systemctl restart php-fpm" "Restarting php-fpm after configuration" + +# prepare snmptrapd +cat > /etc/snmp/snmptrapd.conf << EOF +authCommunity log public +disableAuthorization yes +EOF + +# Prepare Server conf +sed -i -e "s/^dbhost.*/dbhost $DBHOST/g" $PANDORA_SERVER_CONF +sed -i -e "s/^dbname.*/dbname $DBNAME/g" $PANDORA_SERVER_CONF +sed -i -e "s/^dbuser.*/dbuser $DBUSER/g" $PANDORA_SERVER_CONF +sed -i -e "s|^dbpass.*|dbpass $DBPASS|g" $PANDORA_SERVER_CONF +sed -i -e "s/^dbport.*/dbport $DBPORT/g" $PANDORA_SERVER_CONF + +# Set Oracle environment for pandora_server +cat > /etc/pandora/pandora_server.env << 'EOF_ENV' +#!/bin/bash +VERSION=19.8 +export PATH=$PATH:$HOME/bin:/usr/lib/oracle/$VERSION/client64/bin +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/$VERSION/client64/lib +export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64 +EOF_ENV + +# Kernel optimization +cat >> /etc/sysctl.conf < /etc/logrotate.d/pandora_server < /etc/logrotate.d/pandora_agent <> "$LOGFILE" + +# Configure websocket to be started at start. +systemctl enable pandora_websocket_engine &>> "$LOGFILE" + +# Enable pandora ha service +systemctl enable pandora_server --now &>> "$LOGFILE" +execute_cmd "systemctl start pandora_server" "Starting Pandora FMS Server" + +# starting tentacle server +systemctl enable tentacle_serverd &>> "$LOGFILE" +execute_cmd "service tentacle_serverd start" "Starting Tentacle Server" + +# Enabling condole cron +execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron" +echo "* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab +## Enabling agent +systemctl enable pandora_agent_daemon &>> "$LOGFILE" +execute_cmd "systemctl start pandora_agent_daemon" "starting Pandora FMS Agent" + +#SSH banner +[ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) + +cat > /etc/issue.net << EOF_banner + +Welcome to Pandora FMS appliance on CentOS +------------------------------------------ +Go to Public http://$ipplublic/pandora_console$to to login web console +$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}') + +You can find more information at http://pandorafms.com + +EOF_banner + +rm -f /etc/issue +ln -s /etc/issue.net /etc/issue + +echo 'Banner /etc/issue.net' >> /etc/ssh/sshd_config + +# Remove temporary files +execute_cmd "echo done" "Pandora FMS Community installed" +cd +execute_cmd "rm -rf $HOME/pandora_deploy_tmp" "Removing temporary files" + +# Print nice finish message +GREEN='\033[01;32m' +NONE='\033[0m' +printf " -> Go to Public ${green}http://"$ipplublic"/pandora_console${reset} to manage this server" +ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v -e "172.1[0-9].0.1" | awk '{print $2}' | awk -v g=$GREEN -v n=$NONE -F '/' '{printf "\n -> Go to Local "g"http://"$1"/pandora_console"n" to manage this server \n -> Use this credentials to login in the console "g"[ User: admin / Password: pandora ]"n" \n"}' \ No newline at end of file From f403e3a43bc44485801328ded072b96c026d8fcc Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 29 Jun 2021 14:34:09 +0200 Subject: [PATCH 04/15] Avoid trial users from using UMC --- pandora_console/godmode/um_client/index.php | 35 +++++++++++++++---- .../lib/UpdateManager/UI/Manager.php | 1 + 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/um_client/index.php b/pandora_console/godmode/um_client/index.php index 3b3dc708fe..8887309d76 100644 --- a/pandora_console/godmode/um_client/index.php +++ b/pandora_console/godmode/um_client/index.php @@ -69,6 +69,13 @@ if (empty($license) === true) { $license = 'PANDORA-FREE'; } +$mode_str = ''; +if ($mode === Manager::MODE_ONLINE) { + $mode_str = 'online'; +} else if ($mode === Manager::MODE_OFFLINE) { + $mode_str = 'offline'; +} + if (function_exists('enterprise_hook') === true) { enterprise_include_once('/include/functions_license.php'); $license_data = enterprise_hook('license_get_info'); @@ -93,13 +100,6 @@ if (function_exists('enterprise_hook') === true) { } if ($days_to_expiry < 0) { - $mode_str = ''; - if ($mode === Manager::MODE_ONLINE) { - $mode_str = 'online'; - } else if ($mode === Manager::MODE_OFFLINE) { - $mode_str = 'offline'; - } - ui_print_warning_message( __( 'You cannot use update manager %s. This license has expired %d days ago. Please update your license or disable enterprise section by moving enterprise directory to another location and try again.', @@ -109,6 +109,27 @@ if (function_exists('enterprise_hook') === true) { ); return; } + + if (rtrim($license_data['licensed_to']) === Manager::PANDORA_TRIAL_ISSUER) { + if (function_exists('get_product_name') === true) { + $product_name = get_product_name(); + } else { + $product_name = 'Pandora FMS'; + } + + ui_print_info_message( + __( + 'You cannot use update manager %s. This license is a trial license to test all %s features. Please update your license to unlock all %s features.', + $mode_str, + $product_name, + $product_name + ) + ); + return; + } else { + hd('['.$license_data['licensed_to'].']', true); + hd(Manager::PANDORA_TRIAL_ISSUER, true); + } } else { $license_data = []; $license_data['count_enabled'] = db_get_value( diff --git a/pandora_console/godmode/um_client/lib/UpdateManager/UI/Manager.php b/pandora_console/godmode/um_client/lib/UpdateManager/UI/Manager.php index 1060694bab..5d79328152 100644 --- a/pandora_console/godmode/um_client/lib/UpdateManager/UI/Manager.php +++ b/pandora_console/godmode/um_client/lib/UpdateManager/UI/Manager.php @@ -40,6 +40,7 @@ class Manager const MODE_ONLINE = 0; const MODE_OFFLINE = 1; const MODE_REGISTER = 2; + const PANDORA_TRIAL_ISSUER = 'Enterprise Trial License(Pandora FMS )'; /** * Current mode (view). From 3bd0464c864717c9b72be86bb2be0d6de36a181c Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 29 Jun 2021 14:35:22 +0200 Subject: [PATCH 05/15] removed unwanted traces --- pandora_console/godmode/um_client/index.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/pandora_console/godmode/um_client/index.php b/pandora_console/godmode/um_client/index.php index 8887309d76..20f209e643 100644 --- a/pandora_console/godmode/um_client/index.php +++ b/pandora_console/godmode/um_client/index.php @@ -126,9 +126,6 @@ if (function_exists('enterprise_hook') === true) { ) ); return; - } else { - hd('['.$license_data['licensed_to'].']', true); - hd(Manager::PANDORA_TRIAL_ISSUER, true); } } else { $license_data = []; From 8ac3faba25180c399d971810cbf3d56d7c901c37 Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 29 Jun 2021 17:36:05 +0200 Subject: [PATCH 06/15] added versioning --- pandora_agents/unix/plugins/autodiscover | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_agents/unix/plugins/autodiscover b/pandora_agents/unix/plugins/autodiscover index 93c579b085..aff73a0244 100644 --- a/pandora_agents/unix/plugins/autodiscover +++ b/pandora_agents/unix/plugins/autodiscover @@ -24,6 +24,7 @@ import psutil global module_list module_list = [] +version = "1.1" ######################################################################################### @@ -382,7 +383,7 @@ def discover(osyst, servicelist): elif osyst == "Linux": lnx_service(servicelist, memcpu) else: - print ("\nPandora FMS Autodiscovery plugin.") + print ("\nPandora FMS Autodiscovery plugin v{}".format(version)) print ("Checks the status of the services in list and monitors CPU and Memory for each of them.\n") print ("Usage:") print ("{} [options] [--usage]".format(argv[0])) From 7dc2245f2eeee563eb345f120e36b02f47658566 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 30 Jun 2021 01:00:32 +0200 Subject: [PATCH 07/15] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index e1bd98cb41..8dab0e78e7 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.755-210629 +Version: 7.0NG.755-210630 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 d393be8b63..a9a4bcb2bc 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.755-210629" +pandora_version="7.0NG.755-210630" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 66c5168893..f3614bcc4f 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.755'; -use constant AGENT_BUILD => '210629'; +use constant AGENT_BUILD => '210630'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index c98ad7ca41..08478b3bc0 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210629 +%define release 210630 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 87508f3ac7..2ae97d9d35 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210629 +%define release 210630 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 e40fc82ab2..988d3c6fcf 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210629" +PI_BUILD="210630" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c09500e9b6..dc4c043dd5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210629} +{210630} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9cdabbdb16..87e2faffd0 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.755 Build 210629") +#define PANDORA_VERSION ("7.0NG.755 Build 210630") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e5b3c08a49..18aa533e54 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.755(Build 210629))" + VALUE "ProductVersion", "(7.0NG.755(Build 210630))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8439911f32..50cf378b13 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.755-210629 +Version: 7.0NG.755-210630 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 e12ea9829f..529c6e7d0a 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.755-210629" +pandora_version="7.0NG.755-210630" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d7329e5a93..048678b26d 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210629'; +$build_version = 'PC210630'; $pandora_version = 'v7.0NG.755'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 14ed642c76..ae627027f6 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index a58bd3e698..d18362de71 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210629 +%define release 210630 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 1c0250d504..532749823d 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210629 +%define release 210630 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index e57f1ad6b7..57f2d13643 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210629" +PI_BUILD="210630" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 633ee7454b..af06e2a27e 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.755 Build 210629"; +my $version = "7.0NG.755 Build 210630"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index e19dd911f9..f2bbe92c23 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.755 Build 210629"; +my $version = "7.0NG.755 Build 210630"; # save program name for logging my $progname = basename($0); From 911d9fe8fe2b47f345d6c57e8a3a600d98619cc8 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 1 Jul 2021 01:00:09 +0200 Subject: [PATCH 08/15] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8dab0e78e7..35256fcbf4 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.755-210630 +Version: 7.0NG.755-210701 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 a9a4bcb2bc..1cf037b403 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.755-210630" +pandora_version="7.0NG.755-210701" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f3614bcc4f..0f9a564377 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.755'; -use constant AGENT_BUILD => '210630'; +use constant AGENT_BUILD => '210701'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 08478b3bc0..aa37c27e58 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210630 +%define release 210701 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 2ae97d9d35..3ce602a9be 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210630 +%define release 210701 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 988d3c6fcf..57577368fd 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210630" +PI_BUILD="210701" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index dc4c043dd5..9417215103 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210630} +{210701} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 87e2faffd0..b485785466 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.755 Build 210630") +#define PANDORA_VERSION ("7.0NG.755 Build 210701") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 18aa533e54..533b281fda 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.755(Build 210630))" + VALUE "ProductVersion", "(7.0NG.755(Build 210701))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 50cf378b13..9227303a28 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.755-210630 +Version: 7.0NG.755-210701 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 529c6e7d0a..968fc3077a 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.755-210630" +pandora_version="7.0NG.755-210701" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 048678b26d..f88c441863 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210630'; +$build_version = 'PC210701'; $pandora_version = 'v7.0NG.755'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index ae627027f6..f4b961cdb4 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index d18362de71..856ea5f09c 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210630 +%define release 210701 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 532749823d..4127f53d6e 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210630 +%define release 210701 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 57f2d13643..96a8385f19 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210630" +PI_BUILD="210701" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index af06e2a27e..320035ea29 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.755 Build 210630"; +my $version = "7.0NG.755 Build 210701"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index f2bbe92c23..aa31bcaf96 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.755 Build 210630"; +my $version = "7.0NG.755 Build 210701"; # save program name for logging my $progname = basename($0); From b3b88e3b94e8a23bc3d1a7d9c818931c43f13f59 Mon Sep 17 00:00:00 2001 From: rafael Date: Thu, 1 Jul 2021 10:56:45 +0200 Subject: [PATCH 09/15] adding rocky linux support to install script --- .../pandora_deploy_community_el8.sh | 73 +++++++++---------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index a92930e7c4..b5b2935192 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -9,7 +9,7 @@ DBNAME=pandora DBUSER=pandora DBPASS=pandora DBPORT=3306 -S_VERSION='2021072801' +S_VERSION='2021070101' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" # Ansi color code variables @@ -53,7 +53,7 @@ check_cmd_status () { check_pre_pandora () { export MYSQL_PWD=$DBPASS - + echo -en "${cyan}Checking environment ... ${reset}" rpm -qa | grep pandora &>> /dev/null && local fail=true [ -d "$CONSOLE_PATH" ] && local fail=true @@ -87,16 +87,15 @@ check_root_permissions () { echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION" # Centos Version -if [ ! "$(grep -i centos /etc/redhat-release)" ]; then - printf "${red}Error this is not a Centos Base system, this installer is compatible with Centos systems only${reset}\n" +if [ ! "$(grep -Ei 'centos|rocky' /etc/redhat-release)" ]; then + printf "\n ${red}Error this is not a Centos/Rocky Base system, this installer is compatible with Centos/Rocky systems only${reset}\n" exit 1 fi -execute_cmd "grep -i centos /etc/redhat-release" "Checking Centos" 'Error This is not a Centos Base system' echo -en "${cyan}Check Centos Version...${reset}" -[ $(sed -nr 's/VERSION_ID+=\s*"([0-9])"$/\1/p' /etc/os-release) -eq '8' ] -check_cmd_status 'Error OS version, Centos 8 is expected' +[ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ] +check_cmd_status 'Error OS version, Centos/Rocky 8+ is expected' # initialice logfile execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE" @@ -256,7 +255,7 @@ server_dependencies=" \ perl(IO::Socket::INET6) \ perl(XML::Twig) \ expect \ - openssh-clients \ + openssh-clients \ http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm" execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies" @@ -511,46 +510,46 @@ chown pandora:apache /var/log/pandora chmod g+s /var/log/pandora cat > /etc/logrotate.d/pandora_server < /etc/logrotate.d/pandora_agent < Date: Tue, 29 Jun 2021 18:27:10 +0200 Subject: [PATCH 10/15] Add the AlertServer to the repo. The new AlertServer allows alerts to be queued and executed outside the data processing pipeline. Ref. pandora_enterprise#7127. --- pandora_console/extras/mr/48.sql | 10 + .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 15 +- pandora_console/include/constants.php | 1 + pandora_console/include/functions_servers.php | 13 ++ pandora_console/pandoradb.sql | 13 ++ pandora_server/bin/pandora_server | 2 + pandora_server/conf/pandora_server.conf.new | 9 + pandora_server/lib/PandoraFMS/AlertServer.pm | 201 ++++++++++++++++++ pandora_server/lib/PandoraFMS/Config.pm | 13 ++ pandora_server/lib/PandoraFMS/Core.pm | 34 ++- pandora_server/lib/PandoraFMS/Tools.pm | 3 + 11 files changed, 310 insertions(+), 4 deletions(-) create mode 100644 pandora_server/lib/PandoraFMS/AlertServer.pm diff --git a/pandora_console/extras/mr/48.sql b/pandora_console/extras/mr/48.sql index 153b9aa98d..a0e1f0756f 100644 --- a/pandora_console/extras/mr/48.sql +++ b/pandora_console/extras/mr/48.sql @@ -1,5 +1,15 @@ START TRANSACTION; +CREATE TABLE IF NOT EXISTS `talert_execution_queue` ( + `id` int(10) unsigned NOT NULL auto_increment, + `id_alert_template_module` int(10) unsigned NOT NULL, + `alert_mode` tinyint(1) NOT NULL, + `data` mediumtext NOT NULL, + `extra_macros` text, + `utimestamp` bigint(20) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + UPDATE `tlink` SET `link` = 'https://pandorafms.com/manual/' WHERE `id_link` = 0000000001; UPDATE pandora.tuser_task 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 8f888b3a52..59d0909d8a 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 @@ -4042,4 +4042,17 @@ DELETE FROM `tconfig` WHERE `token` = 'ipam_recon_script_id'; ALTER TABLE `tperfil` DROP COLUMN `incident_view`; ALTER TABLE `tperfil` DROP COLUMN `incident_edit`; -ALTER TABLE `tperfil` DROP COLUMN `incident_management`; \ No newline at end of file +ALTER TABLE `tperfil` DROP COLUMN `incident_management`; + +-- ----------------------------------------------------- +-- Table `talert_execution_queue` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `talert_execution_queue` ( + `id` int(10) unsigned NOT NULL auto_increment, + `id_alert_template_module` int(10) unsigned NOT NULL, + `alert_mode` tinyint(1) NOT NULL, + `data` mediumtext NOT NULL, + `extra_macros` text, + `utimestamp` bigint(20) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index c6c4a190e4..cc06711ac9 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -422,6 +422,7 @@ define('SERVER_TYPE_WUX', 17); define('SERVER_TYPE_SYSLOG', 18); define('SERVER_TYPE_AUTOPROVISION', 19); define('SERVER_TYPE_MIGRATION', 20); +define('SERVER_TYPE_ALERT', 21); // REPORTS. define('REPORT_TOP_N_MAX', 1); diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index 69f14e42f1..ecc84f7f04 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -826,6 +826,19 @@ function servers_get_info($id_server=-1) $id_modulo = 0; break; + case SERVER_TYPE_ALERT: + $server['img'] = html_print_image( + 'images/alerts_extern.png', + true, + [ + 'title' => __('Alert server'), + 'class' => 'invert_filter', + ] + ); + $server['type'] = 'alert'; + $id_modulo = 0; + break; + default: $server['img'] = ''; $server['type'] = 'unknown'; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index ec7d1a2072..8c832f287a 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -582,6 +582,19 @@ CREATE TABLE IF NOT EXISTS `talert_special_days` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- ----------------------------------------------------- +-- Table `talert_execution_queue` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `talert_execution_queue` ( + `id` int(10) unsigned NOT NULL auto_increment, + `id_alert_template_module` int(10) unsigned NOT NULL, + `alert_mode` tinyint(1) NOT NULL, + `data` mediumtext NOT NULL, + `extra_macros` text, + `utimestamp` bigint(20) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- ----------------------------------------------------- -- Table `tattachment` -- ----------------------------------------------------- diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 585e1c105f..6a45ad4ac2 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -31,6 +31,7 @@ use PandoraFMS::DB; use PandoraFMS::Config; use PandoraFMS::Tools; use PandoraFMS::Core; +use PandoraFMS::AlertServer; use PandoraFMS::DataServer; use PandoraFMS::NetworkServer; use PandoraFMS::SNMPServer; @@ -147,6 +148,7 @@ sub pandora_startup () { # Load servers if (!is_metaconsole(\%Config)) { pandora_reset_server (\%Config, $DBH); + push (@Servers, new PandoraFMS::AlertServer (\%Config, $DBH)); push (@Servers, new PandoraFMS::DataServer (\%Config, $DBH)); push (@Servers, new PandoraFMS::NetworkServer (\%Config, $DBH)); push (@Servers, new PandoraFMS::DiscoveryServer (\%Config, $DBH)); diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 0a80181b2f..f1ad0256c7 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -686,3 +686,12 @@ ha_interval 30 # Pandora FMS Database HA Tool monitoring interval in seconds. Must be a multiple of ha_interval (PANDORA FMS ENTERPRISE ONLY). ha_monitoring_interval 60 +# Enable (1) or disable (0) Pandora FMS Alert Server. +alertserver 0 + +# Pandora FMS Alert Server threads. +alertserver_threads 4 + +# Generate an hourly warning event if alert execution is being delayed more than alertserver_warn seconds. +alertserver_warn 180 + diff --git a/pandora_server/lib/PandoraFMS/AlertServer.pm b/pandora_server/lib/PandoraFMS/AlertServer.pm new file mode 100644 index 0000000000..01cd255c64 --- /dev/null +++ b/pandora_server/lib/PandoraFMS/AlertServer.pm @@ -0,0 +1,201 @@ +package PandoraFMS::AlertServer; +########################################################################## +# Pandora FMS Alert Server. +# Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org +########################################################################## +# Copyright (c) 2005-2021 Artica Soluciones Tecnologicas S.L +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public License +# as published by the Free Software Foundation; version 2 +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +########################################################################## + +use strict; +use warnings; + +use threads; +use threads::shared; +use Thread::Semaphore; + +use JSON; +use POSIX qw(strftime); + +# Default lib dir for RPM and DEB packages +use lib '/usr/lib/perl5'; + +use PandoraFMS::Tools; +use PandoraFMS::DB; +use PandoraFMS::Core; +use PandoraFMS::ProducerConsumerServer; + +# Inherits from PandoraFMS::ProducerConsumerServer +our @ISA = qw(PandoraFMS::ProducerConsumerServer); + +# Global variables +my @TaskQueue :shared; +my %PendingTasks :shared; +my $Sem :shared; +my $TaskSem :shared; +my $AlertSem :shared; +my %Alerts :shared; +my $EventRef :shared = 0; + +######################################################################################## +# Alert Server class constructor. +######################################################################################## +sub new ($$$) { + my ($class, $config, $dbh) = @_; + + return undef unless $config->{'alertserver'} == 1; + + # Initialize semaphores and queues + @TaskQueue = (); + %PendingTasks = (); + $Sem = Thread::Semaphore->new; + $TaskSem = Thread::Semaphore->new (0); + $AlertSem = Thread::Semaphore->new (1); + + # Call the constructor of the parent class + my $self = $class->SUPER::new($config, ALERTSERVER, \&PandoraFMS::AlertServer::data_producer, \&PandoraFMS::AlertServer::data_consumer, $dbh); + + bless $self, $class; + return $self; +} + +############################################################################### +# Run. +############################################################################### +sub run ($) { + my $self = shift; + my $pa_config = $self->getConfig (); + + print_message ($pa_config, " [*] Starting " . $pa_config->{'rb_product_name'} . " Alert Server.", 1); + $self->setNumThreads ($pa_config->{'alertserver_threads'}); + $self->SUPER::run (\@TaskQueue, \%PendingTasks, $Sem, $TaskSem); +} + +############################################################################### +# Data producer. +############################################################################### +sub data_producer ($) { + my $self = shift; + my ($pa_config, $dbh) = ($self->getConfig (), $self->getDBH ()); + + my @tasks; + my @rows; + + # Make a local copy of locked alerts. + $AlertSem->down (); + my $locked_alerts = {%Alerts}; + $AlertSem->up (); + + # Check the execution queue. + if (pandora_is_master($pa_config) == 1) { + @rows = get_db_rows ($dbh, 'SELECT id, utimestamp FROM talert_execution_queue ORDER BY utimestamp ASC'); + } + + # Queue alerts. + foreach my $row (@rows) { + next if (alert_lock($pa_config, $row->{'id'}, $locked_alerts) == 0); + push (@tasks, $row->{'id'}); + + # Generate an event if execution delay is high (every 1 hour at most). + my $now = time(); + if (($pa_config->{'alertserver_warn'} > 0) && + ($now - $row->{'utimestamp'} > $pa_config->{'alertserver_warn'}) && + ($EventRef + 3600 < $now)) { + $EventRef = $now; + pandora_event ($pa_config, "Alert execution delay has exceeded " . $pa_config->{'alertserver_warn'} . " seconds.", 0, 0, 3, 0, 0, 'system', 0, $dbh); + } + + } + + return @tasks; +} + +############################################################################### +# Data consumer. +############################################################################### +sub data_consumer ($$) { + my ($self, $task_id) = @_; + my ($pa_config, $dbh) = ($self->getConfig (), $self->getDBH ()); + + eval {{ + # Get the alert from the queue. + my $task = get_db_single_row ($dbh, 'SELECT * FROM talert_execution_queue WHERE id = ?', $task_id); + if (! defined ($task)) { + logger ($pa_config,"[ERROR] Executing invalid alert", 0); + last 0; + } + + # Get the alert data. + my $alert = get_db_single_row ($dbh, 'SELECT talert_template_modules.id as id_template_module, + talert_template_modules.*, talert_templates.* + FROM talert_template_modules, talert_templates + WHERE talert_template_modules.id_alert_template = talert_templates.id + AND talert_template_modules.id = ?', $task->{'id_alert_template_module'}); + if (! defined ($alert)) { + logger($pa_config, "Alert ID " . $task->{'id_alert_template_module'} . " not found.", 10); + last; + } + + # Get the agent and module associated with the alert + my $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); + if (! defined ($module)) { + logger($pa_config, "Module ID " . $alert->{'id_agent_module'} . " not found for alert ID " . $alert->{'id_template_module'} . ".", 10); + last; + } + my $agent = get_db_single_row ($dbh, 'SELECT * FROM tagente WHERE id_agente = ?', $module->{'id_agente'}); + if (! defined ($agent)) { + logger($pa_config, "Agent ID " . $module->{'id_agente'} . " not found for module ID " . $module->{'id_agente_modulo'} . " alert ID " . $alert->{'id_template_module'} . ".", 10); + last; + } + + # Execute the alert. + pandora_execute_alert ($pa_config, $task->{'data'}, $agent, $module, $alert, $task->{'alert_mode'}, + $dbh, strftime ("%Y-%m-%d %H:%M:%S", localtime()), 0, decode_json($task->{'extra_macros'})); + }}; + + # Remove the alert from the queue and unlock. + db_do($dbh, 'DELETE FROM talert_execution_queue WHERE id=?', $task_id); + alert_unlock($pa_config, $task_id); +} + +########################################################################## +# Get a lock on the given alert. Return 1 on success, 0 otherwise. +########################################################################## +sub alert_lock { + my ($pa_config, $alert, $locked_alerts) = @_; + + if (defined($locked_alerts->{$alert})) { + return 0; + } + + $locked_alerts->{$alert} = 1; + $AlertSem->down (); + $Alerts{$alert} = 1; + $AlertSem->up (); + + return 1; +} + +########################################################################## +# Remove the lock on the given alert. +########################################################################## +sub alert_unlock { + my ($pa_config, $alert) = @_; + + $AlertSem->down (); + delete ($Alerts{$alert}); + $AlertSem->up (); +} + +1; +__END__ diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 7d9a4f89fc..3dcc42f5a6 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -551,6 +551,10 @@ sub pandora_load_config { $pa_config->{"event_inhibit_alerts"} = 0; # 7.0 737 + $pa_config->{"alertserver"} = 0; # 7.0 756 + $pa_config->{"alertserver_threads"} = 1; # 7.0 756 + $pa_config->{"alertserver_warn"} = 180; # 7.0 756 + # Check for UID0 if ($pa_config->{"quiet"} != 0){ if ($> == 0){ @@ -1252,6 +1256,15 @@ sub pandora_load_config { elsif ($parametro =~ m/^fsnmp\s(.*)/i) { $pa_config->{'fsnmp'}= clean_blank($1); } + elsif ($parametro =~ m/^alertserver\s+([0-9]*)/i){ + $pa_config->{'alertserver'}= clean_blank($1); + } + elsif ($parametro =~ m/^alertserver_threads\s+([0-9]*)/i) { + $pa_config->{'alertserver_threads'}= clean_blank($1); + } + elsif ($parametro =~ m/^alertserver_warn\s+([0-9]*)/i) { + $pa_config->{'alertserver_warn'}= clean_blank($1); + } # Pandora HA extra elsif ($parametro =~ m/^ha_file\s(.*)/i) { diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 42db13c000..b24d6696a1 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -732,7 +732,11 @@ sub pandora_process_alert ($$$$$$$$;$$) { db_do($dbh, 'UPDATE talert_template_module_actions SET last_execution = 0 WHERE id_alert_template_module = ?', $id); } - pandora_execute_alert ($pa_config, $data, $agent, $module, $alert, 0, $dbh, $timestamp, 0, $extra_macros); + if ($pa_config->{'alertserver'} == 1 && defined ($alert->{'id_template_module'})) { + pandora_queue_alert($pa_config, $dbh, $data, $alert, 0, $extra_macros); + } else { + pandora_execute_alert ($pa_config, $data, $agent, $module, $alert, 0, $dbh, $timestamp, 0, $extra_macros); + } return; } @@ -772,8 +776,12 @@ sub pandora_process_alert ($$$$$$$$;$$) { last_fired = ?, internal_counter = ? ' . $new_interval . ' WHERE id = ?', $alert->{'times_fired'}, $utimestamp, $alert->{'internal_counter'}, $id); - pandora_execute_alert ($pa_config, $data, $agent, $module, $alert, 1, - $dbh, $timestamp, 0, $extra_macros, $is_correlated_alert); + if ($pa_config->{'alertserver'} == 1 && defined ($alert->{'id_template_module'})) { + pandora_queue_alert($pa_config, $dbh, $data, $alert, 1, $extra_macros); + } else { + pandora_execute_alert ($pa_config, $data, $agent, $module, $alert, 1, + $dbh, $timestamp, 0, $extra_macros, $is_correlated_alert); + } return; } } @@ -1005,6 +1013,26 @@ sub pandora_execute_alert ($$$$$$$$$;$$) { } } +########################################################################## +=head2 C<< pandora_queue_alert (I<$pa_config>, I<$dbh>, I<$data>, I<$alert>, I<$extra_macros> >> + +Queue the given alert for execution. + +=cut +########################################################################## +sub pandora_queue_alert ($$$$$;$) { + my ($pa_config, $dbh, $data, $alert, $alert_mode, $extra_macros) = @_; + my $json_macros = '{}'; + + eval { + local $SIG{__DIE__}; + $json_macros = encode_json($extra_macros); + }; + + db_do ($dbh, "INSERT INTO talert_execution_queue (id_alert_template_module, data, alert_mode, extra_macros, utimestamp) + VALUES (?, ?, ?, ?, ?)", $alert->{'id_template_module'}, $data, $alert_mode, $json_macros, time()); +} + ########################################################################## =head2 C<< pandora_execute_action (I<$pa_config>, I<$data>, I<$agent>, I<$alert>, I<$alert_mode>, I<$action>, I<$module>, I<$dbh>, I<$timestamp>) >> diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index d4109d7d54..f499c39f38 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -55,6 +55,7 @@ our @ISA = ("Exporter"); our %EXPORT_TAGS = ( 'all' => [ qw( ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( + ALERTSERVER DATASERVER NETWORKSERVER SNMPCONSOLE @@ -189,6 +190,7 @@ use constant WUXSERVER => 17; use constant SYSLOGSERVER => 18; use constant PROVISIONINGSERVER => 19; use constant MIGRATIONSERVER => 20; +use constant ALERTSERVER => 21; # Module status use constant MODULE_NORMAL => 0; @@ -2519,6 +2521,7 @@ sub get_server_name { return "SYSLOGSERVER" if ($server_type eq SYSLOGSERVER); return "PROVISIONINGSERVER" if ($server_type eq PROVISIONINGSERVER); return "MIGRATIONSERVER" if ($server_type eq MIGRATIONSERVER); + return "ALERTSERVER" if ($server_type eq ALERTSERVER); return "UNKNOWN"; } From 1328b2055c0805c8097bdb8a05625d70cfdf1d05 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 2 Jul 2021 01:00:32 +0200 Subject: [PATCH 11/15] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 35256fcbf4..2b3723c176 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.755-210701 +Version: 7.0NG.755-210702 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 1cf037b403..fc5d16c528 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.755-210701" +pandora_version="7.0NG.755-210702" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 0f9a564377..54377edb62 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.755'; -use constant AGENT_BUILD => '210701'; +use constant AGENT_BUILD => '210702'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index aa37c27e58..42838b2e14 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210701 +%define release 210702 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 3ce602a9be..fbe305663a 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210701 +%define release 210702 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 57577368fd..531e4efaa2 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210701" +PI_BUILD="210702" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9417215103..cbfc8deda3 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210701} +{210702} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b485785466..f6b4e7b64f 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.755 Build 210701") +#define PANDORA_VERSION ("7.0NG.755 Build 210702") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 533b281fda..740f161268 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.755(Build 210701))" + VALUE "ProductVersion", "(7.0NG.755(Build 210702))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9227303a28..40c6b93328 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.755-210701 +Version: 7.0NG.755-210702 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 968fc3077a..7d66571090 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.755-210701" +pandora_version="7.0NG.755-210702" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index f88c441863..e03a8cbad3 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210701'; +$build_version = 'PC210702'; $pandora_version = 'v7.0NG.755'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f4b961cdb4..1b25de7248 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 856ea5f09c..df54a3f1b3 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210701 +%define release 210702 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 4127f53d6e..c15e98bbb9 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210701 +%define release 210702 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 96a8385f19..be5b481ab8 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210701" +PI_BUILD="210702" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 320035ea29..a750f316f0 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.755 Build 210701"; +my $version = "7.0NG.755 Build 210702"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index aa31bcaf96..5e5b93b74b 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.755 Build 210701"; +my $version = "7.0NG.755 Build 210702"; # save program name for logging my $progname = basename($0); From 8a4e51bf1b5ebbaf4a45a0447b4847122a4b93d7 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 3 Jul 2021 01:00:31 +0200 Subject: [PATCH 12/15] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 2b3723c176..c34410ad5d 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.755-210702 +Version: 7.0NG.755-210703 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 fc5d16c528..7ec7b08c25 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.755-210702" +pandora_version="7.0NG.755-210703" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 54377edb62..5cea87eb23 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.755'; -use constant AGENT_BUILD => '210702'; +use constant AGENT_BUILD => '210703'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 42838b2e14..9e135792a1 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210702 +%define release 210703 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 fbe305663a..9fc91f35ab 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210702 +%define release 210703 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 531e4efaa2..26659272c9 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210702" +PI_BUILD="210703" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cbfc8deda3..9074e4e50e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210702} +{210703} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f6b4e7b64f..87d951cd56 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.755 Build 210702") +#define PANDORA_VERSION ("7.0NG.755 Build 210703") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 740f161268..adadeb3385 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.755(Build 210702))" + VALUE "ProductVersion", "(7.0NG.755(Build 210703))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 40c6b93328..faab4a2ea5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.755-210702 +Version: 7.0NG.755-210703 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 7d66571090..7b5b44a999 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.755-210702" +pandora_version="7.0NG.755-210703" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e03a8cbad3..fae0587395 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210702'; +$build_version = 'PC210703'; $pandora_version = 'v7.0NG.755'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 1b25de7248..f70cfdbc27 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index df54a3f1b3..aff5e30570 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210702 +%define release 210703 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index c15e98bbb9..8f41fac7a5 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210702 +%define release 210703 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index be5b481ab8..028448143c 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210702" +PI_BUILD="210703" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a750f316f0..69a4d33740 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.755 Build 210702"; +my $version = "7.0NG.755 Build 210703"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5e5b93b74b..5b30f5405e 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.755 Build 210702"; +my $version = "7.0NG.755 Build 210703"; # save program name for logging my $progname = basename($0); From b6477e552675c7bf865a77b25856365f1a192ab3 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 4 Jul 2021 01:00:26 +0200 Subject: [PATCH 13/15] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index c34410ad5d..be915bf71f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.755-210703 +Version: 7.0NG.755-210704 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 7ec7b08c25..b4ecae0d68 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.755-210703" +pandora_version="7.0NG.755-210704" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 5cea87eb23..5eff314c96 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.755'; -use constant AGENT_BUILD => '210703'; +use constant AGENT_BUILD => '210704'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 9e135792a1..b48cba2136 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210703 +%define release 210704 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 9fc91f35ab..b6342d1fc8 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210703 +%define release 210704 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 26659272c9..7dc2406026 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210703" +PI_BUILD="210704" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9074e4e50e..b93ef31ed5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210703} +{210704} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 87d951cd56..e4c3d1e0c6 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.755 Build 210703") +#define PANDORA_VERSION ("7.0NG.755 Build 210704") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index adadeb3385..6616c7bb8c 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.755(Build 210703))" + VALUE "ProductVersion", "(7.0NG.755(Build 210704))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index faab4a2ea5..d8ce92d127 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.755-210703 +Version: 7.0NG.755-210704 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 7b5b44a999..fe15706f2f 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.755-210703" +pandora_version="7.0NG.755-210704" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index fae0587395..200c394f4e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210703'; +$build_version = 'PC210704'; $pandora_version = 'v7.0NG.755'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f70cfdbc27..3aea7ab26e 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index aff5e30570..fccaab8233 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210703 +%define release 210704 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 8f41fac7a5..9eefaaa623 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210703 +%define release 210704 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 028448143c..45875e7066 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210703" +PI_BUILD="210704" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 69a4d33740..cdf62e4992 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.755 Build 210703"; +my $version = "7.0NG.755 Build 210704"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5b30f5405e..ca4bef143c 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.755 Build 210703"; +my $version = "7.0NG.755 Build 210704"; # save program name for logging my $progname = basename($0); From 3baae4147a07dc068579bcd7bd9186bb698c32f1 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 5 Jul 2021 01:00:29 +0200 Subject: [PATCH 14/15] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index be915bf71f..d0672378c1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.755-210704 +Version: 7.0NG.755-210705 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 b4ecae0d68..f63507cd77 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.755-210704" +pandora_version="7.0NG.755-210705" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 5eff314c96..0c3ddebcb4 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.755'; -use constant AGENT_BUILD => '210704'; +use constant AGENT_BUILD => '210705'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index b48cba2136..964b4d14e2 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210704 +%define release 210705 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 b6342d1fc8..07a5f76692 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.755 -%define release 210704 +%define release 210705 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 7dc2406026..ef5923f9a8 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210704" +PI_BUILD="210705" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b93ef31ed5..0bdfd88e15 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210704} +{210705} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index e4c3d1e0c6..8459f6597c 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.755 Build 210704") +#define PANDORA_VERSION ("7.0NG.755 Build 210705") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 6616c7bb8c..40bd2b8785 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.755(Build 210704))" + VALUE "ProductVersion", "(7.0NG.755(Build 210705))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d8ce92d127..de4e72b229 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.755-210704 +Version: 7.0NG.755-210705 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 fe15706f2f..5f4c49d6bf 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.755-210704" +pandora_version="7.0NG.755-210705" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 200c394f4e..5220cd0315 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210704'; +$build_version = 'PC210705'; $pandora_version = 'v7.0NG.755'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 3aea7ab26e..83601a38e7 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index fccaab8233..df23cd01da 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210704 +%define release 210705 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 9eefaaa623..7f01599176 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.755 -%define release 210704 +%define release 210705 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 45875e7066..50820ffd6f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.755" -PI_BUILD="210704" +PI_BUILD="210705" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index cdf62e4992..ef586b934c 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.755 Build 210704"; +my $version = "7.0NG.755 Build 210705"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ca4bef143c..aa7509e1df 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.755 Build 210704"; +my $version = "7.0NG.755 Build 210705"; # save program name for logging my $progname = basename($0); From 367789f2dd5cad5c7efc17f77ef7f9f782f8a9b9 Mon Sep 17 00:00:00 2001 From: Luis Date: Mon, 5 Jul 2021 07:47:17 +0000 Subject: [PATCH 15/15] Ent 7775 eliminar event alerts metaconsola --- pandora_console/extras/delete_files/delete_files.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index 2ff6363b64..be4f79812d 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -95,3 +95,4 @@ include/help/es/help_event_alert.php enterprise/godmode/alerts/alert_events.php enterprise/godmode/alerts/alert_events_list.php enterprise/godmode/alerts/alert_events_rules.php +enterprise/godmode/alerts/configure_alert_rule.php