Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: add support for rhel based OS #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/resources/user-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ install_zabbix_on_ubuntu () {
#### CentOS ####
################

install_ems_on_centos () {
install_ems_on_rhel_based () {
result=$(yum list installed | grep "ems" | grep -i "open baton\|openbaton" | wc -l)
if [ ${result} -eq 0 ]; then
echo "Downloading EMS from ${CENTOS_EMS_REPOSITORY_HOSTNAME_OR_IP}"
Expand All @@ -87,7 +87,7 @@ install_ems_on_centos () {
fi
}

install_zabbix_on_centos () {
install_zabbix_on_rhel_based () {
result=$( yum list installed | grep zabbix-agent | wc -l )
if [ ${result} -eq 0 ]; then
echo "Adding repository .."
Expand Down Expand Up @@ -152,14 +152,14 @@ case ${os} in
install_zabbix_on_ubuntu
fi
;;
centos)
install_ems_on_centos
centos|rhel)
install_ems_on_rhel_based
if [ -z "${MONITORING_IP}" ]; then
echo "No MONITORING_IP is defined, I will not download zabbix-agent"
else
yum install -y redhat-lsb-core
OS_DISTRIBUTION_RELEASE_MAJOR=$( lsb_release -a | grep "Release:" | awk -F'\t' '{ print $2 }' | awk -F'.' '{ print $1 }' )
install_zabbix_on_centos
install_zabbix_on_rhel_based
fi
;;
*)
Expand Down