diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..5135af0e45 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.exe filter=lfs diff=lfs merge=lfs -text diff --git a/extras/Dockerfile b/extras/Dockerfile deleted file mode 100644 index 8f27c730b8..0000000000 --- a/extras/Dockerfile +++ /dev/null @@ -1,62 +0,0 @@ -# Dockerfile for the Pandora FMS image. -FROM debian:jessie - -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN groupadd -r mysql && useradd -r -g mysql mysql - -RUN mkdir /docker-entrypoint-initdb.d - -# FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db: -# File::Basename -# File::Copy -# Sys::Hostname -# Data::Dumper -RUN apt-get update && apt-get install -y perl pwgen git openssh-client --no-install-recommends && rm -rf /var/lib/apt/lists/* - -# gpg: key 5072E1F5: public key "MySQL Release Engineering " imported -RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 - -ENV MYSQL_MAJOR 5.6 -ENV MYSQL_VERSION 5.6.29-1debian8 - -RUN echo "deb http://repo.mysql.com/apt/debian/ jessie mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list - -# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) -# also, we set debconf keys to make APT a little quieter -RUN { \ - echo mysql-community-server mysql-community-server/data-dir select ''; \ - echo mysql-community-server mysql-community-server/root-pass password ''; \ - echo mysql-community-server mysql-community-server/re-root-pass password ''; \ - echo mysql-community-server mysql-community-server/remove-test-db select false; \ - } | debconf-set-selections \ - && apt-get update && apt-get install -y mysql-server="${MYSQL_VERSION}" && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql - -# comment out a few problematic configuration values -# don't reverse lookup hostnames, they are usually another container -RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf \ - && echo 'skip-host-cache\nskip-name-resolve' | awk '{ print } $1 == "[mysqld]" && c == 0 { c = 1; system("cat") }' /etc/mysql/my.cnf > /tmp/my.cnf \ - && mv /tmp/my.cnf /etc/mysql/my.cnf - -VOLUME /var/lib/mysql - -COPY docker-entrypoint.sh /entrypoint.sh -COPY pandora.cnf /etc/mysql/conf.d -COPY pandora_initdb.sh /docker-entrypoint-initdb.d -ENTRYPOINT ["/entrypoint.sh"] - -# Make ssh dir -RUN mkdir /root/.ssh/ -# Copy over private key, and set permissions -RUN echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config -RUN chown -R root:root /root/.ssh - - -#Clone the repo -RUN git config --global http.sslVerify false -RUN git clone -b develop --single-branch https://github.com/pandorafms/pandorafms.git /tmp/pandorafms -#RUN mv -f /tmp/pandorafms/pandora_console/pandoradb.sql /docker-entrypoint-initdb.d -#RUN mv -f /tmp/pandorafms/pandora_console/pandoradb_data.sql /docker-entrypoint-initdb.d - -EXPOSE 3306 -CMD ["mysqld"] diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index a0f08822e1..fe4af3d924 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -72,7 +72,7 @@ check_pre_pandora () { export MYSQL_PWD=$DBPASS echo -en "${cyan}Checking environment ... ${reset}" - rpm -qa | grep pandora &>> /dev/null && local fail=true + rpm -qa | grep 'pandorafms_' &>> /dev/null && local fail=true [ -d "$PANDORA_CONSOLE" ] && 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 @@ -170,7 +170,7 @@ http://rpms.remirepo.net/enterprise/remi-release-7.rpm \ https://repo.percona.com/yum/percona-release-latest.noarch.rpm" execute_cmd "yum install -y $extra_repos" "Installing extra repositories" -execute_cmd "yum-config-manager --enable remi-php74" "Configuring PHP" +execute_cmd "yum-config-manager --enable remi-php80" "Configuring PHP" # Install percona Database #[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf @@ -282,6 +282,8 @@ server_dependencies=" \ expect \ openssh-clients \ java \ + bind-utils \ + whois \ 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 \ https://firefly.artica.es/centos7/pandorawmic-1.0.0-1.x86_64.rpm" diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index 5b549a2933..fd4855f67b 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -14,18 +14,19 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf -S_VERSION='2022052501' +S_VERSION='202209231' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" # define default variables [ "$TZ" ] || TZ="Europe/Madrid" [ "$MYVER" ] || MYVER=57 -[ "$PHPVER" ] || PHPVER=7 +[ "$PHPVER" ] || PHPVER=8 [ "$DBHOST" ] || DBHOST=127.0.0.1 [ "$DBNAME" ] || DBNAME=pandora [ "$DBUSER" ] || DBUSER=pandora [ "$DBPASS" ] || DBPASS=pandora [ "$DBPORT" ] || DBPORT=3306 +[ "$DBROOTUSER" ] || DBROOTUSER=root [ "$DBROOTPASS" ] || DBROOTPASS=pandora [ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0 [ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0 @@ -73,13 +74,16 @@ 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 + rpm -qa | grep 'pandorafms_' &>> /dev/null && local fail=true [ -d "$PANDORA_CONSOLE" ] && 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 + + if [ "$SKIP_DATABASE_INSTALL" -eq '0' ]; then + export MYSQL_PWD=$DBPASS + echo "use $DBNAME" | mysql -u$DBUSER -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true + fi [ ! $fail ] check_cmd_status 'Error there is a current Pandora FMS installation on this node, please remove it to execute a clean install' @@ -214,7 +218,7 @@ if [ "$PHPVER" -eq '8' ] ; then execute_cmd "dnf module install -y php:remi-8.0" "Configuring PHP 8" fi -# Install percona Database + # Install percona Database execute_cmd "dnf module disable -y mysql" "Disabiling mysql module" if [ "$MYVER" -eq '80' ] ; then @@ -226,7 +230,6 @@ if [ "$MYVER" -ne '80' ] ; then execute_cmd "dnf install -y Percona-Server-server-57 percona-xtrabackup-24" "Installing Percona Server 57" fi - # Console dependencies console_dependencies=" \ php \ @@ -335,6 +338,8 @@ server_dependencies=" \ expect \ openssh-clients \ java \ + bind-utils \ + whois \ 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 \ https://firefly.artica.es/centos8/pandorawmic-1.0.0-1.x86_64.rpm" @@ -350,8 +355,8 @@ vmware_dependencies=" \ perl-Crypt-Random-Seed \ perl-Math-Random-ISAAC \ perl-JSON \ + perl-Crypt-SSLeay \ 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" @@ -401,30 +406,28 @@ if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev) if [ "$MYVER" -eq '80' ] ; then echo """ - SET PASSWORD FOR 'root'@'localhost' = 'Pandor4!'; + SET PASSWORD FOR '$DBROOTUSER'@'localhost' = 'Pandor4!'; UNINSTALL COMPONENT 'file://component_validate_password'; - SET PASSWORD FOR 'root'@'localhost' = '$DBROOTPASS'; - """ | mysql --connect-expired-password -uroot &>> "$LOGFILE" + SET PASSWORD FOR '$DBROOTUSER'@'localhost' = '$DBROOTPASS'; + """ | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE" fi if [ "$MYVER" -ne '80' ] ; then echo """ - SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!'); + SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('Pandor4!'); UNINSTALL PLUGIN validate_password; - SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$DBROOTPASS'); - """ | mysql --connect-expired-password -uroot &>> "$LOGFILE"fi + SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('$DBROOTPASS'); + """ | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE"fi fi -fi -export MYSQL_PWD=$DBROOTPASS -echo -en "${cyan}Creating Pandora FMS database...${reset}" -echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST -check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support." -echo "CREATE USER \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -uroot -P$DBPORT -h$DBHOST -echo "ALTER USER \"$DBUSER\"@'%' IDENTIFIED WITH mysql_native_password BY \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST -echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -uroot -P$DBPORT -h$DBHOST + export MYSQL_PWD=$DBROOTPASS + echo -en "${cyan}Creating Pandora FMS database...${reset}" + echo "create database $DBNAME" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST + check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support." -export MYSQL_PWD=$DBPASS + echo "CREATE USER \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST + echo "ALTER USER \"$DBUSER\"@'%' IDENTIFIED WITH mysql_native_password BY \"$DBPASS\"" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST + echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST #Generating my.cnf cat > /etc/my.cnf << EO_CONFIG_F @@ -471,12 +474,14 @@ pid-file=/var/run/mysqld/mysqld.pid EO_CONFIG_F -if [ "$MYVER" -eq '80' ] ; then - sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf + if [ "$MYVER" -eq '80' ] ; then + sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf + fi + + execute_cmd "systemctl restart mysqld" "Configuring database engine" + execute_cmd "systemctl enable mysqld --now" "Enabling Database service" fi - -execute_cmd "systemctl restart mysqld" "Configuring database engine" - +export MYSQL_PWD=$DBPASS #Define packages if [ "$PANDORA_BETA" -eq '0' ] ; then @@ -503,7 +508,6 @@ 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" diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh new file mode 100644 index 0000000000..feced2cbe7 --- /dev/null +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -0,0 +1,746 @@ +#!/bin/bash +############################################################################################################## +# PandoraFMS Community online installation script for Ubuntu 22.04 +############################################################################################################## +## Tested versions ## +# Ubuntu 22.04.1 + +#avoid promps +export DEBIAN_FRONTEND=noninteractive +export NEEDRESTART_SUSPEND=1 + +#Constants +PANDORA_CONSOLE=/var/www/html/pandora_console +PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf +PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf +WORKDIR=/opt/pandora/deploy + + +S_VERSION='2022052501' +LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" + +# define default variables +[ "$TZ" ] || TZ="Europe/Madrid" +[ "$PHPVER" ] || PHPVER=8.0 +[ "$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") +[ "$PANDORA_BETA" ] || PANDORA_BETA=0 + +# 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 "$WORKDIR" &>> "$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 "$WORKDIR" &>> "$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}" + [ -d "$PANDORA_CONSOLE" ] && local fail=true + [ -f /usr/bin/pandora_server ] && local fail=true + echo "use $DBNAME" | mysql -u$DBUSER -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 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 Pandora FMS" + 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 Ubuntu 22.04 ver. $S_VERSION" + +# Ubuntu Version +if [ ! "$(grep -Ei 'Ubuntu' /etc/lsb-release)" ]; then + printf "\n ${red}Error this is not a Ubuntu system, this installer is compatible with Ubuntu systems only${reset}\n" + exit 1 +fi + + +echo -en "${cyan}Check Ubuntu Version...${reset}" +[ $(sed -nr 's/VERSION_ID+=\s*"([0-9][0-9].[0-9][0-9])"$/\1/p' /etc/os-release) == "22.04" ] +check_cmd_status 'Error OS version, Ubuntu 22.04 is expected' + +#Detect OS +os_name=$(grep ^PRETTY_NAME= /etc/os-release | cut -d '=' -f2 | tr -d '"') +execute_cmd "echo $os_name" "OS detected: ${os_name}" + +# 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 +[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora + +#advicing BETA PROGRAM +[ "$PANDORA_BETA" -ne '0' ] && echo -e "${red}BETA version enable using nightly PandoraFMS packages${reset}" + +# Connectivity +check_repo_connection + +#Install awk, sed, grep if not present +execute_cmd "apt install -y gawk sed grep" 'Installing needed tools' + +# Systemd +execute_cmd "systemctl --version" "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)' + +# Setting timezone +rm -rf /etc/localtime &>> "$LOGFILE" +execute_cmd "timedatectl set-timezone $TZ" "Setting Timezone $TZ" + +# 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 "apt --version" 'Checking needed tools: apt' + +# Creating working directory +rm -rf "$WORKDIR" &>> "$LOGFILE" +mkdir -p "$WORKDIR" &>> "$LOGFILE" +execute_cmd "cd $WORKDIR" "Moving to workdir: $WORKDIR" + +## Install utils +execute_cmd "apt update" "Updating repos" +execute_cmd "apt install -y net-tools vim curl wget software-properties-common apt-transport-https" "Installing utils" + +#Installing Apache and php-fpm +[ -e "/etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list" ] || execute_cmd "add-apt-repository ppa:ondrej/php -y" "Enable ppa:ondrej/php repo" +execute_cmd "apt update" "Updating repos" +execute_cmd "apt install -y php$PHPVER-fpm php$PHPVER-common libapache2-mod-fcgid php$PHPVER-cli apache2" "Installing apache and php-fpm" +#execute_cmd "a2enmod proxy_fcgi setenvif && a2enconf php$PHPVER-fpm" "Enabling php-fpm" +echo -en "${cyan}Enabling php$PHPVER-fpm...${reset}" + a2enmod proxy_fcgi setenvif &>> "$LOGFILE" && a2enconf php$PHPVER-fpm &>> "$LOGFILE" +check_cmd_status "Error enabling php$PHPVER-fpm " +systemctl restart php$PHPVER-fpm &>> "$LOGFILE" + +# Console dependencies + console_dependencies=" \ + ldap-utils \ + postfix \ + wget \ + graphviz \ + xfonts-75dpi \ + xfonts-100dpi \ + xfonts-ayu \ + xfonts-intl-arabic \ + xfonts-intl-asian \ + xfonts-intl-phonetic \ + xfonts-intl-japanese-big \ + xfonts-intl-european \ + xfonts-intl-chinese \ + xfonts-intl-japanese \ + xfonts-intl-chinese-big \ + libzstd1 \ + gir1.2-atk-1.0 \ + libavahi-common-data \ + cairo-perf-utils \ + libfribidi-bin \ + php$PHPVER-mcrypt \ + php$PHPVER-gd \ + php$PHPVER-curl \ + php$PHPVER-mysql \ + php$PHPVER-ldap \ + php$PHPVER-fileinfo \ + php$PHPVER-gettext \ + php$PHPVER-snmp \ + php$PHPVER-mbstring \ + php$PHPVER-zip \ + php$PHPVER-xmlrpc \ + php$PHPVER-xml \ + php$PHPVER-yaml \ + libnet-telnet-perl \ + whois" +execute_cmd "apt install -y $console_dependencies" "Installing Pandora FMS Console dependencies" + +# Server dependencies +server_dependencies=" \ + perl \ + nmap \ + fping \ + sudo \ + net-tools \ + nfdump \ + expect \ + openssh-client \ + postfix \ + unzip \ + xprobe \ + coreutils \ + libio-compress-perl \ + libmoosex-role-timer-perl \ + libdbd-mysql-perl \ + libcrypt-mysql-perl \ + libhttp-request-ascgi-perl \ + liblwp-useragent-chicaching-perl \ + liblwp-protocol-https-perl \ + snmp \ + libnetaddr-ip-perl \ + libio-socket-ssl-perl \ + libio-socket-socks-perl \ + libio-socket-ip-perl \ + libio-socket-inet6-perl \ + libnet-telnet-perl \ + libjson-perl \ + libencode-perl \ + libgeo-ip-perl \ + openjdk-8-jdk " +execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies" + +# wmic and pandorawmic +execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/wmic" "Downloading wmic" +execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic" +echo -en "${cyan}Installing wmic and pandorawmic...${reset}" + chmod +x pandorawmic wmic &>> "$LOGFILE" && \ + cp -a wmic /usr/bin/ &>> "$LOGFILE" && \ + cp -a pandorawmic /usr/bin/ &>> "$LOGFILE" +check_cmd_status "Error Installing phanromjs" + +# phantomjs +echo -en "${cyan}Installing phantomjs...${reset}" + export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" + export OPENSSL_CONF=/etc/ssl + curl -LSs -O "https://firefly.artica.es/pandorafms/utils/$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \ + tar xvjf "$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \ + mv $PHANTOM_JS/bin/phantomjs /usr/bin &>> "$LOGFILE" && \ + /usr/bin/phantomjs --version &>> "$LOGFILE" +check_cmd_status "Error Installing phanromjs" + + +# SDK VMware perl dependencies +vmware_dependencies=" \ + lib32z1 \ + lib32z1 \ + build-essential \ + uuid uuid-dev \ + libssl-dev \ + perl-doc \ + libxml-libxml-perl \ + libcrypt-ssleay-perl \ + libsoap-lite-perl \ + libmodule-build-perl" +execute_cmd "apt install -y $vmware_dependencies" "Installing VMware SDK dependencies" +execute_cmd "wget https://firefly.artica.es/pandorafms/utils/VMware-vSphere-Perl-SDK-7.0.0-16453907.x86_64.tar.gz" "Downloading VMware SDK" +echo -en "${cyan}Installing VMware SDK...${reset}" + tar xvzf VMware-vSphere-Perl-SDK-7.0.0-16453907.x86_64.tar.gz &>> "$LOGFILE" + cd vmware-vsphere-cli-distrib/ &>> "$LOGFILE" + sed --follow-symlinks -i -e "s/[^#].*show_EULA().*/ #show_EULA();/g" vmware-install.pl &>> "$LOGFILE" + ./vmware-install.pl --default &>> "$LOGFILE" +check_cmd_status "Error Installing VMware SDK" +execute_cmd "cpan Crypt::OpenSSL::AES" "Installing extra vmware dependencie" +cd $WORKDIR &>> "$LOGFILE" + + + +# Instant client Oracle +execute_cmd "mkdir -p /opt/oracle" "Creating Oracle instant client directory /opt/oracle" +execute_cmd "wget https://download.oracle.com/otn_software/linux/instantclient/19800/instantclient-basic-linux.x64-19.8.0.0.0dbru.zip" "Downloading Oracle instant client" +execute_cmd "wget https://download.oracle.com/otn_software/linux/instantclient/19800/instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip" "Downloading Oracle sqlplus" +echo -en "${cyan}Installing Oracle instant client...${reset}" + rm -fr /opt/oracle/* &>> "$LOGFILE" + unzip instantclient-basic-linux.x64-19.8.0.0.0dbru.zip -d /opt/oracle/ &>> "$LOGFILE" + unzip instantclient-sqlplus-linux.x64-19.8.0.0.0dbru.zip -d /opt/oracle/ &>> "$LOGFILE" +check_cmd_status "Error Installing Oracle instant client" + +#Configuring env variables +cat >> /root/.profile << 'EOF_ENV' +#!/bin/bash +VERSION=19.8 +export PATH=$PATH:/opt/oracle/instantclient_19_8 +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/oracle/instantclient_19_8 +export ORACLE_HOME=/opt/oracle/instantclient_19_8 +EOF_ENV + +source '/root/.profile' &>> "$LOGFILE" + +#ipam dependencies +ipam_dependencies=" \ + xprobe \ + libnetaddr-ip-perl \ + coreutils \ + libdbd-mysql-perl \ + libxml-simple-perl \ + libgeo-ip-perl \ + libio-socket-inet6-perl \ + libxml-twig-perl \ + libnetaddr-ip-perl" +execute_cmd "apt install -y $ipam_dependencies" "Installing IPAM Dependencies" + +# MSSQL dependencies el8 +curl -sSL https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc &>> "$LOGFILE" +curl -sSL https://packages.microsoft.com/config/ubuntu/20.04/prod.list | tee /etc/apt/sources.list.d/microsoft-prod.list &>> "$LOGFILE" +apt update &>> "$LOGFILE" +execute_cmd "env ACCEPT_EULA=Y apt install -y msodbcsql17" "Installing ODBC Driver for Microsoft(R) SQL Server(R)" +MS_ID=$(head -1 /etc/odbcinst.ini | tr -d '[]') &>> "$LOGFILE" + +# Disabling apparmor and ufw +systemctl stop ufw.service &>> "$LOGFILE" +systemctl disable ufw &>> "$LOGFILE" +systemctl stop apparmor &>> "$LOGFILE" +systemctl disable apparmor &>> "$LOGFILE" + +#install mysql +debconf-set-selections <<< $(echo -n "mysql-server mysql-server/root_password password $DBROOTPASS") &>> "$LOGFILE" +debconf-set-selections <<< $(echo -n "mysql-server mysql-server/root_password_again password $DBROOTPASS") &>> "$LOGFILE" +echo -en "${cyan}Installing MySql Server...${reset}" + env DEBIAN_FRONTEND=noninteractive apt install -y mysql-server &>> "$LOGFILE" +check_cmd_status "Error Installing MySql Server" + + +#Configuring Database +if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then + execute_cmd "systemctl start mysql" "Starting database engine" + + export MYSQL_PWD=$DBROOTPASS + echo -en "${cyan}Creating Pandora FMS database...${reset}" + echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST + check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support." + + echo "CREATE USER \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -uroot -P$DBPORT -h$DBHOST + echo "ALTER USER \"$DBUSER\"@'%' IDENTIFIED WITH mysql_native_password BY \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST + echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -uroot -P$DBPORT -h$DBHOST +fi +export MYSQL_PWD=$DBPASS + +#Generating my.cnf +cat > /etc/mysql/my.cnf << EOF_DB +[mysqld] +datadir=/var/lib/mysql +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 + +sql_mode="" + +log-error=/var/log/mysql/error.log +[mysqld_safe] +log-error=/var/log/mysqld.log +pid-file=/var/run/mysqld/mysqld.pid + +EOF_DB + +execute_cmd "systemctl restart mysql" "Configuring and restarting database engine" + + +#Define packages +if [ "$PANDORA_BETA" -eq '0' ] ; then + [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_server-7.0NG.tar.gz" + [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_console-7.0NG.tar.gz" + [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_unix-7.0NG.tar.gz" +elif [ "$PANDORA_BETA" -ne '0' ] ; then + [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz" + [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz" + [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_unix-7.0NG.tar.gz" +fi + +# Downloading Pandora Packages +cd $WORKDIR &>> "$LOGFILE" + +curl -LSs --output pandorafms_console-7.0NG.tar.gz "${PANDORA_CONSOLE_PACKAGE}" &>> "$LOGFILE" +curl -LSs --output pandorafms_server-7.0NG.tar.gz "${PANDORA_SERVER_PACKAGE}" &>> "$LOGFILE" +curl -LSs --output pandorafms_agent_unix-7.0NG.tar.gz "${PANDORA_AGENT_PACKAGE}" &>> "$LOGFILE" + +# Install PandoraFMS Console +echo -en "${cyan}Installing PandoraFMS Console...${reset}" + tar xvzf pandorafms_console-7.0NG.tar.gz &>> "$LOGFILE" && cp -Ra pandora_console /var/www/html/ &>> "$LOGFILE" +check_cmd_status "Error installing PandoraFMS Console" +rm -f $PANDORA_CONSOLE/*.spec &>> "$LOGFILE" + +# Install Pandora FMS Server +echo -en "${cyan}Installing PandoraFMS Server...${reset}" + useradd pandora &>> "$LOGFILE" + tar xvfz $WORKDIR/pandorafms_server-7.0NG.tar.gz &>> $LOGFILE && cd pandora_server && ./pandora_server_installer --install &>> $LOGFILE && cd $WORKDIR &>> $LOGFILE +check_cmd_status "Error installing PandoraFMS Server" + +#Install agent: +execute_cmd "apt install -y libyaml-tiny-perl perl coreutils wget curl unzip procps python3 python3-pip" "Installing PandoraFMS Agent Dependencies" +echo -en "${cyan}Installing PandoraFMS Agent...${reset}" + tar xvzf $WORKDIR/pandorafms_agent_unix-7.0NG.tar.gz &>> "$LOGFILE" && cd unix && ./pandora_agent_installer --install &>> $LOGFILE && cp -a tentacle_client /usr/local/bin/ &>> $LOGFILE && cd $WORKDIR +check_cmd_status "Error installing PandoraFMS Agent" + +# Copy gotty utility +cd $WORKDIR &>> "$LOGFILE" +execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/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' + +# Config servicesa +#Configure apache2 +#Enable SSL connections +cat > /etc/apache2/conf-available/ssl-params.conf << EOF_PARAM +SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH + + SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 + + SSLHonorCipherOrder On + + + Header always set X-Frame-Options DENY + + Header always set X-Content-Type-Options nosniff + + # Requires Apache >= 2.4 + + SSLCompression off + + SSLUseStapling on + + SSLStaplingCache "shmcb:logs/stapling-cache(150000)" + + + # Requires Apache >= 2.4.11 + + SSLSessionTickets Off +EOF_PARAM + +a2enmod ssl &>> "$LOGFILE" +a2enmod headers &>> "$LOGFILE" +a2enconf ssl-params &>> "$LOGFILE" +a2ensite default-ssl &>> "$LOGFILE" +a2enconf ssl-params &>> "$LOGFILE" +apache2ctl configtest &>> "$LOGFILE" + +execute_cmd "systemctl restart apache2" "Enable SSL mod and Restarting Apache2" + +execute_cmd "systemctl enable mysql --now" "Enabling Database service" +execute_cmd "systemctl enable apache2 --now" "Enabling Apache2 service" +execute_cmd "systemctl enable php$PHPVER-fpm --now" "Enabling php$PHPVER-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 +# Set console config file +cat > $PANDORA_CONSOLE/include/config.php << EO_CONFIG_F + /etc/apache2/conf-enabled/pandora_security.conf << EO_CONFIG_F + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + +EO_CONFIG_F + +#Enable quickshell proxy +cat >> /etc/apache2/mods-enabled/00-proxy.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 + +# Fixing console permissions +chmod 600 $PANDORA_CONSOLE/include/config.php &>> "$LOGFILE" +chown -R www-data:www-data $PANDORA_CONSOLE &>> "$LOGFILE" +mv $PANDORA_CONSOLE/install.php $PANDORA_CONSOLE/install.done &>> "$LOGFILE" + +# Prepare php.ini +## Prepare php config +ln -s /etc/php/$PHPVER/fpm/php.ini /etc/ +sed --follow-symlinks -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini +sed --follow-symlinks -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini +sed --follow-symlinks -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini +sed --follow-symlinks -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini +sed --follow-symlinks -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini +sed --follow-symlinks -i -e "s/^disable_functions/;disable_functions/" /etc/php.ini + +#adding 900s to httpd timeout +#echo 'TimeOut 900' > /etc/httpd/conf.d/timeout.conf + +cat > /var/www/html/index.html << EOF_INDEX + +EOF_INDEX + +execute_cmd "systemctl restart apache2" "Restarting apache2 after configuration" +execute_cmd "systemctl restart php$PHPVER-fpm" "Restarting php$PHPVER-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 +sed -i -e "s/^#.mssql_driver.*/mssql_driver $MS_ID/g" $PANDORA_SERVER_CONF + +# Adding group www-data to pandora server conf. +grep -q "group www-data" $PANDORA_SERVER_CONF || \ +cat >> $PANDORA_SERVER_CONF << EOF_G + +#Adding group www-data to assing remote-config permission correctly for ubuntu 22.04 +group www-data +EOF_G + +# Enable agent remote config +sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF + +# Set Oracle environment for pandora_server +cat > /etc/pandora/pandora_server.env << 'EOF_ENV' +#!/bin/bash +VERSION=19.8 +export PATH=$PATH:/opt/oracle/instantclient_19_8 +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/oracle/instantclient_19_8 +export ORACLE_HOME=/opt/oracle/instantclient_19_8 +export OPENSSL_CONF=/etc/ssl +EOF_ENV + +# Kernel optimization + +if [ "$SKIP_KERNEL_OPTIMIZATIONS" -eq '0' ] ; then +cat >> /etc/sysctl.conf < /etc/logrotate.d/pandora_server < /etc/logrotate.d/pandora_agent <> "$LOGFILE" +chmod +x /etc/init.d/pandora_websocket_engine + +# Start Websocket engine +/etc/init.d/pandora_websocket_engine start &>> "$LOGFILE" + +# Configure websocket to be started at start. +systemctl enable pandora_websocket_engine &>> "$LOGFILE" + +# Enable pandora ha service +execute_cmd "/etc/init.d/pandora_server start" "Starting Pandora FMS Server" +systemctl enable pandora_server &>> "$LOGFILE" + +# starting tentacle server +execute_cmd "service tentacle_serverd start" "Starting Tentacle Server" +systemctl enable tentacle_serverd &>> "$LOGFILE" + +# 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 adn configuring Agente +sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF &>> "$LOGFILE" +execute_cmd "/etc/init.d/pandora_agent_daemon start" "Starting PandoraFSM Agent" +systemctl enable pandora_agent_daemon &>> "$LOGFILE" + +#fix path phantomjs +sed --follow-symlinks -i -e "s/^openssl_conf = openssl_init/#openssl_conf = openssl_init/g" /etc/ssl/openssl.cnf &>> "$LOGFILE" + +#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 "$HOME" +execute_cmd "rm -rf $WORKDIR" "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 these credentials to log in Pandora Console "g"[ User: admin / Password: pandora ]"n" \n"}' \ No newline at end of file diff --git a/extras/docker-entrypoint.sh b/extras/docker-entrypoint.sh deleted file mode 100755 index 90833a3eea..0000000000 --- a/extras/docker-entrypoint.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -set -eo pipefail - -# if command starts with an option, prepend mysqld -if [ "${1:0:1}" = '-' ]; then - set -- mysqld "$@" -fi - -if [ "$1" = 'mysqld' ]; then - # Get config - DATADIR="$("$@" --verbose --help --log-bin-index=`mktemp -u` 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" - - if [ ! -d "$DATADIR/mysql" ]; then - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and password option is not specified ' - echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' - exit 1 - fi - - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" - - echo 'Initializing database' - mysql_install_db --user=mysql --datadir="$DATADIR" --rpm --keep-my-cnf - echo 'Database initialized' - - "$@" --skip-networking & - pid="$!" - - mysql=( mysql --protocol=socket -uroot ) - - for i in {30..0}; do - if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then - break - fi - echo 'MySQL init process in progress...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 - fi - - if [ -z "$MYSQL_INITDB_SKIP_TZINFO" ]; then - # sed is for https://bugs.mysql.com/bug.php?id=20545 - mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | "${mysql[@]}" mysql - fi - - if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - MYSQL_ROOT_PASSWORD="$(pwgen -1 32)" - echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" - fi - "${mysql[@]}" <<-EOSQL - -- What's done in this file shouldn't be replicated - -- or products like mysql-fabric won't work - SET @@SESSION.SQL_LOG_BIN=0; - - DELETE FROM mysql.user ; - CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; - GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; - DROP DATABASE IF EXISTS test ; - FLUSH PRIVILEGES ; - EOSQL - - if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) - fi - - if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" | "${mysql[@]}" - mysql+=( "$MYSQL_DATABASE" ) - fi - - if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then - echo "CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;" | "${mysql[@]}" - - if [ "$MYSQL_DATABASE" ]; then - echo "GRANT ALL ON \`$MYSQL_DATABASE\`.* TO '$MYSQL_USER'@'%' ;" | "${mysql[@]}" - fi - - echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" - fi - - echo - for f in /docker-entrypoint-initdb.d/*; do - case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f"; echo ;; - *.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${mysql[@]}"; echo ;; - *) echo "$0: ignoring $f" ;; - esac - echo - done - - if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - "${mysql[@]}" <<-EOSQL - ALTER USER 'root'@'%' PASSWORD EXPIRE; - EOSQL - fi - if ! kill -s TERM "$pid" || ! wait "$pid"; then - echo >&2 'MySQL init process failed.' - exit 1 - fi - - echo - echo 'MySQL init process done. Ready for start up.' - echo - fi - - chown -R mysql:mysql "$DATADIR" -fi - -exec "$@" diff --git a/extras/docker/Dockerfile b/extras/docker/Dockerfile deleted file mode 100644 index fbe8b38107..0000000000 --- a/extras/docker/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -FROM pandorafms/pandorafms-base:centos7 - -# Build variables. -ARG BRANCH=develop -ARG DB_PASS=pandora - -# Clone the Pandora FMS repo. -RUN git clone --depth 1 -b "$BRANCH" https://github.com/pandorafms/pandorafms.git /tmp/pandorafms || \ - git clone --depth 1 -b develop https://github.com/pandorafms/pandorafms.git /tmp/pandorafms - -# Install the Pandora FMS Server. -RUN cd /tmp/pandorafms/pandora_server && \ -yes | ./pandora_server_installer --install && \ -sed -i "s/^dbuser.*/dbuser root/" /etc/pandora/pandora_server.conf && \ -sed -i "s/^dbpass.*/dbpass $DB_PASS/" /etc/pandora/pandora_server.conf - -# Install the Pandora FMS Agent. -RUN cd /tmp/pandorafms/pandora_agents/unix && \ -./pandora_agent_installer --install - -# Set the server's name in Apache's configuration file to avoid warnings. -RUN sed -i "s/#ServerName.*/ServerName localhost:80/" /etc/httpd/conf/httpd.conf - -# Install the Pandora FMS Console. -RUN rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql && \ - mkdir -p /var/log/mysql/ && chown mysql. /var/log/mysql && \ - chown mysql. -R /var/lib/mysql && \ - sudo -u mysql mysqld --initialize --explicit_defaults_for_timestamp && \ - sudo -u mysql mysqld --daemonize & \ - sleep 50 && \ - mysql_default_pass=$(cat /var/log/mysqld.log | grep "temporary password" | awk '{print $NF}') && \ - mysqladmin -u root -p"$mysql_default_pass" --user=root password 'pandora' && \ - httpd -k start && \ - cp -r /tmp/pandorafms/pandora_console /var/www/html && \ - chown -R apache.apache /var/www/html/pandora_console/ && \ - python /tmp/pandorafms/tests/install_console.py - -# Redirect HTTP requests to / to the Pandora FMS Console. -RUN echo '' > /var/www/html/index.html - -# Create the entrypoint script. -RUN echo -e '#/bin/bash\n \ -sudo -u mysql mysqld --daemonize &&\n \ -httpd -k start &&\n \ -/usr/sbin/crond &&\n \ -/etc/init.d/pandora_agent_daemon start && \ -/etc/init.d/pandora_server start && \ -tail -f /var/log/pandora/pandora_server.log' \ ->> /entrypoint.sh && \ -chmod +x /entrypoint.sh - -# Clean-up. -RUN rm -rf /tmp/pandorafms -RUN yum clean all - -EXPOSE 80 3306 41121 -ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] diff --git a/extras/docker/build_and_push.sh b/extras/docker/build_and_push.sh deleted file mode 100755 index c58a73bf8e..0000000000 --- a/extras/docker/build_and_push.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -docker build --rm=true --pull --no-cache --build-arg BRANCH="develop" --build-arg DB_PASS="pandora" -t pandorafms/pandorafms:7 . && \ -[ "$QA_ENV" == "" ] && \ -docker push pandorafms/pandorafms:7 diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index cb45a7bd15..00a1617190 100644 --- a/pandora_agents/pc/AIX/pandora_agent.conf +++ b/pandora_agents/pc/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762, AIX version +# Version 7.0NG.767, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index fa1ffa8133..9e90282e7d 100644 --- a/pandora_agents/pc/FreeBSD/pandora_agent.conf +++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762, FreeBSD Version +# Version 7.0NG.767, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf index 1036c5ac99..fd8b228e91 100644 --- a/pandora_agents/pc/HP-UX/pandora_agent.conf +++ b/pandora_agents/pc/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762, HP-UX Version +# Version 7.0NG.767, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index 1dadeb7920..94491a8855 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762, GNU/Linux +# Version 7.0NG.767, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/cmp.exe b/pandora_agents/pc/NT4/cmp.exe index 5ac8a30835..e2ec1bc62d 100644 Binary files a/pandora_agents/pc/NT4/cmp.exe and b/pandora_agents/pc/NT4/cmp.exe differ diff --git a/pandora_agents/pc/NT4/cut.exe b/pandora_agents/pc/NT4/cut.exe index a75f2963a7..13e2ffe8fb 100644 Binary files a/pandora_agents/pc/NT4/cut.exe and b/pandora_agents/pc/NT4/cut.exe differ diff --git a/pandora_agents/pc/NT4/date.exe b/pandora_agents/pc/NT4/date.exe index 069bae1481..8c42713953 100644 Binary files a/pandora_agents/pc/NT4/date.exe and b/pandora_agents/pc/NT4/date.exe differ diff --git a/pandora_agents/pc/NT4/expr.exe b/pandora_agents/pc/NT4/expr.exe index bce338407b..51e26d5588 100644 Binary files a/pandora_agents/pc/NT4/expr.exe and b/pandora_agents/pc/NT4/expr.exe differ diff --git a/pandora_agents/pc/NT4/gawk.exe b/pandora_agents/pc/NT4/gawk.exe index f4a2f21d3a..d86f83d0df 100644 Binary files a/pandora_agents/pc/NT4/gawk.exe and b/pandora_agents/pc/NT4/gawk.exe differ diff --git a/pandora_agents/pc/NT4/getreg.exe b/pandora_agents/pc/NT4/getreg.exe index 5e51053d84..6e7dfa57cd 100644 Binary files a/pandora_agents/pc/NT4/getreg.exe and b/pandora_agents/pc/NT4/getreg.exe differ diff --git a/pandora_agents/pc/NT4/grep.exe b/pandora_agents/pc/NT4/grep.exe index 9597377a38..cb29ed91c6 100644 Binary files a/pandora_agents/pc/NT4/grep.exe and b/pandora_agents/pc/NT4/grep.exe differ diff --git a/pandora_agents/pc/NT4/head.exe b/pandora_agents/pc/NT4/head.exe index 7f5ef8764a..9ef21e1f5f 100644 Binary files a/pandora_agents/pc/NT4/head.exe and b/pandora_agents/pc/NT4/head.exe differ diff --git a/pandora_agents/pc/NT4/ls.exe b/pandora_agents/pc/NT4/ls.exe index 388af5eb41..9ec7ea15a8 100644 Binary files a/pandora_agents/pc/NT4/ls.exe and b/pandora_agents/pc/NT4/ls.exe differ diff --git a/pandora_agents/pc/NT4/md5.exe b/pandora_agents/pc/NT4/md5.exe index 8bdc35ccc8..630421aa77 100644 Binary files a/pandora_agents/pc/NT4/md5.exe and b/pandora_agents/pc/NT4/md5.exe differ diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf index 4562f53bac..4de40aae53 100644 --- a/pandora_agents/pc/NT4/pandora_agent.conf +++ b/pandora_agents/pc/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762, GNU/Linux +# Version 7.0NG.767, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/pandora_agent.exe b/pandora_agents/pc/NT4/pandora_agent.exe index 9709b849c4..f87ec7f3b7 100644 Binary files a/pandora_agents/pc/NT4/pandora_agent.exe and b/pandora_agents/pc/NT4/pandora_agent.exe differ diff --git a/pandora_agents/pc/NT4/pandora_exec.exe b/pandora_agents/pc/NT4/pandora_exec.exe index f4fd0aa32b..a39039208b 100644 Binary files a/pandora_agents/pc/NT4/pandora_exec.exe and b/pandora_agents/pc/NT4/pandora_exec.exe differ diff --git a/pandora_agents/pc/NT4/sort.exe b/pandora_agents/pc/NT4/sort.exe index 8b583cff70..45d54876bc 100644 Binary files a/pandora_agents/pc/NT4/sort.exe and b/pandora_agents/pc/NT4/sort.exe differ diff --git a/pandora_agents/pc/NT4/srvany.exe b/pandora_agents/pc/NT4/srvany.exe index c7930cefa6..7071bdd7c1 100644 Binary files a/pandora_agents/pc/NT4/srvany.exe and b/pandora_agents/pc/NT4/srvany.exe differ diff --git a/pandora_agents/pc/NT4/tail.exe b/pandora_agents/pc/NT4/tail.exe index 36c2abc22f..baf603c232 100644 Binary files a/pandora_agents/pc/NT4/tail.exe and b/pandora_agents/pc/NT4/tail.exe differ diff --git a/pandora_agents/pc/NT4/tentacle_client.exe b/pandora_agents/pc/NT4/tentacle_client.exe index 9566f8cde2..48e5147d70 100644 Binary files a/pandora_agents/pc/NT4/tentacle_client.exe and b/pandora_agents/pc/NT4/tentacle_client.exe differ diff --git a/pandora_agents/pc/NT4/tr.exe b/pandora_agents/pc/NT4/tr.exe index 249cc46c09..026bef8e41 100644 Binary files a/pandora_agents/pc/NT4/tr.exe and b/pandora_agents/pc/NT4/tr.exe differ diff --git a/pandora_agents/pc/NT4/unzip.exe b/pandora_agents/pc/NT4/unzip.exe index b10387734a..4eff99bb94 100644 Binary files a/pandora_agents/pc/NT4/unzip.exe and b/pandora_agents/pc/NT4/unzip.exe differ diff --git a/pandora_agents/pc/NT4/wc.exe b/pandora_agents/pc/NT4/wc.exe index c0a2d1cd17..89d849732e 100644 Binary files a/pandora_agents/pc/NT4/wc.exe and b/pandora_agents/pc/NT4/wc.exe differ diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf index 00fa5178a7..c23c8bdfff 100644 --- a/pandora_agents/pc/SunOS/pandora_agent.conf +++ b/pandora_agents/pc/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762, Solaris Version +# Version 7.0NG.767, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Win32/PandoraAgent.exe b/pandora_agents/pc/Win32/PandoraAgent.exe index 29370d1d5b..0a1a6c72b0 100644 Binary files a/pandora_agents/pc/Win32/PandoraAgent.exe and b/pandora_agents/pc/Win32/PandoraAgent.exe differ diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index a48eb35ce5..35de6e4c44 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2021 Artica Soluciones Tecnologicas -# Version 7.0NG.762 +# Version 7.0NG.767 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software # Foundation; either version 2 of the Licence or any later version diff --git a/pandora_agents/pc/Win32/util/cmp.exe b/pandora_agents/pc/Win32/util/cmp.exe index 5ac8a30835..e2ec1bc62d 100644 Binary files a/pandora_agents/pc/Win32/util/cmp.exe and b/pandora_agents/pc/Win32/util/cmp.exe differ diff --git a/pandora_agents/pc/Win32/util/cut.exe b/pandora_agents/pc/Win32/util/cut.exe index a75f2963a7..13e2ffe8fb 100644 Binary files a/pandora_agents/pc/Win32/util/cut.exe and b/pandora_agents/pc/Win32/util/cut.exe differ diff --git a/pandora_agents/pc/Win32/util/date.exe b/pandora_agents/pc/Win32/util/date.exe index 069bae1481..8c42713953 100644 Binary files a/pandora_agents/pc/Win32/util/date.exe and b/pandora_agents/pc/Win32/util/date.exe differ diff --git a/pandora_agents/pc/Win32/util/expr.exe b/pandora_agents/pc/Win32/util/expr.exe index bce338407b..51e26d5588 100644 Binary files a/pandora_agents/pc/Win32/util/expr.exe and b/pandora_agents/pc/Win32/util/expr.exe differ diff --git a/pandora_agents/pc/Win32/util/gawk.exe b/pandora_agents/pc/Win32/util/gawk.exe index f4a2f21d3a..d86f83d0df 100644 Binary files a/pandora_agents/pc/Win32/util/gawk.exe and b/pandora_agents/pc/Win32/util/gawk.exe differ diff --git a/pandora_agents/pc/Win32/util/getreg.exe b/pandora_agents/pc/Win32/util/getreg.exe index 5e51053d84..6e7dfa57cd 100644 Binary files a/pandora_agents/pc/Win32/util/getreg.exe and b/pandora_agents/pc/Win32/util/getreg.exe differ diff --git a/pandora_agents/pc/Win32/util/grep.exe b/pandora_agents/pc/Win32/util/grep.exe index 9597377a38..cb29ed91c6 100644 Binary files a/pandora_agents/pc/Win32/util/grep.exe and b/pandora_agents/pc/Win32/util/grep.exe differ diff --git a/pandora_agents/pc/Win32/util/head.exe b/pandora_agents/pc/Win32/util/head.exe index 7f5ef8764a..9ef21e1f5f 100644 Binary files a/pandora_agents/pc/Win32/util/head.exe and b/pandora_agents/pc/Win32/util/head.exe differ diff --git a/pandora_agents/pc/Win32/util/ls.exe b/pandora_agents/pc/Win32/util/ls.exe index 388af5eb41..9ec7ea15a8 100644 Binary files a/pandora_agents/pc/Win32/util/ls.exe and b/pandora_agents/pc/Win32/util/ls.exe differ diff --git a/pandora_agents/pc/Win32/util/md5.exe b/pandora_agents/pc/Win32/util/md5.exe index 8bdc35ccc8..630421aa77 100644 Binary files a/pandora_agents/pc/Win32/util/md5.exe and b/pandora_agents/pc/Win32/util/md5.exe differ diff --git a/pandora_agents/pc/Win32/util/pandora_update.exe b/pandora_agents/pc/Win32/util/pandora_update.exe index ccfe98aa0b..50563b3777 100644 Binary files a/pandora_agents/pc/Win32/util/pandora_update.exe and b/pandora_agents/pc/Win32/util/pandora_update.exe differ diff --git a/pandora_agents/pc/Win32/util/puttygen.exe b/pandora_agents/pc/Win32/util/puttygen.exe index 8a43b5cd1c..bc43a7072a 100644 Binary files a/pandora_agents/pc/Win32/util/puttygen.exe and b/pandora_agents/pc/Win32/util/puttygen.exe differ diff --git a/pandora_agents/pc/Win32/util/snmpget.exe b/pandora_agents/pc/Win32/util/snmpget.exe index f80ff56093..032a118429 100644 Binary files a/pandora_agents/pc/Win32/util/snmpget.exe and b/pandora_agents/pc/Win32/util/snmpget.exe differ diff --git a/pandora_agents/pc/Win32/util/sort.exe b/pandora_agents/pc/Win32/util/sort.exe index 8b583cff70..45d54876bc 100644 Binary files a/pandora_agents/pc/Win32/util/sort.exe and b/pandora_agents/pc/Win32/util/sort.exe differ diff --git a/pandora_agents/pc/Win32/util/tail.exe b/pandora_agents/pc/Win32/util/tail.exe index 36c2abc22f..baf603c232 100644 Binary files a/pandora_agents/pc/Win32/util/tail.exe and b/pandora_agents/pc/Win32/util/tail.exe differ diff --git a/pandora_agents/pc/Win32/util/tentacle_client.exe b/pandora_agents/pc/Win32/util/tentacle_client.exe index 9566f8cde2..48e5147d70 100644 Binary files a/pandora_agents/pc/Win32/util/tentacle_client.exe and b/pandora_agents/pc/Win32/util/tentacle_client.exe differ diff --git a/pandora_agents/pc/Win32/util/tentacle_server.exe b/pandora_agents/pc/Win32/util/tentacle_server.exe index 95e1e5325e..423348a7b8 100644 Binary files a/pandora_agents/pc/Win32/util/tentacle_server.exe and b/pandora_agents/pc/Win32/util/tentacle_server.exe differ diff --git a/pandora_agents/pc/Win32/util/tr.exe b/pandora_agents/pc/Win32/util/tr.exe index 249cc46c09..026bef8e41 100644 Binary files a/pandora_agents/pc/Win32/util/tr.exe and b/pandora_agents/pc/Win32/util/tr.exe differ diff --git a/pandora_agents/pc/Win32/util/unzip.exe b/pandora_agents/pc/Win32/util/unzip.exe index b10387734a..4eff99bb94 100644 Binary files a/pandora_agents/pc/Win32/util/unzip.exe and b/pandora_agents/pc/Win32/util/unzip.exe differ diff --git a/pandora_agents/pc/Win32/util/wc.exe b/pandora_agents/pc/Win32/util/wc.exe index c0a2d1cd17..89d849732e 100644 Binary files a/pandora_agents/pc/Win32/util/wc.exe and b/pandora_agents/pc/Win32/util/wc.exe differ diff --git a/pandora_agents/pc/tentacle_server b/pandora_agents/pc/tentacle_server index d945a134e8..4458237003 100755 --- a/pandora_agents/pc/tentacle_server +++ b/pandora_agents/pc/tentacle_server @@ -5,7 +5,7 @@ # Tentacle have IANA assigned port tpc/41121 as official port. ########################################################################## # Copyright (c) 2007-2008 Ramon Novoa -# Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L +# Copyright (c) 2005-2022 Artica Soluciones Tecnologicas S.L # # tentacle_server.pl Tentacle Server. See https://pandorafms.com/docs/ for # protocol description. @@ -1740,6 +1740,19 @@ sub callback_stop { Win32::Daemon::StopService(); } + +################################################################################ +## SUB check_ssleay_version +## Print a message if the installed version of Net::SSLeay may leak memory. +################################################################################ +sub check_ssleay_version { + eval { + require Net::SSLeay; + return unless defined($Net::SSLeay::VERSION) && $Net::SSLeay::VERSION =~ m/^(\d+)\.(\d+)/ && $1 <= 1 && $2 < 88; + print_log ("Net::SSLeay version $Net::SSLeay::VERSION detected. Versions prior to 1.88 may leak memory. To upgrade it see: https://metacpan.org/pod/Net::SSLeay"); + }; +} + ################################################################################ # Main ################################################################################ @@ -1753,12 +1766,20 @@ if ($> == 0 && $^O ne 'MSWin32') { # Parse command line options parse_options (); +# Try to open the log file. +if (defined($log_file)) { + open(my $fh, ">>", $log_file) || die("Error opening the log file '$log_file': $!.\n"); + close($fh); +} + # Check command line arguments if ($#ARGV != -1) { print_help (); exit 1; } +check_ssleay_version() if $t_ssl == 1; + # Show IPv6 status if ($SOCKET_MODULE eq 'IO::Socket::INET') { print_log ("IO::Socket::INET6 is not found. IPv6 is disabled."); diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf index d0e6d59918..8b5f3a9239 100644 --- a/pandora_agents/shellscript/aix/pandora_agent.conf +++ b/pandora_agents/shellscript/aix/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.762, AIX version +# Version 7.0NG.767, AIX version # General Parameters # ================== diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf index 849edefe11..f60fb27d7f 100644 --- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf +++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.762 +# Version 7.0NG.767 # FreeBSD/IPSO version # Licenced under GPL licence, 2003-2007 Sancho Lerena diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf index e3ce77d2a8..cdd0850668 100644 --- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf +++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.762, HPUX Version +# Version 7.0NG.767, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index af53f47562..bc7dc2b2c0 100644 --- a/pandora_agents/shellscript/linux/pandora_agent.conf +++ b/pandora_agents/shellscript/linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762 +# Version 7.0NG.767 # Licensed under GPL license v2, # (c) 2003-2021 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf index 39ad8d5ad5..7bf2d86d38 100644 --- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf +++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762 +# Version 7.0NG.767 # Licensed under GPL license v2, # (c) 2003-2021 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf index 402ff05149..40ee8e92a3 100644 --- a/pandora_agents/shellscript/openWRT/pandora_agent.conf +++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762 +# Version 7.0NG.767 # Licensed under GPL license v2, # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf index c6dea91d32..37b30848ab 100644 --- a/pandora_agents/shellscript/solaris/pandora_agent.conf +++ b/pandora_agents/shellscript/solaris/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.762, Solaris version +# Version 7.0NG.767, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 85b4668cb5..f0295fd471 100644 --- a/pandora_agents/unix/AIX/pandora_agent.conf +++ b/pandora_agents/unix/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.762, AIX version +# Version 7.0NG.767, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 7aa0b1dc23..64a80cc179 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.762-220616 +Version: 7.0NG.767-221220 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 da2264d92c..f92a0385dc 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.762-220616" +pandora_version="7.0NG.767-221220" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null @@ -61,7 +61,7 @@ chmod 755 -R temp_package/DEBIAN #cp -aRf * temp_package/usr/share/pandora_agent/ #but don't copy recursive the temp_package into temp_package -for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v HP-UX | grep -v SunOS | grep -v temp_package` +for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v NetBSD | grep -v HP-UX | grep -v SunOS | grep -v Darwin | grep -v OpenWRT | grep -v pandorafms.agent_unix | grep -v temp_package` do #if [ \( $item != 'temp_package' \) -a \( $item != 'NT4' \) ] #then @@ -133,9 +133,9 @@ echo "END" echo "Make the package \"Pandorafms agent\"." if [ "$USE_DOCKER_APP" == "1" ]; then - eval $DPKG_DEB --build temp_package + eval $DPKG_DEB --root-owner-group --build temp_package else - dpkg-deb --build temp_package + dpkg-deb --root-owner-group --build temp_package fi mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb diff --git a/pandora_agents/unix/Darwin/dmg/build_darwin_dmg.sh b/pandora_agents/unix/Darwin/dmg/build_darwin_dmg.sh index 5cbb605e1b..93a271b109 100644 --- a/pandora_agents/unix/Darwin/dmg/build_darwin_dmg.sh +++ b/pandora_agents/unix/Darwin/dmg/build_darwin_dmg.sh @@ -31,7 +31,7 @@ fi if [ "$#" -ge 2 ]; then VERSION="$2" else - VERSION="7.0NG.762" + VERSION="7.0NG.767" fi # Path for the generated DMG file diff --git a/pandora_agents/unix/Darwin/dmg/extras/distribution.xml b/pandora_agents/unix/Darwin/dmg/extras/distribution.xml index 534111e992..29d73048dd 100644 --- a/pandora_agents/unix/Darwin/dmg/extras/distribution.xml +++ b/pandora_agents/unix/Darwin/dmg/extras/distribution.xml @@ -19,11 +19,11 @@ - pandorafms_src.pdk + pandorafms_src.pdk - pandorafms_uninstall.pdk + pandorafms_uninstall.pdk @@ -925,7 +938,9 @@ echo sprintf('
', $menuTypeClass); layout: '%M%nn%M:%S%nn%S', labels: ['', '', '', '', '', '', ''], onExpiry: function () { - dt_events.draw(false); + $("#table_events") + .DataTable() + .draw(false); } }); } diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 6d7a9864ce..bb9fa19185 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -91,7 +91,7 @@ $login_body_class = ''; // Overrides the default background with the defined by the user. if (!empty($config['login_background'])) { $background_url = 'images/backgrounds/'.$config['login_background']; - $login_body_style = "style=\"background:linear-gradient(74deg, rgba(2, 2, 2, 0.333) 36%, transparent 36%), url('".$background_url."');\""; + $login_body_style = "style=\"background-size: 100% 100% !important;background:linear-gradient(74deg, rgba(2, 2, 2, 0.333) 36%, transparent 36%), url('".$background_url."');\""; } // Support for Internet Explorer and Microsoft Edge browsers diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index d836d9f22c..972e6f37ca 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -42,17 +42,10 @@ if (tags_has_user_acl_tags()) { ui_print_tags_warning(); } -$user_strict = (bool) db_get_value( - 'strict_acl', - 'tusuario', - 'id_user', - $config['id_user'] -); $all_data = tactical_status_modules_agents( $config['id_user'], - $user_strict, - 'AR', - $user_strict + false, + 'AR' ); $data = []; @@ -144,7 +137,16 @@ $table->data[] = $tdata; // Modules by status. $tdata = []; -$tdata[0] = reporting_get_stats_modules_status($data, 180, 100); + +$data_agents = [ + __('Critical') => $data['monitor_critical'], + __('Warning') => $data['monitor_warning'], + __('Normal') => $data['monitor_ok'], + __('Unknown') => $data['monitor_unknown'], + __('Not init') => $data['monitor_not_init'], +]; + +$tdata[0] = reporting_get_stats_modules_status($data, 180, 100, false, $data_agents); $table->rowclass[] = ''; $table->data[] = $tdata; @@ -288,7 +290,7 @@ foreach ($sessions as $session) { array_push($table->data, $data); } -$activity .= html_print_table($table, true); +$activity = html_print_table($table, true); unset($table); ui_toggle( diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 590dbe328a..3ce49b646a 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -58,6 +58,10 @@ if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_men // Start of full lateral menu. echo sprintf('