From f6c44e14de669b3beaccc396b5d695412e7a1402 Mon Sep 17 00:00:00 2001 From: rajesh bejjanki Date: Wed, 29 Jan 2025 23:52:42 +0530 Subject: [PATCH 1/9] fix: fixing issues reported in 2.18.0 release --- static/scripts/install-nim-bundle.sh | 82 ++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 23 deletions(-) diff --git a/static/scripts/install-nim-bundle.sh b/static/scripts/install-nim-bundle.sh index cd171bdc1..fa7bd601b 100644 --- a/static/scripts/install-nim-bundle.sh +++ b/static/scripts/install-nim-bundle.sh @@ -34,14 +34,14 @@ NGINX_PLUS_VERSION="latest" NIM_SM_VERSION="latest" CLICKHOUSE_VERSION="latest" CLICKHOUSE_LATEST_VERSION="24.9.2.42" -NGINX_LATEST_VERSION=1.25.5-1 -NIM_LATEST_VERSION=2.18.0 +NGINX_LATEST_VERSION=1.27.3-1 +NIM_LATEST_VERSION=2.19.0 CURRENT_TIME=$(date +%s) TEMP_DIR="/tmp/${CURRENT_TIME}" 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="" # Added to account for the renaming of the adc dimension from application to app. if [ -f "/usr/share/nms/catalogs/dimensions/application.yml" ]; then @@ -117,7 +117,9 @@ fi createNginxMgmtFile(){ # Check if the mgmt block exists in the file - if grep -Eq '^[[:space:]]*#mgmt' "/etc/nginx/nginx.conf"; then + if grep -Eq '^[[:space:]]*mgmt' "/etc/nginx/nginx.conf"; then + printf "nginx management found, skipping adding nginx mgmt block" + elif grep -Eq '^[[:space:]]*#mgmt' "/etc/nginx/nginx.conf"; then printf "nginx management block disabled, enabling mgmt block" sed -i '/#mgmt {/,/#}/d' /etc/nginx/nginx.conf # shellcheck disable=SC2059 @@ -335,24 +337,30 @@ installBundleForDebianDistro() { debian_install_clickhouse debian_install_nim if [ "${USE_SM_MODULE}" == "true" ]; then - printf "Installing security module...\n" - if [ "${NIM_SM_VERSION}" == "latest" ]; then - apt-get install -y nms-sm - check_last_command_status "apt-get install -y nms-sm" $? + 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}') + if [[ $nim_major_version -ge 2 && $nim_minor_version -ge 19 ]]; then + echo "Warning: NIM version >=2.19.0 comes with security module installed already. skipping installing security module" else - sm_pkg_version=$(findVersionForPackage "nms-sm" "${NIM_SM_VERSION}") - cmd_status=$? - if [ $cmd_status -ne 0 ]; then - echo "Package nms-sm with version ${NIM_SM_VERSION} not found" - exit $cmd_status + printf "Installing security module...\n" + if [ "${NIM_SM_VERSION}" == "latest" ]; then + apt-get install -y nms-sm + check_last_command_status "apt-get install -y nms-sm" $? + else + sm_pkg_version=$(findVersionForPackage "nms-sm" "${NIM_SM_VERSION}") + cmd_status=$? + if [ $cmd_status -ne 0 ]; then + echo "Package nms-sm with version ${NIM_SM_VERSION} not found" + exit $cmd_status + fi + apt-get install -y nms-sm="${sm_pkg_version}" + check_last_command_status "apt-get install -y nms-sm=${NIM_SM_VERSION}" $? fi - apt-get install -y nms-sm="${sm_pkg_version}" - check_last_command_status "apt-get install -y nms-sm=${NIM_SM_VERSION}" $? + systemctl restart nms + sleep 5 + systemctl restart nginx + systemctl start nms-sm fi - systemctl restart nms - sleep 5 - systemctl restart nginx - systemctl start nms-sm else systemctl restart nms sleep 5 @@ -495,10 +503,15 @@ install_nim_online(){ PACKAGE_INSTALLER="rpm" installBundleForRPMDistro generate + else printf "Unsupported distribution" exit 1 fi + if [[ -n ${NIM_FQDN} ]] ; then + /etc/nms/scripts/certs.sh ${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" } printUsageInfo(){ @@ -519,6 +532,24 @@ printUsageInfo(){ exit 0 } +printSupportedOS(){ + echo "This script can be run on the following operating systems + [-d distribution (ubuntu20.04,ubuntu22.04,ubuntu24.04,debian11,debian12,centos8,rhel8,rhel9,oracle7,oracle8,amzn2)] [-h print help]" + printf "\n ubuntu20.04(focal)" + printf "\n ubuntu22.04()" + printf "\n ubuntu24.04()" + printf "\n debian11()" + printf "\n debian12()" + printf "\n centos8" + printf "\n " + printf "\n " + printf "\n " + printf "\n " + printf "\n " + printf "\n " + exit 0 +} + check_NIM_status(){ sleep 5 GREEN='\033[0;32m' @@ -641,7 +672,7 @@ This action deletes all files in the following directories: /etc/nms , /etc/ngin fi } -OPTS_STRING="k:c:m:d:i:s:p:n:hv:t:j:r" +OPTS_STRING="k:c:m:d:i:s:p:n:hv:t:j:rf:" while getopts ${OPTS_STRING} opt; do case ${opt} in c) @@ -692,13 +723,17 @@ while getopts ${OPTS_STRING} opt; do r) UNINSTALL_NIM="true" ;; + f) + NIM_FQDN=${OPTARG} + ;; h) - printUsageInfo printUsageInfo exit 0 - printUsageInfo - exit 0 ;; + l) + printSupportedOS + exit 0 + ;; :) echo "Option -${OPTARG} requires an argument." exit 1 @@ -968,5 +1003,6 @@ else echo "Provided install path ${INSTALL_PATH} doesn't exists" exit 1 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" fi fi From c180ed641b0aa2b806bd37552922b0305108b334 Mon Sep 17 00:00:00 2001 From: rajesh bejjanki Date: Thu, 30 Jan 2025 00:00:45 +0530 Subject: [PATCH 2/9] fix: updating supported os list --- static/scripts/install-nim-bundle.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/static/scripts/install-nim-bundle.sh b/static/scripts/install-nim-bundle.sh index fa7bd601b..fecb9e81c 100644 --- a/static/scripts/install-nim-bundle.sh +++ b/static/scripts/install-nim-bundle.sh @@ -536,16 +536,16 @@ printSupportedOS(){ echo "This script can be run on the following operating systems [-d distribution (ubuntu20.04,ubuntu22.04,ubuntu24.04,debian11,debian12,centos8,rhel8,rhel9,oracle7,oracle8,amzn2)] [-h print help]" printf "\n ubuntu20.04(focal)" - printf "\n ubuntu22.04()" - printf "\n ubuntu24.04()" - printf "\n debian11()" - printf "\n debian12()" - printf "\n centos8" - printf "\n " - printf "\n " - printf "\n " - printf "\n " - printf "\n " + printf "\n ubuntu22.04(jammy)" + printf "\n ubuntu24.04(noble)" + printf "\n debian11" + printf "\n debian12" + printf "\n centos8(Cent OS 8)" + printf "\n rhel8(Redhat Enterprise Linux Version 8)" + printf "\n rhel9( Redhat Enterprise Linux Version 9)" + printf "\n oracle7(Oracle Linux Version 7)" + printf "\n oracle8(Oracle Linux Version 8)" + printf "\n amzn2(Amazon Linux 2)" printf "\n " exit 0 } From a387b34cbeeb2255ca6573d14ddb4f738532c6ec Mon Sep 17 00:00:00 2001 From: rajesh bejjanki Date: Thu, 30 Jan 2025 14:16:35 +0530 Subject: [PATCH 3/9] fix: fixing review comments --- static/scripts/install-nim-bundle.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/static/scripts/install-nim-bundle.sh b/static/scripts/install-nim-bundle.sh index fecb9e81c..b691b5c19 100644 --- a/static/scripts/install-nim-bundle.sh +++ b/static/scripts/install-nim-bundle.sh @@ -118,14 +118,14 @@ fi createNginxMgmtFile(){ # Check if the mgmt block exists in the file if grep -Eq '^[[:space:]]*mgmt' "/etc/nginx/nginx.conf"; then - printf "nginx management found, skipping adding nginx mgmt block" + printf "Nginx 'mgmt' block found, skipping addition of nginx 'mgmt' block" elif grep -Eq '^[[:space:]]*#mgmt' "/etc/nginx/nginx.conf"; then - printf "nginx management block disabled, enabling mgmt block" + printf "Nginx 'mgmt' block disabled, enabling 'mgmt' block" sed -i '/#mgmt {/,/#}/d' /etc/nginx/nginx.conf # shellcheck disable=SC2059 printf "${NMS_NGINX_MGMT_BLOCK}" | tee -a /etc/nginx/nginx.conf else - printf "nginx management block not found, adding mgmt block" + printf "Nginx 'mgmt' block not found, adding 'mgmt' block" # shellcheck disable=SC2059 printf "${NMS_NGINX_MGMT_BLOCK}" | tee -a /etc/nginx/nginx.conf fi @@ -340,7 +340,7 @@ installBundleForDebianDistro() { 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}') if [[ $nim_major_version -ge 2 && $nim_minor_version -ge 19 ]]; then - echo "Warning: NIM version >=2.19.0 comes with security module installed already. skipping installing security module" + echo "Note: NGINX Instance Manager version 2.19.0 or later comes with security monitoring installed. skipping installing security monitoring" else printf "Installing security module...\n" if [ "${NIM_SM_VERSION}" == "latest" ]; then @@ -538,15 +538,14 @@ printSupportedOS(){ printf "\n ubuntu20.04(focal)" printf "\n ubuntu22.04(jammy)" printf "\n ubuntu24.04(noble)" - printf "\n debian11" - printf "\n debian12" - printf "\n centos8(Cent OS 8)" + printf "\n debian11(bullseye)" + printf "\n debian12(bookworm)" + printf "\n centos8(CentOS 8)" printf "\n rhel8(Redhat Enterprise Linux Version 8)" printf "\n rhel9( Redhat Enterprise Linux Version 9)" printf "\n oracle7(Oracle Linux Version 7)" printf "\n oracle8(Oracle Linux Version 8)" printf "\n amzn2(Amazon Linux 2)" - printf "\n " exit 0 } From 6aa8dc72bfe2b4b5add08a53d95eb9a146cd44ad Mon Sep 17 00:00:00 2001 From: rajesh bejjanki Date: Fri, 31 Jan 2025 21:22:44 +0530 Subject: [PATCH 4/9] fix: updating script to use only curl --- static/scripts/install-nim-bundle.sh | 41 ++++++++++++---------------- 1 file changed, 17 insertions(+), 24 deletions(-) mode change 100644 => 100755 static/scripts/install-nim-bundle.sh diff --git a/static/scripts/install-nim-bundle.sh b/static/scripts/install-nim-bundle.sh old mode 100644 new mode 100755 index b691b5c19..6797cc9e6 --- a/static/scripts/install-nim-bundle.sh +++ b/static/scripts/install-nim-bundle.sh @@ -15,11 +15,6 @@ if ! cmd=$(command -v "tar") || [ ! -x "$cmd" ]; then exit 1 fi -if ! cmd=$(command -v "wget") || [ ! -x "$cmd" ]; then - echo "wget command not found. Install wget to run this script." - exit 1 -fi - NGINX_CERT_PATH="/etc/ssl/nginx/nginx-repo.crt" NGINX_CERT_KEY_PATH="/etc/ssl/nginx/nginx-repo.key" LICENSE_JWT_PATH="" @@ -401,7 +396,7 @@ installBundleForRPMDistro(){ fi printf "[nginx-plus]\nname=nginx-plus repo\nbaseurl=https://pkgs.nginx.com/plus/$os_type/\$releasever/\$basearch/\nsslclientcert=/etc/ssl/nginx/nginx-repo.crt\nsslclientkey=/etc/ssl/nginx/nginx-repo.key\ngpgcheck=0\nenabled=1" >> /etc/yum.repos.d/nginx-plus.repo - yum install -y yum-utils wget epel-release ca-certificates + yum install -y yum-utils curl epel-release ca-certificates yum-config-manager --enable nginx-stable yum-config-manager --enable nginx-plus @@ -457,7 +452,7 @@ installBundleForRPMDistro(){ systemctl start clickhouse-server check_last_command_status "systemctl start clickhouse-server" $? - wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/nms.repo + curl -o /etc/yum.repos.d/nms.repo https://cs.nginx.com/static/files/nms.repo check_last_command_status "get -P /etc/yum.repos.d https://cs.nginx.com/static/files/nms.repo" $? if cat /etc/*-release | grep -iq 'Amazon Linux'; then @@ -515,9 +510,8 @@ install_nim_online(){ } printUsageInfo(){ - echo "Usage: $0 [-c /path/to/nginx-repo.crt] [-k /path/to/nginx-repo.key] [-p nginx_plus_version] [-s security_module_version] -i [installable_tar_file_path] [-n nginx_oss_version] [-m mode(online/offline)] - [-d distribution (ubuntu20.04,ubuntu22.04,ubuntu24.04,debian11,debian12,centos8,rhel8,rhel9,oracle7,oracle8,amzn2)] [-h print help]" - printf "\n -m Online/Offline. Controls whether to install from the internet or from a package created using this script. \n" + echo "Usage: $0 [-c /path/to/nginx-repo.crt] [-k /path/to/nginx-repo.key] [-p nginx_plus_version] [-s security_module_version] -i [installable_tar_file_path] [-n nginx_oss_version] [-m mode(online/offline)] [-d distribution (ubuntu20.04,ubuntu22.04,ubuntu24.04,debian11,debian12,centos8,rhel8,rhel9,oracle7,oracle8,amzn2)] [-h print help]" + printf "\n\n -m online/offline. Controls whether to install from the internet or from a package created using this script. \n" printf "\n -c /path/to/your/ file.\n" printf "\n -k /path/to/your/ file.\n" printf "\n -p . Include NGINX Plus version to install as an API gateway. Valid values are 'latest' and specific versions like R32. For a list, see https://docs.nginx.com/nginx/releases/. Supersedes -n.\n" @@ -533,19 +527,18 @@ printUsageInfo(){ } printSupportedOS(){ - echo "This script can be run on the following operating systems - [-d distribution (ubuntu20.04,ubuntu22.04,ubuntu24.04,debian11,debian12,centos8,rhel8,rhel9,oracle7,oracle8,amzn2)] [-h print help]" - printf "\n ubuntu20.04(focal)" - printf "\n ubuntu22.04(jammy)" - printf "\n ubuntu24.04(noble)" - printf "\n debian11(bullseye)" - printf "\n debian12(bookworm)" - printf "\n centos8(CentOS 8)" - printf "\n rhel8(Redhat Enterprise Linux Version 8)" - printf "\n rhel9( Redhat Enterprise Linux Version 9)" - printf "\n oracle7(Oracle Linux Version 7)" - printf "\n oracle8(Oracle Linux Version 8)" - printf "\n amzn2(Amazon Linux 2)" + printf "This script can be run on the following operating systems" + printf "\n 1. ubuntu20.04(focal)" + printf "\n 2. ubuntu22.04(jammy)" + printf "\n 3. ubuntu24.04(noble)" + printf "\n 4. debian11(bullseye)" + printf "\n 5. debian12(bookworm)" + printf "\n 6. centos8(CentOS 8)" + printf "\n 7. rhel8(Redhat Enterprise Linux Version 8)" + printf "\n 8. rhel9( Redhat Enterprise Linux Version 9)" + printf "\n 9. oracle7(Oracle Linux Version 7)" + printf "\n 10. oracle8(Oracle Linux Version 8)" + printf "\n 11. amzn2(Amazon Linux 2)\n" exit 0 } @@ -671,7 +664,7 @@ This action deletes all files in the following directories: /etc/nms , /etc/ngin fi } -OPTS_STRING="k:c:m:d:i:s:p:n:hv:t:j:rf:" +OPTS_STRING="k:c:m:d:i:s:p:n:hv:t:j:rf:l" while getopts ${OPTS_STRING} opt; do case ${opt} in c) From 60a408bf0fe7bfcdeec1087ab6090cf44704e6a9 Mon Sep 17 00:00:00 2001 From: rajesh bejjanki Date: Sat, 1 Feb 2025 20:23:48 +0530 Subject: [PATCH 5/9] fix: adding validation for mode and adding missing sm installation for rpm based systems --- static/scripts/install-nim-bundle.sh | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/static/scripts/install-nim-bundle.sh b/static/scripts/install-nim-bundle.sh index 6797cc9e6..ea031f341 100755 --- a/static/scripts/install-nim-bundle.sh +++ b/static/scripts/install-nim-bundle.sh @@ -474,6 +474,32 @@ installBundleForRPMDistro(){ echo "Restarting NGINX Instance Manager" systemctl restart nms + 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}') + 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 + printf "Installing security module...\n" + if [ "${NIM_SM_VERSION}" == "latest" ]; then + yum install -y nms-sm + check_last_command_status "yum install -y nms-sm" $? + else + sm_pkg_version=$(findVersionForPackage "nms-sm" "${NIM_SM_VERSION}") + cmd_status=$? + if [ $cmd_status -ne 0 ]; then + echo "Package nms-sm with version ${NIM_SM_VERSION} not found" + exit $cmd_status + fi + yum install -y nms-sm="${sm_pkg_version}" + check_last_command_status "yum install -y nms-sm=${NIM_SM_VERSION}" $? + fi + systemctl restart nms + sleep 5 + systemctl restart nginx + systemctl start nms-sm + fi + sleep 5 echo "Restarting nginx API gateway" @@ -699,6 +725,11 @@ while getopts ${OPTS_STRING} opt; do ;; m) MODE="${OPTARG}" + if [[ "${MODE}" != "online" || "${MODE}" != "offline" ]]; then + echo "invalid mode ${MODE}" + echo "supported values for mode are 'online' or 'offline'" + exit 1 + fi ;; d) TARGET_DISTRIBUTION=${OPTARG} From 07d3508779c8a1c1f06a468e7a5c2ed911693b3a Mon Sep 17 00:00:00 2001 From: rajesh bejjanki Date: Sat, 1 Feb 2025 22:54:16 +0530 Subject: [PATCH 6/9] fix: fixing syntax error --- static/scripts/install-nim-bundle.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/scripts/install-nim-bundle.sh b/static/scripts/install-nim-bundle.sh index ea031f341..51934dfa7 100755 --- a/static/scripts/install-nim-bundle.sh +++ b/static/scripts/install-nim-bundle.sh @@ -498,10 +498,9 @@ installBundleForRPMDistro(){ sleep 5 systemctl restart nginx systemctl start nms-sm + fi fi - sleep 5 - echo "Restarting nginx API gateway" systemctl restart nginx } From ccb331cc2f9ce08edb19ea835fae243497656cf2 Mon Sep 17 00:00:00 2001 From: rajesh bejjanki Date: Sat, 1 Feb 2025 23:25:00 +0530 Subject: [PATCH 7/9] fix: fixing syntax error --- static/scripts/install-nim-bundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/scripts/install-nim-bundle.sh b/static/scripts/install-nim-bundle.sh index 51934dfa7..957a68db6 100755 --- a/static/scripts/install-nim-bundle.sh +++ b/static/scripts/install-nim-bundle.sh @@ -724,7 +724,7 @@ while getopts ${OPTS_STRING} opt; do ;; m) MODE="${OPTARG}" - if [[ "${MODE}" != "online" || "${MODE}" != "offline" ]]; then + if [[ "${MODE}" != "online" && "${MODE}" != "offline" ]]; then echo "invalid mode ${MODE}" echo "supported values for mode are 'online' or 'offline'" exit 1 From 6df664ee55ce37a17016a6987c390624278a5c16 Mon Sep 17 00:00:00 2001 From: rajesh bejjanki Date: Mon, 3 Feb 2025 11:02:42 +0530 Subject: [PATCH 8/9] fix: updating broken links --- static/scripts/install-nim-bundle.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/scripts/install-nim-bundle.sh b/static/scripts/install-nim-bundle.sh index 957a68db6..910a1437e 100755 --- a/static/scripts/install-nim-bundle.sh +++ b/static/scripts/install-nim-bundle.sh @@ -541,12 +541,13 @@ printUsageInfo(){ printf "\n -k /path/to/your/ file.\n" printf "\n -p . Include NGINX Plus version to install as an API gateway. Valid values are 'latest' and specific versions like R32. For a list, see https://docs.nginx.com/nginx/releases/. Supersedes -n.\n" printf "\n -n . Provide NGINX OSS version to install as an API gateway. Valid values are 'latest' or a specific version like 1.27.1. Ignored if you use -p to specify an NGINX Plus version. For a list, see https://nginx.org/en/download.html .\n" - printf "\n -s . Installs a security module along with NGINX Instance Manager. You can specify latest or a version specified in https://docs.nginx.com/nginx-management-suite/security/releases/release-notes/.\n" + printf "\n -s . Installs a security module along with NGINX Instance Manager. You can specify latest or a version specified in https://docs.nginx.com/nginx-instance-manager/monitoring/security-monitoring/releases/release-notes/.\n" printf "\n -i . Include the path with an archive file to support NGINX Instance Manager installation. Requires -m Offline." printf "\n -d . Include the label of a distribution. Requires -m Offline. This creates a file with NGINX Instance Manager dependencies and NGINX Instance Manager install packages for the specified distribution.\n" printf "\n -v . NGINX Instance Manager version to install/package.\n" - printf "\n -j . Path to the JWT token file used for license and usage consumption reporting.'\n" + printf "\n -j . Path to the JWT token file used for license and usage consumption reporting.\n" printf "\n -r To uninstall NGINX Instance Manager and its dependencies. \n" + printf "\n -l Print supported operating systems.\n" printf "\n -h Print this help message.\n" exit 0 } From e86c1025e47a2f9e90c41e1aeb3ea5220b5df791 Mon Sep 17 00:00:00 2001 From: rajesh bejjanki Date: Mon, 3 Feb 2025 21:06:14 +0530 Subject: [PATCH 9/9] fix: updating sm version checks --- static/scripts/install-nim-bundle.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/scripts/install-nim-bundle.sh b/static/scripts/install-nim-bundle.sh index 910a1437e..3582c3f7c 100755 --- a/static/scripts/install-nim-bundle.sh +++ b/static/scripts/install-nim-bundle.sh @@ -331,9 +331,10 @@ installBundleForDebianDistro() { debian_install_nginx debian_install_clickhouse debian_install_nim + echo "security module installation opted : ${USE_SM_MODULE}" 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}') 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