From d11218eca6d680d2aa50cfbb32aad3a593af3ea5 Mon Sep 17 00:00:00 2001 From: yazanb Date: Thu, 8 Jun 2023 09:37:22 +0300 Subject: [PATCH 1/4] Get vsec view and management licenses --- common/central_license_debug_collector.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/central_license_debug_collector.sh b/common/central_license_debug_collector.sh index 24b3b7ec..70e3c91a 100755 --- a/common/central_license_debug_collector.sh +++ b/common/central_license_debug_collector.sh @@ -10,7 +10,7 @@ # Written by: Check Point Software Technologies LTD. # For additional information please refer to CloudGuard Network Central License Tool Administration Guide. -# Licenses_Collector - version 2 +# Licenses_Collector - version 3 usage() { @@ -91,6 +91,12 @@ cp $MDS_FWDIR/log/vseclic.elg* $TMPPATH log_msg " Collecting licenses with cprlic into $TMPPATH" cprlic print -all -x -a >> $TMPPATH/Attached_licenses +log_msg " Collecting vsec view into $TMPPATH" +vsec_lic_cli view >> $TMPPATH/View_licenses.txt + +log_msg " Collecting management licenses into $TMPPATH" +cplic print -n -x >> $TMPPATH/Management_licenses.txt + log_msg " Collecting licensepool_data DB into $TMPPATH" psql_client cpm postgres -c "select * from licensePool_data;" >> $TMPPATH/licensePoolData.txt From df5f1e76018a3a1fc51f4e779253249e85a9d1a1 Mon Sep 17 00:00:00 2001 From: chkp-yazanb <113822306+chkp-yazanb@users.noreply.github.com> Date: Thu, 8 Jun 2023 09:42:07 +0300 Subject: [PATCH 2/4] Get vsec view and management licenses --- common/central_license_debug_collector.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/central_license_debug_collector.sh b/common/central_license_debug_collector.sh index 70e3c91a..a8ce8829 100755 --- a/common/central_license_debug_collector.sh +++ b/common/central_license_debug_collector.sh @@ -89,19 +89,19 @@ cp $MDS_FWDIR/log/vseclic.elg* $TMPPATH # Collect licenses data from DB log_msg " Collecting licenses with cprlic into $TMPPATH" -cprlic print -all -x -a >> $TMPPATH/Attached_licenses +cprlic print -all -x -a >> $TMPPATH/attached_licenses log_msg " Collecting vsec view into $TMPPATH" -vsec_lic_cli view >> $TMPPATH/View_licenses.txt +vsec_lic_cli view >> $TMPPATH/view_licenses.txt log_msg " Collecting management licenses into $TMPPATH" -cplic print -n -x >> $TMPPATH/Management_licenses.txt +cplic print -n -x >> $TMPPATH/management_licenses.txt log_msg " Collecting licensepool_data DB into $TMPPATH" psql_client cpm postgres -c "select * from licensePool_data;" >> $TMPPATH/licensePoolData.txt log_msg " Collecting GatewayLicenses_data DB into $TMPPATH" -psql_client cpm postgres -c "select * from GatewayLicenses_data;" >> $TMPPATH/GatewayLicensesData.txt +psql_client cpm postgres -c "select * from GatewayLicenses_data;" >> $TMPPATH/gatewayLicensesData.txt log_msg " Compressing $TMPPATH into $OUTPUTFILE_NAME" tar -cvf $OUTPUTFILE_NAME $TMPPATH > /dev/null 2>&1 From e92f70b19b43f5ddfa9e7b6029795b6963b76857 Mon Sep 17 00:00:00 2001 From: yazanb Date: Tue, 14 Nov 2023 14:40:48 +0200 Subject: [PATCH 3/4] Change mdsenv command --- common/central_license_debug_collector.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/central_license_debug_collector.sh b/common/central_license_debug_collector.sh index a8ce8829..d580a559 100755 --- a/common/central_license_debug_collector.sh +++ b/common/central_license_debug_collector.sh @@ -10,7 +10,7 @@ # Written by: Check Point Software Technologies LTD. # For additional information please refer to CloudGuard Network Central License Tool Administration Guide. -# Licenses_Collector - version 3 +# Licenses_Collector - version 4 usage() { @@ -57,7 +57,7 @@ mkdir -p $TMPPATH if [ -n "$DOMAIN_NAME" ]; then log_msg " switch to domain env" - mdsenv "$DOMAIN_NAME" + . $MDSDIR/scripts/MDSprofile.sh && mdsenv "$DOMAIN_NAME" fi # checking if there's connectivity with userCenter and if TCP port 18208 is open From 7cbc6272d61e8c4936bd7e7a6e7d41638f885d14 Mon Sep 17 00:00:00 2001 From: yazanb Date: Mon, 6 May 2024 12:05:45 +0300 Subject: [PATCH 4/4] Added alignLicense.elg to the output file --- common/central_license_debug_collector.sh | 63 ++++++++++++----------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/common/central_license_debug_collector.sh b/common/central_license_debug_collector.sh index 0ad89ed6..cd3e3509 100755 --- a/common/central_license_debug_collector.sh +++ b/common/central_license_debug_collector.sh @@ -2,16 +2,16 @@ # The script collects Central Licenses debug files for troubleshooting purposes. -# Instructions : - # If you have MDS environment and uses license in domain mode - please run the script with -d - # If your environment acceseses the internet using a configured proxy - please run the script with -p - # Otherwise , run the script directly . - -# Written by: Check Point Software Technologies LTD. +# Instructions : + # If you have MDS environment and uses license in domain mode - please run the script with -d + # If your environment acceseses the internet using a configured proxy - please run the script with -p + # Otherwise , run the script directly . + +# Written by: Check Point Software Technologies LTD. # For additional information please refer to CloudGuard Network Central License Tool Administration Guide. -# Licenses_Collector - version 4 +# Licenses_Collector - version 5 usage() { @@ -22,21 +22,21 @@ usage() } while getopts "p:d:h" opt; do - case "$opt" in - d) - DOMAIN_NAME="$OPTARG" + case "$opt" in + d) + DOMAIN_NAME="$OPTARG" ;; - p) - PROXY_PORT="$OPTARG" - ;; - h) - usage - exit 0 - ;; - *) - usage - exit 1 - esac + p) + PROXY_PORT="$OPTARG" + ;; + h) + usage + exit 0 + ;; + *) + usage + exit 1 + esac done @@ -48,7 +48,7 @@ USERCENTER=https://usercenter.CheckPoint.com log_msg() { - echo "$(date) $1" + echo "$(date) $1" } log_msg "Starting" @@ -63,27 +63,32 @@ fi # checking if there's connectivity with userCenter and if TCP port 18208 is open log_msg " Checking if TCP port 18208 is open and accessible" -printf " Checking TCP port \n\n" >> $TMPPATH/Sync +printf " Checking TCP port \n\n" >> $TMPPATH/Sync netstat -na | grep "18208" >> $TMPPATH/Sync printf "\n\n" >> $TMPPATH/Sync -printf " Checking connecitivty with userCenter\n\n" >> $TMPPATH/Sync +printf " Checking connecitivty with userCenter\n\n" >> $TMPPATH/Sync if [ -n "$PROXY_PORT" ]; then - log_msg " Checking connecitivty with userCenter using proxy" - $CURL_CLI --proxy $PROXY_PORT -v -k $USERCENTER &>> $TMPPATH/Sync + log_msg " Checking connecitivty with userCenter using proxy" + $CURL_CLI --proxy $PROXY_PORT -v -k $USERCENTER &>> $TMPPATH/Sync else - log_msg " Checking connecitivty with userCenter without using proxy" - $CURL_CLI -v -k $USERCENTER &>> $TMPPATH/Sync + log_msg " Checking connecitivty with userCenter without using proxy" + $CURL_CLI -v -k $USERCENTER &>> $TMPPATH/Sync fi - + printf "the exit code is : %s\n" $? >> $TMPPATH/Sync # Collect server logs (cpm.elg*) data log_msg " Copying $MDS_FWDIR/log/cpm.elg* into $TMPPATH" cp $MDS_FWDIR/log/cpm.elg* $TMPPATH +if [ -f "$MDS_FWDIR/log/alignLicensesInDB.elg" ]; then + log_msg " Copying $MDS_FWDIR/log/alignLicensesInDB.elg into $TMPPATH" + cp $MDS_FWDIR/log/alignLicensesInDB.elg $TMPPATH +fi + #Collect client logs (vseclic.elg*) data log_msg " Copying $MDS_FWDIR/log/vseclic.elg* into $TMPPATH" cp $MDS_FWDIR/log/vseclic.elg* $TMPPATH