Skip to content
Merged
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
20 changes: 19 additions & 1 deletion common/central_license_debug_collector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# For additional information please refer to CloudGuard Network Central License Tool Administration Guide.


# Licenses_Collector - version 5
# Licenses_Collector - version 6

usage()
{
Expand Down Expand Up @@ -106,9 +106,27 @@ 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 filtered licensepool_data DB into $TMPPATH"
psql_client cpm postgres -c "select * from licensepool_data where not deleted and dlesession=0;" >> $TMPPATH/licensePoolData_filtered.txt

log_msg " Collecting GatewayLicenses_data DB into $TMPPATH"
psql_client cpm postgres -c "select * from GatewayLicenses_data;" >> $TMPPATH/gatewayLicensesData.txt

log_msg " Collecting filtered GatewayLicenses_data DB into $TMPPATH"
psql_client cpm postgres -c "select * from gatewaylicenses_data where not deleted and dlesession=0;" >> $TMPPATH/gatewayLicensesData_filtered.txt

log_msg " Collecting VsecLicense_data DB into $TMPPATH"
psql_client cpm postgres -c "select * from vseclicense_data;" >> $TMPPATH/vsecLicenseData.txt

log_msg " Collecting filtered vseclicense_data DB into $TMPPATH"
psql_client cpm postgres -c "select * from vseclicense_data where not deleted and dlesession=0;" >> $TMPPATH/vsecLicenseData_filtered.txt

log_msg " Collecting number of unattached licenses into $TMPPATH (Shloud be empty)"
psql_client cpm postgres -c "select domb.name, dod.domainid, count(1) from domainbase_data as domb join dleobjectderef_data as dod on dod.domainid=domb.objid where (dod.fwset ilike '%not-installed%' or (dod.fwset ilike '%(installed)%' and dod.fwset ilike '%network_object ()%')) and dod.cpmitype='license' and not dod.deleted and dod.dlesession=0 group by domb.name, dod.domainid order by count(1) desc;" >> $TMPPATH/number_of_unattached_licenses.txt

log_msg " Collecting number of all licenses into $TMPPATH (for cprlic debug)"
psql_client cpm postgres -c "select domb.name, dod.domainid, count(1) from domainbase_data as domb join dleobjectderef_data as dod on dod.domainid=domb.objid where dod.cpmitype='license' and not dod.deleted and dod.dlesession=0 group by domb.name, dod.domainid order by count(1) desc;" >> $TMPPATH/number_of_all_licenses.txt

log_msg " Compressing $TMPPATH into $OUTPUTFILE_NAME"
tar -cvf $OUTPUTFILE_NAME $TMPPATH > /dev/null 2>&1

Expand Down