From 6c63fc052010dcb3050ed8d79803145217ae9ce2 Mon Sep 17 00:00:00 2001 From: rafael Date: Tue, 18 Apr 2023 09:08:58 +0200 Subject: [PATCH] ent-10303 add fping check and dinamic configuration on pandora_server.conf --- extras/deploy-scripts/pandora_deploy_community.sh | 7 +++++++ extras/deploy-scripts/pandora_deploy_community_el8.sh | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index d7973172aa..58e3187806 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -571,6 +571,13 @@ 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 +#check fping +fping_bin=$(which fping) +execute_cmd "[ $fping_bin ]" "Check fping location: $fping_bin" +if [ "$fping_bin" != "" ]; then + sed -i -e "s|^fping.*|fping $fping_bin|g" $PANDORA_SERVER_CONF +fi + # Enable agent remote config sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index d217de2303..57301f62e0 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -334,8 +334,6 @@ console_dependencies=" \ http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm" execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies" - - # Server dependencies server_dependencies=" \ perl \ @@ -409,6 +407,7 @@ setenforce 0 &>> "$LOGFILE" sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config &>> "$LOGFILE" systemctl disable firewalld --now &>> "$LOGFILE" + # Adding standar cnf for initial setup. cat > /etc/my.cnf << EO_CONFIG_TMP [mysqld] @@ -633,6 +632,13 @@ 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 +#check fping +fping_bin=$(which fping) +execute_cmd "[ $fping_bin ]" "Check fping location: $fping_bin" +if [ "$fping_bin" != "" ]; then + sed -i -e "s|^fping.*|fping $fping_bin|g" $PANDORA_SERVER_CONF +fi + # Enable agent remote config sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF