Merge branch 'ent-7736-script-de-instalacion-en-la-nube-para-centos8' into 'develop'
adding rocky linux support to install script See merge request artica/pandorafms!4254
This commit is contained in:
commit
85f5ec5fdd
|
@ -9,7 +9,7 @@ DBNAME=pandora
|
||||||
DBUSER=pandora
|
DBUSER=pandora
|
||||||
DBPASS=pandora
|
DBPASS=pandora
|
||||||
DBPORT=3306
|
DBPORT=3306
|
||||||
S_VERSION='2021072801'
|
S_VERSION='2021070101'
|
||||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||||
|
|
||||||
# Ansi color code variables
|
# Ansi color code variables
|
||||||
|
@ -53,7 +53,7 @@ check_cmd_status () {
|
||||||
|
|
||||||
check_pre_pandora () {
|
check_pre_pandora () {
|
||||||
export MYSQL_PWD=$DBPASS
|
export MYSQL_PWD=$DBPASS
|
||||||
|
|
||||||
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 "$CONSOLE_PATH" ] && local fail=true
|
||||||
|
@ -87,16 +87,15 @@ 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 -i centos /etc/redhat-release)" ]; then
|
if [ ! "$(grep -Ei 'centos|rocky' /etc/redhat-release)" ]; then
|
||||||
printf "${red}Error this is not a Centos Base system, this installer is compatible with Centos systems only${reset}\n"
|
printf "\n ${red}Error this is not a Centos/Rocky Base system, this installer is compatible with Centos/Rocky systems only${reset}\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
execute_cmd "grep -i centos /etc/redhat-release" "Checking Centos" 'Error This is not a Centos Base system'
|
|
||||||
|
|
||||||
echo -en "${cyan}Check Centos Version...${reset}"
|
echo -en "${cyan}Check Centos Version...${reset}"
|
||||||
[ $(sed -nr 's/VERSION_ID+=\s*"([0-9])"$/\1/p' /etc/os-release) -eq '8' ]
|
[ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ]
|
||||||
check_cmd_status 'Error OS version, Centos 8 is expected'
|
check_cmd_status 'Error OS version, Centos/Rocky 8+ is expected'
|
||||||
|
|
||||||
# initialice logfile
|
# initialice logfile
|
||||||
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
|
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
|
||||||
|
@ -256,7 +255,7 @@ server_dependencies=" \
|
||||||
perl(IO::Socket::INET6) \
|
perl(IO::Socket::INET6) \
|
||||||
perl(XML::Twig) \
|
perl(XML::Twig) \
|
||||||
expect \
|
expect \
|
||||||
openssh-clients \
|
openssh-clients \
|
||||||
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"
|
||||||
|
@ -511,46 +510,46 @@ chown pandora:apache /var/log/pandora
|
||||||
chmod g+s /var/log/pandora
|
chmod g+s /var/log/pandora
|
||||||
|
|
||||||
cat > /etc/logrotate.d/pandora_server <<EO_LR
|
cat > /etc/logrotate.d/pandora_server <<EO_LR
|
||||||
/var/log/pandora/pandora_server.log
|
/var/log/pandora/pandora_server.log
|
||||||
/var/log/pandora/web_socket.log
|
/var/log/pandora/web_socket.log
|
||||||
/var/log/pandora/pandora_server.error {
|
/var/log/pandora/pandora_server.error {
|
||||||
su root apache
|
su root apache
|
||||||
weekly
|
weekly
|
||||||
missingok
|
missingok
|
||||||
size 300000
|
size 300000
|
||||||
rotate 3
|
rotate 3
|
||||||
maxage 90
|
maxage 90
|
||||||
compress
|
compress
|
||||||
notifempty
|
notifempty
|
||||||
copytruncate
|
copytruncate
|
||||||
create 660 pandora apache
|
create 660 pandora apache
|
||||||
}
|
}
|
||||||
|
|
||||||
/var/log/pandora/pandora_snmptrap.log {
|
/var/log/pandora/pandora_snmptrap.log {
|
||||||
su root apache
|
su root apache
|
||||||
weekly
|
weekly
|
||||||
missingok
|
missingok
|
||||||
size 500000
|
size 500000
|
||||||
rotate 1
|
rotate 1
|
||||||
maxage 30
|
maxage 30
|
||||||
notifempty
|
notifempty
|
||||||
copytruncate
|
copytruncate
|
||||||
create 660 pandora apache
|
create 660 pandora apache
|
||||||
}
|
}
|
||||||
|
|
||||||
EO_LR
|
EO_LR
|
||||||
|
|
||||||
cat > /etc/logrotate.d/pandora_agent <<EO_LRA
|
cat > /etc/logrotate.d/pandora_agent <<EO_LRA
|
||||||
/var/log/pandora/pandora_agent.log {
|
/var/log/pandora/pandora_agent.log {
|
||||||
su root apache
|
su root apache
|
||||||
weekly
|
weekly
|
||||||
missingok
|
missingok
|
||||||
size 300000
|
size 300000
|
||||||
rotate 3
|
rotate 3
|
||||||
maxage 90
|
maxage 90
|
||||||
compress
|
compress
|
||||||
notifempty
|
notifempty
|
||||||
copytruncate
|
copytruncate
|
||||||
}
|
}
|
||||||
|
|
||||||
EO_LRA
|
EO_LRA
|
||||||
|
|
Loading…
Reference in New Issue