Merge remote-tracking branch 'origin/develop' into ent-6802-super-8

This commit is contained in:
fbsanchez 2022-02-03 17:55:34 +01:00
commit a298b25a38
35 changed files with 715 additions and 653 deletions

View File

@ -1,12 +1,17 @@
[![Build Status](https://travis-ci.org/pandorafms/pandorafms.svg?branch=develop)](https://travis-ci.org/pandorafms/pandorafms) [![Build Status](https://travis-ci.org/pandorafms/pandorafms.svg?branch=develop)](https://travis-ci.org/pandorafms/pandorafms)
[![Pandora logo](http://wolf359.artica.es/public_images/logo_pandora_community.png)](http://pandorafms.org) ![logo Pandora-FMS](https://user-images.githubusercontent.com/8567291/151817953-dc9c4c88-5f3c-459b-98a7-da0534930a2c.png)
Pandora FMS is a monitoring software for IT infrastructure management which includes network equipment, Windows and Unix servers, virtual infrastructure and all different kind of applications. It has a large amount of features, making it a new generation software which discovers all the monitoring issues that an organization may need.
With more than 50,000 customer installations across the five continents, Pandora FMS is an out-of-the-box monitoring solution: profitable and scalable, covering most infrastructure deployment options.
Pandora FMS gives you the agility to find and solve problems quickly, scaling them so they can be derived from any source, on-premise, multi cloud or both of them mixed. Now you have that capability across your entire IT stack and analytics to find any problem, even the ones that are hard to find.
Thanks to more than 500 plugins available, you can control and manage any application and technology, from SAP, Oracle, Lotus, Citrix or Jboss to VMware, AWS, SQL Server, Redhat, Websphere, etc.
### Support ### Support
For community support you can visit our forums at http://forums.pandorafms.org. Visit our community page at http://pandorafms.org and if you need commercial information or/and professional support visit http://pandorafms.com. For community support you can visit our forums at https://pandorafms.com/community/ and if you need commercial information or/and professional support visit https://pandorafms.com
### How to install Pandora FMS ### How to install Pandora FMS

View File

@ -1,20 +1,32 @@
#!/bin/bash #!/bin/bash
#######################################################
# PandoraFMS Community online installation script
#######################################################
## Tested versions ##
# Centos 7.9
# define variables #Constants
PANDORA_CONSOLE=/var/www/html/pandora_console PANDORA_CONSOLE=/var/www/html/pandora_console
CONSOLE_PATH=/var/www/html/pandora_console
PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_SERVER_BIN=/usr/bin/pandora_server PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
PANDORA_HA_BIN=/usr/bin/pandora_ha
PANDORA_TABLES_MIN=160
DBHOST=127.0.0.1 S_VERSION='2022012401'
DBNAME=pandora
DBUSER=pandora
DBPASS=pandora
DBPORT=3306
S_VERSION='2021012801'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
[ "$TZ" ] || TZ="Europe/Madrid"
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora
[ "$DBPASS" ] || DBPASS=pandora
[ "$DBPORT" ] || DBPORT=3306
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
# Ansi color code variables # Ansi color code variables
red="\e[0;91m" red="\e[0;91m"
green="\e[0;92m" green="\e[0;92m"
@ -60,7 +72,7 @@ check_pre_pandora () {
echo -en "${cyan}Checking environment ... ${reset}" echo -en "${cyan}Checking environment ... ${reset}"
rpm -qa | grep pandora &>> /dev/null && local fail=true rpm -qa | grep pandora &>> /dev/null && local fail=true
[ -d "$CONSOLE_PATH" ] && local fail=true [ -d "$PANDORA_CONSOLE" ] && local fail=true
[ -f /usr/bin/pandora_server ] && 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 echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true
@ -111,7 +123,7 @@ echo "Community installer version: $S_VERSION" >> $LOGFILE
check_root_permissions check_root_permissions
# Pre installed pandora # Pre installed pandora
check_pre_pandora [ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
# Connectivity # Connectivity
check_repo_connection check_repo_connection
@ -125,6 +137,9 @@ execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]"
# Check disk size at least 10 Gb free space # 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_cmd "[ $(df -BM / | tail -1 | awk '{print $4}' | tr -d M) -gt 10000 ]" 'Checking Disk (required: 10 GB free min)'
# Setting timezone
execute_cmd "timedatectl set-timezone $TZ" "Setting Timezone $TZ"
# Execute tools check # Execute tools check
execute_cmd "awk --version" 'Checking needed tools: awk' execute_cmd "awk --version" 'Checking needed tools: awk'
execute_cmd "grep --version" 'Checking needed tools: grep' execute_cmd "grep --version" 'Checking needed tools: grep'
@ -148,10 +163,10 @@ http://rpms.remirepo.net/enterprise/remi-release-7.rpm \
https://repo.percona.com/yum/percona-release-latest.noarch.rpm" https://repo.percona.com/yum/percona-release-latest.noarch.rpm"
execute_cmd "yum install -y $extra_repos" "Installing extra repositories" execute_cmd "yum install -y $extra_repos" "Installing extra repositories"
execute_cmd "yum-config-manager --enable remi-php73" "Configuring PHP" execute_cmd "yum-config-manager --enable remi-php74" "Configuring PHP"
# Install percona Database # Install percona Database
[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf #[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf
execute_cmd "yum install -y Percona-Server-server-57" "Installing Percona Server" execute_cmd "yum install -y Percona-Server-server-57" "Installing Percona Server"
# Console dependencies # Console dependencies
@ -256,6 +271,7 @@ server_dependencies=" \
perl(XML::Twig) \ perl(XML::Twig) \
expect \ expect \
openssh-clients \ openssh-clients \
java \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ 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" http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm"
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies" execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
@ -275,32 +291,51 @@ execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl de
oracle_dependencies=" \ 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-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" https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm"
execute_cmd "yum install -y $oracle_dependencies" "Installing Oracle Instant client" execute_cmd "yum install -y $oracle_dependencies || yum reinstall -y $oracle_dependencies" "Installing Oracle Instant client"
#ipam dependencies
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 "yum install -y $ipam_dependencies" "Installing IPAM Instant client"
# MSSQL dependencies el7
execute_cmd "curl https://packages.microsoft.com/config/rhel/7/prod.repo -o /etc/yum.repos.d/mssql-release.repo" "Configuring Microsoft repositories"
execute_cmd "yum remove unixODBC-utf16 unixODBC-utf16-devel" "Removing default unixODBC packages"
execute_cmd "env ACCEPT_EULA=Y yum install -y msodbcsql17" "Installing ODBC Driver for Microsoft(R) SQL Server(R)"
MS_ID=$(head -1 /etc/odbcinst.ini | tr -d '[]') &>> "$LOGFILE"
#yum config-manager --set-disable packages-microsoft-com-prod
# Disabling SELINUX and firewalld # Disabling SELINUX and firewalld
setenforce 0 setenforce 0
sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config
systemctl disable firewalld --now &>> $LOGFILE systemctl disable firewalld --now &>> $LOGFILE
#Configuring Database #Configuring Database
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
execute_cmd "systemctl start mysqld" "Starting database engine" execute_cmd "systemctl start mysqld" "Starting database engine"
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev) export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
echo """ echo """
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!'); SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!');
UNINSTALL PLUGIN validate_password; UNINSTALL PLUGIN validate_password;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('pandora'); SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$DBROOTPASS');
""" | mysql --connect-expired-password -uroot """ | mysql --connect-expired-password -uroot &>> "$LOGFILE"
fi
export MYSQL_PWD=$DBPASS export MYSQL_PWD=$DBROOTPASS
echo -en "${cyan}Creating Pandora FMS database...${reset}" echo -en "${cyan}Creating Pandora FMS database...${reset}"
echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST 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.' check_cmd_status "Error creating database $DBNAME, 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 echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%' identified by \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST
export MYSQL_PWD=$DBPASS
#Generating my.cnf #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 cat > /etc/my.cnf << EO_CONFIG_F
[mysqld] [mysqld]
datadir=/var/lib/mysql datadir=/var/lib/mysql
@ -350,7 +385,7 @@ execute_cmd "systemctl restart mysqld" "Configuring database engine"
# Downloading Pandora Packages # 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_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/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" execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm" "Downloading Pandora FMS Agent community"
# Install Pandora # Install Pandora
execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages" execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages"
@ -374,13 +409,13 @@ mysql -u$DBUSER -P$DBPORT -h$DBHOST $DBNAME < $PANDORA_CONSOLE/pandoradb_data.sq
check_cmd_status 'Error Loading database schema data' check_cmd_status 'Error Loading database schema data'
# Configure console # Configure console
cat > $CONSOLE_PATH/include/config.php << EO_CONFIG_F cat > $PANDORA_CONSOLE/include/config.php << EO_CONFIG_F
<?php <?php
\$config["dbtype"] = "mysql"; \$config["dbtype"] = "mysql";
\$config["dbname"]="$DBNAME"; \$config["dbname"]="$DBNAME";
\$config["dbuser"]="$DBUSER"; \$config["dbuser"]="$DBUSER";
\$config["dbpass"]="$DBPASS"; \$config["dbpass"]="$DBPASS";
\$config["dbhost"]="localhost"; \$config["dbhost"]="$DBHOST";
\$config["homedir"]="$PANDORA_CONSOLE"; \$config["homedir"]="$PANDORA_CONSOLE";
\$config["homeurl"]="/pandora_console"; \$config["homeurl"]="/pandora_console";
error_reporting(0); error_reporting(0);
@ -420,9 +455,9 @@ 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 sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess
# Fixing console permissions # Fixing console permissions
chmod 600 $CONSOLE_PATH/include/config.php chmod 600 $PANDORA_CONSOLE/include/config.php
chown apache. $CONSOLE_PATH/include/config.php chown apache. $PANDORA_CONSOLE/include/config.php
mv $CONSOLE_PATH/install.php $CONSOLE_PATH/install.done mv $PANDORA_CONSOLE/install.php $PANDORA_CONSOLE/install.done
# Prepare php.ini # Prepare php.ini
sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini
@ -449,6 +484,10 @@ 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/^dbuser.*/dbuser $DBUSER/g" $PANDORA_SERVER_CONF
sed -i -e "s|^dbpass.*|dbpass $DBPASS|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 sed -i -e "s/^dbport.*/dbport $DBPORT/g" $PANDORA_SERVER_CONF
sed -i -e "s/^#.mssql_driver.*/mssql_driver $MS_ID/g" $PANDORA_SERVER_CONF
# Enable agent remote config
sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF
# Set Oracle environment for pandora_server # Set Oracle environment for pandora_server
cat > /etc/pandora/pandora_server.env << 'EOF_ENV' cat > /etc/pandora/pandora_server.env << 'EOF_ENV'
@ -459,7 +498,7 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/$VERSION/client64/lib
export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64 export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64
EOF_ENV EOF_ENV
# Kernel optimization if [ "$SKIP_KERNEL_OPTIMIZATIONS" -eq '0' ] ; then
cat >> /etc/sysctl.conf <<EO_KO cat >> /etc/sysctl.conf <<EO_KO
# Pandora FMS Optimization # Pandora FMS Optimization
@ -487,6 +526,7 @@ net.core.optmem_max = 81920
EO_KO EO_KO
[ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization" [ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization"
fi
# Fix pandora_server.{log,error} permissions to allow Console check them # Fix pandora_server.{log,error} permissions to allow Console check them
chown pandora:apache /var/log/pandora chown pandora:apache /var/log/pandora
@ -563,7 +603,7 @@ execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://12
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 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 ## Enabling agent
systemctl enable pandora_agent_daemon &>> $LOGFILE systemctl enable pandora_agent_daemon &>> $LOGFILE
execute_cmd "systemctl start pandora_agent_daemon" "starting Pandora FMS Agent" execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
#SSH banner #SSH banner
[ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) [ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me)

View File

@ -1,17 +1,35 @@
#!/bin/bash #!/bin/bash
#######################################################
# PandoraFMS Community online installation script
#######################################################
## Tested versions ##
# Centos 8.4, 8.5
# Rocky 8.4, 8.5
# Almalinuz 8.4, 8.5
# RedHat 8.5
# define variables #Constants
PANDORA_CONSOLE=/var/www/html/pandora_console PANDORA_CONSOLE=/var/www/html/pandora_console
CONSOLE_PATH=/var/www/html/pandora_console
PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
DBHOST=127.0.0.1 PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
DBNAME=pandora
DBUSER=pandora
DBPASS=pandora S_VERSION='2022012401'
DBPORT=3306
S_VERSION='2021070101'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
[ "$TZ" ] || TZ="Europe/Madrid"
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora
[ "$DBPASS" ] || DBPASS=pandora
[ "$DBPORT" ] || DBPORT=3306
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
# Ansi color code variables # Ansi color code variables
red="\e[0;91m" red="\e[0;91m"
green="\e[0;92m" green="\e[0;92m"
@ -56,7 +74,7 @@ check_pre_pandora () {
echo -en "${cyan}Checking environment ... ${reset}" echo -en "${cyan}Checking environment ... ${reset}"
rpm -qa | grep pandora &>> /dev/null && local fail=true rpm -qa | grep pandora &>> /dev/null && local fail=true
[ -d "$CONSOLE_PATH" ] && local fail=true [ -d "$PANDORA_CONSOLE" ] && local fail=true
[ -f /usr/bin/pandora_server ] && 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 echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true
@ -87,8 +105,8 @@ check_root_permissions () {
echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION" echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION"
# Centos Version # Centos Version
if [ ! "$(grep -Ei 'centos|rocky' /etc/redhat-release)" ]; then if [ ! "$(grep -Ei 'centos|rocky|Almalinux|Red Hat Enterprise' /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" printf "\n ${red}Error this is not a Centos/Rocky/Almalinux Base system, this installer is compatible with Centos/Rocky systems only${reset}\n"
exit 1 exit 1
fi fi
@ -106,7 +124,7 @@ echo "Community installer version: $S_VERSION" >> "$LOGFILE"
check_root_permissions check_root_permissions
# Pre installed pandora # Pre installed pandora
check_pre_pandora [ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
# Connectivity # Connectivity
check_repo_connection check_repo_connection
@ -120,6 +138,9 @@ execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]"
# Check disk size at least 10 Gb free space # 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_cmd "[ $(df -BM / | tail -1 | awk '{print $4}' | tr -d M) -gt 10000 ]" 'Checking Disk (required: 10 GB free min)'
# Setting timezone
execute_cmd "timedatectl set-timezone $TZ" "Setting Timezone $TZ"
# Execute tools check # Execute tools check
execute_cmd "awk --version" 'Checking needed tools: awk' execute_cmd "awk --version" 'Checking needed tools: awk'
execute_cmd "grep --version" 'Checking needed tools: grep' execute_cmd "grep --version" 'Checking needed tools: grep'
@ -131,10 +152,34 @@ rm -rf "$HOME"/pandora_deploy_tmp/*.rpm* &>> "$LOGFILE"
mkdir "$HOME"/pandora_deploy_tmp &>> "$LOGFILE" mkdir "$HOME"/pandora_deploy_tmp &>> "$LOGFILE"
execute_cmd "cd $HOME/pandora_deploy_tmp" "Moving to workspace: $HOME/pandora_deploy_tmp" execute_cmd "cd $HOME/pandora_deploy_tmp" "Moving to workspace: $HOME/pandora_deploy_tmp"
#Installing wget ## Extra steps on redhat envs
execute_cmd "dnf install -y wget" "Installing wget" if [ "$(grep -Ei 'Red Hat Enterprise' /etc/redhat-release)" ]; then
## In case REDHAT
# Check susbscription manager status:
echo -en "${cyan}Checking Red Hat Enterprise subscription... ${reset}"
subscription-manager status &>> "$LOGFILE"
subscription-manager list &>> "$LOGFILE"
subscription-manager list | grep 'Status:' | grep Subscribed &>> "$LOGFILE"
check_cmd_status 'Error checking subscription status, make sure your server is activated and suscribed to Red Hat Enterprise repositories'
#Installing extra repositiries # Ckeck repolist
dnf repolist &>> "$LOGFILE"
echo -en "${cyan}Checking Red Hat Enterprise repolist... ${reset}"
dnf repolist | grep 'rhel-8-for-x86_64-baseos-rpms' &>> "$LOGFILE"
check_cmd_status 'Error checking repositories status, could try a subscription-manager attach command or contact sysadmin'
#install extra repos
extra_repos=" \
tar \
dnf-utils \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
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 "subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms" "Enabling subscription to codeready-builder"
else
# For alma/rocky/centos
extra_repos=" \ extra_repos=" \
tar \ tar \
dnf-utils \ dnf-utils \
@ -144,12 +189,20 @@ extra_repos=" \
execute_cmd "dnf install -y $extra_repos" "Installing extra repositories" execute_cmd "dnf install -y $extra_repos" "Installing extra repositories"
execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools" execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools"
fi
#Installing wget
execute_cmd "dnf install -y wget" "Installing wget"
#Installing extra repositiries
execute_cmd "dnf module reset -y php " "Disabling standard PHP module" execute_cmd "dnf module reset -y php " "Disabling standard PHP module"
execute_cmd "dnf module install -y php:remi-7.3" "Configuring PHP" execute_cmd "dnf module install -y php:remi-7.4" "Configuring PHP"
# Install percona Database # Install percona Database
execute_cmd "dnf module disable -y mysql" "Disabiling mysql module" execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
rm -rf /etc/my.cnf #rm -rf /etc/my.cnf
execute_cmd "dnf install -y Percona-Server-server-57" "Installing Percona Server" execute_cmd "dnf install -y Percona-Server-server-57" "Installing Percona Server"
# Console dependencies # Console dependencies
@ -231,6 +284,7 @@ console_dependencies=" \
xorg-x11-fonts-misc \ xorg-x11-fonts-misc \
poppler-data \ poppler-data \
php-yaml \ php-yaml \
mod_ssl \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ 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/centos7/wmic-1.4-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm" http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
@ -256,6 +310,7 @@ server_dependencies=" \
perl(XML::Twig) \ perl(XML::Twig) \
expect \ expect \
openssh-clients \ openssh-clients \
java \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ 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" 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" execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
@ -281,6 +336,7 @@ oracle_dependencies=" \
https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-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" execute_cmd "dnf install -y $oracle_dependencies" "Installing Oracle Instant client"
#ipam dependencies
ipam_dependencies=" \ ipam_dependencies=" \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \
perl(NetAddr::IP) \ perl(NetAddr::IP) \
@ -290,32 +346,39 @@ ipam_dependencies=" \
perl(Geo::IP) \ perl(Geo::IP) \
perl(IO::Socket::INET6) \ perl(IO::Socket::INET6) \
perl(XML::Twig)" perl(XML::Twig)"
execute_cmd "dnf install -y $ipam_dependencies" "Installing Oracle Instant client" execute_cmd "dnf install -y $ipam_dependencies" "Installing IPAM Instant client"
# MSSQL dependencies el8
execute_cmd "curl https://packages.microsoft.com/config/rhel/8/prod.repo -o /etc/yum.repos.d/mssql-release.repo" "Configuring Microsoft repositories"
execute_cmd "dnf remove unixODBC-utf16 unixODBC-utf16-devel" "Removing default unixODBC packages"
execute_cmd "env ACCEPT_EULA=Y dnf install -y msodbcsql17" "Installing ODBC Driver for Microsoft(R) SQL Server(R)"
MS_ID=$(head -1 /etc/odbcinst.ini | tr -d '[]') &>> "$LOGFILE"
#dnf config-manager --set-disable packages-microsoft-com-prod
# Disabling SELINUX and firewalld # Disabling SELINUX and firewalld
setenforce 0 &>> "$LOGFILE" setenforce 0 &>> "$LOGFILE"
sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config &>> "$LOGFILE" sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config &>> "$LOGFILE"
systemctl disable firewalld --now &>> "$LOGFILE" systemctl disable firewalld --now &>> "$LOGFILE"
#Configuring Database #Configuring Database
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
execute_cmd "systemctl start mysqld" "Starting database engine" execute_cmd "systemctl start mysqld" "Starting database engine"
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev) export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
echo """ echo """
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!'); SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!');
UNINSTALL PLUGIN validate_password; UNINSTALL PLUGIN validate_password;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('pandora'); SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$DBROOTPASS');
""" | mysql --connect-expired-password -uroot """ | mysql --connect-expired-password -uroot &>> "$LOGFILE"
fi
export MYSQL_PWD=$DBPASS export MYSQL_PWD=$DBROOTPASS
echo -en "${cyan}Creating Pandora FMS database...${reset}" echo -en "${cyan}Creating Pandora FMS database...${reset}"
echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST 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.' check_cmd_status "Error creating database $DBNAME, 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 echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%' identified by \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST
export MYSQL_PWD=$DBPASS
#Generating my.cnf #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 cat > /etc/my.cnf << EO_CONFIG_F
[mysqld] [mysqld]
datadir=/var/lib/mysql datadir=/var/lib/mysql
@ -365,10 +428,10 @@ execute_cmd "systemctl restart mysqld" "Configuring database engine"
# Downloading Pandora Packages # 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_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/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" execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm" "Downloading Pandora FMS Agent community"
# Install Pandora # Install Pandora
execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages" execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages"
# Copy gotty utility # Copy gotty utility
execute_cmd "wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' execute_cmd "wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
@ -391,13 +454,13 @@ mysql -u$DBUSER -P$DBPORT -h$DBHOST $DBNAME < $PANDORA_CONSOLE/pandoradb_data.sq
check_cmd_status 'Error Loading database schema data' check_cmd_status 'Error Loading database schema data'
# Configure console # Configure console
cat > $CONSOLE_PATH/include/config.php << EO_CONFIG_F cat > $PANDORA_CONSOLE/include/config.php << EO_CONFIG_F
<?php <?php
\$config["dbtype"] = "mysql"; \$config["dbtype"] = "mysql";
\$config["dbname"]="$DBNAME"; \$config["dbname"]="$DBNAME";
\$config["dbuser"]="$DBUSER"; \$config["dbuser"]="$DBUSER";
\$config["dbpass"]="$DBPASS"; \$config["dbpass"]="$DBPASS";
\$config["dbhost"]="localhost"; \$config["dbhost"]="$DBHOST";
\$config["homedir"]="$PANDORA_CONSOLE"; \$config["homedir"]="$PANDORA_CONSOLE";
\$config["homeurl"]="/pandora_console"; \$config["homeurl"]="/pandora_console";
error_reporting(0); error_reporting(0);
@ -437,9 +500,9 @@ 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 sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess
# Fixing console permissions # Fixing console permissions
chmod 600 $CONSOLE_PATH/include/config.php chmod 600 $PANDORA_CONSOLE/include/config.php
chown apache. $CONSOLE_PATH/include/config.php chown apache. $PANDORA_CONSOLE/include/config.php
mv $CONSOLE_PATH/install.php $CONSOLE_PATH/install.done mv $PANDORA_CONSOLE/install.php $PANDORA_CONSOLE/install.done &>> "$LOGFILE"
# Prepare php.ini # Prepare php.ini
sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini
@ -466,6 +529,10 @@ 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/^dbuser.*/dbuser $DBUSER/g" $PANDORA_SERVER_CONF
sed -i -e "s|^dbpass.*|dbpass $DBPASS|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 sed -i -e "s/^dbport.*/dbport $DBPORT/g" $PANDORA_SERVER_CONF
sed -i -e "s/^#.mssql_driver.*/mssql_driver $MS_ID/g" $PANDORA_SERVER_CONF
# Enable agent remote config
sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF
# Set Oracle environment for pandora_server # Set Oracle environment for pandora_server
cat > /etc/pandora/pandora_server.env << 'EOF_ENV' cat > /etc/pandora/pandora_server.env << 'EOF_ENV'
@ -477,6 +544,8 @@ export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64
EOF_ENV EOF_ENV
# Kernel optimization # Kernel optimization
if [ "$SKIP_KERNEL_OPTIMIZATIONS" -eq '0' ] ; then
cat >> /etc/sysctl.conf <<EO_KO cat >> /etc/sysctl.conf <<EO_KO
# Pandora FMS Optimization # Pandora FMS Optimization
@ -504,6 +573,7 @@ net.core.optmem_max = 81920
EO_KO EO_KO
[ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization" [ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization"
fi
# Fix pandora_server.{log,error} permissions to allow Console check them # Fix pandora_server.{log,error} permissions to allow Console check them
chown pandora:apache /var/log/pandora chown pandora:apache /var/log/pandora
@ -558,7 +628,7 @@ chmod 0644 /etc/logrotate.d/pandora_server
chmod 0644 /etc/logrotate.d/pandora_agent chmod 0644 /etc/logrotate.d/pandora_agent
# Add websocket engine start script. # Add websocket engine start script.
mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ &>> "$LOGFILE"
chmod +x /etc/init.d/pandora_websocket_engine chmod +x /etc/init.d/pandora_websocket_engine
# Start Websocket engine # Start Websocket engine
@ -569,7 +639,7 @@ systemctl enable pandora_websocket_engine &>> "$LOGFILE"
# Enable pandora ha service # Enable pandora ha service
systemctl enable pandora_server --now &>> "$LOGFILE" systemctl enable pandora_server --now &>> "$LOGFILE"
execute_cmd "systemctl start pandora_server" "Starting Pandora FMS Server" execute_cmd "/etc/init.d/pandora_server start" "Starting Pandora FMS Server"
# starting tentacle server # starting tentacle server
systemctl enable tentacle_serverd &>> "$LOGFILE" systemctl enable tentacle_serverd &>> "$LOGFILE"
@ -580,7 +650,7 @@ execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://12
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 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 ## Enabling agent
systemctl enable pandora_agent_daemon &>> "$LOGFILE" systemctl enable pandora_agent_daemon &>> "$LOGFILE"
execute_cmd "systemctl start pandora_agent_daemon" "starting Pandora FMS Agent" execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
#SSH banner #SSH banner
[ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) [ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me)

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.759-220202 Version: 7.0NG.759-220203
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.759-220202" pandora_version="7.0NG.759-220203"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -47,4 +47,3 @@ License
The project is distributed under the GPL License v2 or later. The project is distributed under the GPL License v2 or later.
Copyright (C) 2004-2011 Pandora FMS development team Copyright (C) 2004-2011 Pandora FMS development team

View File

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.759'; use constant AGENT_VERSION => '7.0NG.759';
use constant AGENT_BUILD => '220202'; use constant AGENT_BUILD => '220203';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220202 %define release 220203
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220202 %define release 220203
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.759" PI_VERSION="7.0NG.759"
PI_BUILD="220202" PI_BUILD="220203"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{220202} {220203}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.759 Build 220202") #define PANDORA_VERSION ("7.0NG.759 Build 220203")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.759(Build 220202))" VALUE "ProductVersion", "(7.0NG.759(Build 220203))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.759-220202 Version: 7.0NG.759-220203
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.759-220202" pandora_version="7.0NG.759-220203"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC220202'; $build_version = 'PC220203';
$pandora_version = 'v7.0NG.759'; $pandora_version = 'v7.0NG.759';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -532,13 +532,20 @@ function cron_list_table()
continue; continue;
} }
$email = $args[1]; $email = ui_print_truncate_text($args[1], 120);
$report_type = $args[4]; $reportName = ui_print_truncate_text($report['name'], 120);
$data[2] .= '<br>- '.__('Report').": <a href='index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=".$args[0]."'>"; $reportType = $args[4];
$data[2] .= $report['name'].'</a>'; $data[2] .= html_print_anchor(
$data[2] .= '<br>- '.__('Report type').': '.$report_type; [
$data[2] .= '<br>- '.__('Email').": <a href='mailto:".$email."'>"; 'href' => ui_get_full_url(
$data[2] .= ui_print_truncate_text($email, 60, false).'</a>'; 'index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$args[0]
),
'content' => $reportName,
],
true
);
$data[2] .= '<br>- '.__('Report type').': '.$reportType;
$data[2] .= '<br>- '.__('Email').': '.$email;
break; break;
case 'cron_task_generate_report_by_template': case 'cron_task_generate_report_by_template':
@ -582,32 +589,48 @@ function cron_list_table()
} }
if (empty($args[1]) === false && (string) $args[1] !== '0') { if (empty($args[1]) === false && (string) $args[1] !== '0') {
$agents_id = $args[1]; if (is_metaconsole() === true) {
$tmpAgents = explode(',', $args[1]);
$agentsId = '';
foreach ($tmpAgents as $tmpAgent) {
$tmpAgentData = explode('|', $tmpAgent);
$agentsId .= (empty($agentsId) === false) ? ', '.$tmpAgentData[2] : $tmpAgentData[2];
}
}
} else { } else {
if (empty($args[2]) === false) { if (empty($args[2]) === false) {
$agents_id = sprintf( $agentsId = sprintf(
'(%s) %s', '<em>(%s)</em> %s',
__('regex'), __('regex'),
$args[2] $args[2]
); );
} else { } else {
$agents_id = __('None'); $agentsId = __('None');
} }
} }
$report_type = $args[8]; // Assignations.
$report_per_agent = $args[3]; $agentsId = ui_print_truncate_text($agentsId, 120);
$report_name = $args[4]; $reportPerAgent = ((string) $args[3] === '1') ? __('Yes') : __('No');
$email = $args[5]; $reportName = ui_print_truncate_text($args[4], 120);
$email = ui_print_truncate_text($args[5], 120);
$reportType = $args[8];
// Table row.
$data[2] .= '<br>- '.__('Template').': '; $data[2] .= '<br>- '.__('Template').': ';
$data[2] .= '<a href="'.ui_get_full_url('index.php?sec=reporting&sec2=enterprise/godmode/reporting/reporting_builder.template&action=edit&id_template='.$args[0]).'">'; $data[2] .= html_print_anchor(
$data[2] .= $template['name'].'</a>'; [
$data[2] .= '<br>- '.__('Agents').': '.ui_print_truncate_text($agents_id, 120).'</a>'; 'href' => ui_get_full_url(
$data[2] .= '<br>- '.__('Report per agent').': '.$report_per_agent.'</a>'; 'index.php?sec=reporting&sec2=enterprise/godmode/reporting/reporting_builder.template&action=edit&id_template='.$args[0]
$data[2] .= '<br>- '.__('Report name').': '.$report_name.'</a>'; ),
$data[2] .= '<br>- '.__('Email').": <a href='mailto:".$email."'>".$email.'</a>'; 'content' => $template['name'],
$data[2] .= '<br>- '.__('Report type').': '.$report_type; ],
true
);
$data[2] .= '<br>- '.__('Agents').': '.$agentsId;
$data[2] .= '<br>- '.__('Report per agent').': '.$reportPerAgent;
$data[2] .= '<br>- '.__('Report name').': '.$reportName;
$data[2] .= '<br>- '.__('Email').': '.$email;
$data[2] .= '<br>- '.__('Report type').': '.$reportType;
break; break;
case 'cron_task_execute_custom_script': case 'cron_task_execute_custom_script':

View File

@ -1113,11 +1113,21 @@ class Item extends CachedModel
// The layout can be from another node. // The layout can be from another node.
$linkedLayoutNodeId = $linkedVisualConsole['linkedLayoutNodeId']; $linkedLayoutNodeId = $linkedVisualConsole['linkedLayoutNodeId'];
// Check ACL. if (empty($linkedLayoutNodeId) === false && \is_metaconsole() === true) {
$db_connector = metaconsole_get_connection_by_id($linkedLayoutNodeId);
metaconsole_load_external_db($db_connector);
}
$visualConsole = VC::fromDB(['id' => $vcId]); $visualConsole = VC::fromDB(['id' => $vcId]);
if (empty($linkedLayoutNodeId) === false && \is_metaconsole() === true) {
metaconsole_restore_db();
}
$visualConsoleData = $visualConsole->toArray(); $visualConsoleData = $visualConsole->toArray();
$vcGroupId = $visualConsoleData['groupId']; $vcGroupId = $visualConsoleData['groupId'];
// Check ACL.
$aclRead = \check_acl($config['id_user'], $vcGroupId, 'VR'); $aclRead = \check_acl($config['id_user'], $vcGroupId, 'VR');
// To build the link to another visual console // To build the link to another visual console
// you must have read permissions of the visual console // you must have read permissions of the visual console

View File

@ -129,7 +129,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.759'; $version = '7.0NG.759';
$build = '220202'; $build = '220203';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -1777,6 +1777,13 @@ $table->data[4][0] .= __('Not condition').'&nbsp;'.ui_print_help_tip(__('If you
} }
if (!is_snapshot_data($row['datos'])) { if (!is_snapshot_data($row['datos'])) {
if ($tresholds === true || $graph_type === 'boolean') {
unset($graph_params['histogram']);
}
$graph_params_str = http_build_query($graph_params);
$link = 'winopeng_var(\''.$url.'?'.$graph_params_str.'\',\''.$win_handle.'\', 800, 480)';
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart.png', true, ['border' => '0', 'alt' => '', 'class' => 'invert_filter']).'</a>'; $data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart.png', true, ['border' => '0', 'alt' => '', 'class' => 'invert_filter']).'</a>';
} }

View File

@ -139,7 +139,7 @@ if ($has_management_acl) {
$hash = md5($config['dbpass'].$idMap.$config['id_user']); $hash = md5($config['dbpass'].$idMap.$config['id_user']);
$buttons['public_link']['text'] = '<a href="'.ui_get_full_url( $buttons['public_link']['text'] = '<a href="'.ui_get_full_url(
'operation/gis_maps/public_console.php?hash='.$hash.'&map_id='.$idMap.'&id_user='.$config['id_user'] 'operation/gis_maps/public_console.php?hash='.$hash.'&map_id='.$idMap.'&id_user='.$config['id_user']
).'" target="_blank">'.html_print_image('images/camera_mc.png', true, ['title' => __('Show link to public Visual Console'), 'class' => 'invert_filter']).'</a>'; ).'" target="_blank">'.html_print_image('images/camera_mc.png', true, ['title' => __('Show link to public GIS map'), 'class' => 'invert_filter']).'</a>';
} }
$times = [ $times = [

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220202 %define release 220203
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220202 %define release 220203
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220202 %define release 220203
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.759-220202 Version: 7.0NG.759-220203
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.759-220202" pandora_version="7.0NG.759-220203"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.759"; my $pandora_version = "7.0NG.759";
my $pandora_build = "220202"; my $pandora_build = "220203";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -1413,7 +1413,7 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
my $return_code = ($? >> 8) & 0xff; my $return_code = ($? >> 8) & 0xff;
logger($pa_config, "Command '$command_timeout' for action '" . safe_output($action->{'name'}) . "' alert '". safe_output($alert->{'name'}) . "' agent '" . (defined ($agent) ? safe_output($agent->{'alias'}) : 'N/A') . "' returned with errorlevel " . $return_code, 8); logger($pa_config, "Command '$command_timeout' for action '" . safe_output($action->{'name'}) . "' alert '". safe_output($alert->{'name'}) . "' agent '" . (defined ($agent) ? safe_output($agent->{'alias'}) : 'N/A') . "' returned with errorlevel " . $return_code, 8);
if ($return_code != 0) { if ($return_code != 0) {
logger ($pa_config, "Action '" . safe_output($action->{'name'}) . "' alert '" . safe_output($alert->{'name'}) . "' agent '" . (defined ($agent) ? safe_output($agent->{'alias'}) : 'N/A') . "' exceeded the global alert timeout " . $pa_config->{'global_alert_timeout'} . " seconds" , 8); logger ($pa_config, "Action '" . safe_output($action->{'name'}) . "' alert '" . safe_output($alert->{'name'}) . "' agent '" . (defined ($agent) ? safe_output($agent->{'alias'}) : 'N/A') . "' exceeded the global alert timeout " . $pa_config->{'global_alert_timeout'} . " seconds" , 3);
} }
} }
}; };

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.759"; my $pandora_version = "7.0NG.759";
my $pandora_build = "220202"; my $pandora_build = "220203";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220202 %define release 220203
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220202 %define release 220203
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.759" PI_VERSION="7.0NG.759"
PI_BUILD="220202" PI_BUILD="220203"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.759 Build 220202"; my $version = "7.0NG.759 Build 220203";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.759 Build 220202"; my $version = "7.0NG.759 Build 220203";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);