Merge branch 'ent-10435-cambios-intaladores-online' into 'develop'

Ent 10435 cambios intaladores online

See merge request artica/pandorafms!5554
This commit is contained in:
Rafael Ameijeiras 2023-02-22 10:12:00 +00:00
commit 3c71213c0d
5 changed files with 59 additions and 18 deletions

View File

@ -9,7 +9,7 @@
# RedHat 8.5
#Constants
S_VERSION='202302081'
S_VERSION='202302201'
LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
@ -275,6 +275,8 @@ EO_CONFIG_F
if [ "$MYVER" -eq '80' ] ; then
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf
fi
execute_cmd "systemctl restart mysqld" "Configuring database engine"

View File

@ -4,6 +4,7 @@
##############################################################################################################
## Tested versions ##
# Ubuntu 22.04.1
# Ubuntu 22.04.2
#avoid promps
export DEBIAN_FRONTEND=noninteractive
@ -16,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
WORKDIR=/opt/pandora/deploy
S_VERSION='202302081'
S_VERSION='202302201'
LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
rm -f $LOGFILE &> /dev/null # remove last log before start
@ -181,7 +182,7 @@ cat > /etc/mysql/my.cnf << EOF_DB
[mysqld]
datadir=/var/lib/mysql
user=mysql
character-set-server=utf8
character-set-server=utf8mb4
skip-character-set-client-handshake
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
@ -196,7 +197,7 @@ 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
innodb_io_capacity = 300
thread_cache_size = 8
thread_stack = 256K
max_connections = 100

View File

@ -431,7 +431,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDOR
execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages"
# Copy gotty utility
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/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'

View File

@ -5,7 +5,7 @@
## Tested versions ##
# Centos 8.4, 8.5
# Rocky 8.4, 8.5, 8.6, 8.7
# Almalinuz 8.4, 8.5
# Almalinux 8.4, 8.5
# RedHat 8.5
#Constants
@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='202301251'
S_VERSION='202302201'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
@ -107,6 +107,17 @@ check_root_permissions () {
fi
}
installing_docker () {
#Installing docker for debug
echo "Start installig docker" &>> "$LOGFILE"
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo &>> "$LOGFILE"
dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &>> "$LOGFILE"
systemctl disable --now docker &>> "$LOGFILE"
systemctl disable docker.socket --now &>> "$LOGFILE"
echo "End installig docker" &>> "$LOGFILE"
}
## Main
echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION"
@ -207,6 +218,7 @@ else
execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools"
fi
execute_cmd "installing_docker" "Installing Docker for debug"
#Installing wget
execute_cmd "dnf install -y wget" "Installing wget"
@ -454,7 +466,7 @@ 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
innodb_io_capacity = 300
thread_cache_size = 8
thread_stack = 256K
max_connections = 100
@ -483,6 +495,7 @@ EO_CONFIG_F
if [ "$MYVER" -eq '80' ] ; then
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf
fi
execute_cmd "systemctl restart mysqld" "Configuring database engine"
@ -517,7 +530,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDOR
execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages"
# Copy gotty utility
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/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'
@ -743,7 +756,7 @@ execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
cat > /etc/issue.net << EOF_banner
Welcome to Pandora FMS appliance on CentOS
Welcome to Pandora FMS appliance on RHEL/Rocky Linux 8
------------------------------------------
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"}')

View File

@ -4,6 +4,7 @@
##############################################################################################################
## Tested versions ##
# Ubuntu 22.04.1
# Ubuntu 22.04.2
#avoid promps
export DEBIAN_FRONTEND=noninteractive
@ -16,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
WORKDIR=/opt/pandora/deploy
S_VERSION='202301251'
S_VERSION='202302201'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
rm -f $LOGFILE &> /dev/null # remove last log before start
@ -106,6 +107,21 @@ check_root_permissions () {
fi
}
installing_docker () {
#Installing docker for debug
echo "Start installig docker" &>> "$LOGFILE"
mkdir -m 0755 -p /etc/apt/keyrings &>> "$LOGFILE"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --yes --dearmor -o /etc/apt/keyrings/docker.gpg &>> "$LOGFILE"
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list &>> "$LOGFILE"
apt update -y &>> "$LOGFILE"
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &>> "$LOGFILE"
systemctl disable docker --now &>> "$LOGFILE"
systemctl disable docker.socket --now &>> "$LOGFILE"
echo "End installig docker" &>> "$LOGFILE"
}
## Main
echo "Starting PandoraFMS Community deployment Ubuntu 22.04 ver. $S_VERSION"
@ -173,7 +189,7 @@ 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"
execute_cmd "apt install -y net-tools vim curl wget software-properties-common apt-transport-https ca-certificates gnupg lsb-release" "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"
@ -221,7 +237,8 @@ systemctl restart php$PHPVER-fpm &>> "$LOGFILE"
php$PHPVER-xml \
php$PHPVER-yaml \
libnet-telnet-perl \
whois"
whois \
cron"
execute_cmd "apt install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
# Server dependencies
@ -254,10 +271,13 @@ server_dependencies=" \
libnet-telnet-perl \
libjson-perl \
libencode-perl \
cron \
libgeo-ip-perl \
openjdk-8-jdk "
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
execute_cmd "installing_docker" "Installing Docker for debug"
# 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"
@ -393,7 +413,7 @@ cat > /etc/mysql/my.cnf << EOF_DB
[mysqld]
datadir=/var/lib/mysql
user=mysql
character-set-server=utf8
character-set-server=utf8mb4
skip-character-set-client-handshake
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
@ -408,7 +428,7 @@ 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
innodb_io_capacity = 300
thread_cache_size = 8
thread_stack = 256K
max_connections = 100
@ -477,7 +497,7 @@ 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'
execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/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'
@ -731,10 +751,15 @@ systemctl enable pandora_server &>> "$LOGFILE"
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
systemctl enable tentacle_serverd &>> "$LOGFILE"
# Enabling condole cron
# Enabling console cron
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies 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 --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
# Enabling pandoradb cron
execute_cmd "echo 'enabling pandoradb cron' >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS pandoradb cron"
echo "@hourly root bash -c /etc/cron.hourly/pandora_db" >> /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"
@ -748,7 +773,7 @@ sed --follow-symlinks -i -e "s/^openssl_conf = openssl_init/#openssl_conf = open
cat > /etc/issue.net << EOF_banner
Welcome to Pandora FMS appliance on CentOS
Welcome to Pandora FMS appliance on Ubuntu
------------------------------------------
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"}')