Skip to content

Commit

Permalink
fix: fixing issues found in 2.19.0 testing (#174)
Browse files Browse the repository at this point in the history
* fix: fixing issues found in 2.19.0 testing

* fix: fixing review comments
  • Loading branch information
bejjrajesh authored Feb 7, 2025
1 parent 0cb7e6f commit f79270b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions static/scripts/install-nim-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ TARGET_DISTRIBUTION=""
PACKAGE_INSTALLER=""
NMS_NGINX_MGMT_BLOCK="mgmt { \n usage_report endpoint=127.0.0.1 interval=30m; \n ssl_verify off; \n}";
NIM_FQDN=""

NIM_CERTS_DIR="/etc/nms/certs"
# Added to account for the renaming of the adc dimension from application to app.
if [ -f "/usr/share/nms/catalogs/dimensions/application.yml" ]; then
rm /usr/share/nms/catalogs/dimensions/application.yml
Expand Down Expand Up @@ -335,6 +335,7 @@ installBundleForDebianDistro() {
if [ "${USE_SM_MODULE}" == "true" ]; then
nim_major_version=$(nms-core --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | awk -F. '{print $1}')
nim_minor_version=$(nms-core --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | awk -F. '{print $2}')
echo "Installed NIM major Version: ${nim_major_version}, minor Version:${nim_minor_version}"
if [[ $nim_major_version -ge 2 && $nim_minor_version -ge 19 ]]; then
echo "Note: NGINX Instance Manager version 2.19.0 or later comes with security monitoring installed. skipping installing security monitoring"
else
Expand Down Expand Up @@ -477,7 +478,8 @@ installBundleForRPMDistro(){

if [ "${USE_SM_MODULE}" == "true" ]; then
nim_major_version=$(nms-core --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | awk -F. '{print $1}')
nim_minor_version=$(nms-core --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | awk -F. '{print $1}')
nim_minor_version=$(nms-core --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | awk -F. '{print $2}')
echo "Installed NIM major Version: ${nim_major_version}, minor Version:${nim_minor_version}"
if [[ $nim_major_version -ge 2 && $nim_minor_version -ge 19 ]]; then
echo "Note: NGINX Instance Manager version 2.19.0 or later comes with security monitoring installed. skipping installing security monitoring"
else
Expand Down Expand Up @@ -530,7 +532,11 @@ install_nim_online(){
exit 1
fi
if [[ -n ${NIM_FQDN} ]] ; then
bash -c "source /etc/nms/scripts/certs.sh || /etc/nms/scripts/certs.sh 0 ${NIM_FQDN}"
if [ -d "${NIM_CERTS_DIR}" ]; then
echo "removing existing NIM certs"
rm -rf "/etc/nms/certs"
fi
bash -c "source /etc/nms/scripts/certs.sh 0 \"${NIM_FQDN}\" || /etc/nms/scripts/certs.sh 0 ${NIM_FQDN}"
fi
curl -s -o /dev/null --cert ${NGINX_CERT_PATH} --key ${NGINX_CERT_KEY_PATH} "https://pkgs.nginx.com/nms/?using_install_script=true&app=nim&mode=online"
}
Expand Down Expand Up @@ -1029,7 +1035,11 @@ else
exit 1
fi
if [[ -n ${NIM_FQDN} ]] ; then
bash -c "source /etc/nms/scripts/certs.sh || /etc/nms/scripts/certs.sh 0 ${NIM_FQDN}"
if [ -d "${NIM_CERTS_DIR}" ]; then
echo "removing existing nim certs"
rm -rf "/etc/nms/certs"
fi
bash -c "source /etc/nms/scripts/certs.sh 0 \"${NIM_FQDN}\" || /etc/nms/scripts/certs.sh 0 ${NIM_FQDN}"
fi
curl -s -o /dev/null --cert ${NGINX_CERT_PATH} --key ${NGINX_CERT_KEY_PATH} "https://pkgs.nginx.com/nms/?using_install_script=true&app=nim&mode=offline"
fi
Expand Down

0 comments on commit f79270b

Please sign in to comment.