on
11-Mar-2018
06:00
- edited on
05-Jun-2023
22:03
by
JimmyPackets
This script generate the utility billing report based of a list of regKey. This script only applies to utility-type licenses used for F5's subscription and/or ELA programs.
The regkey listed in the csv file or in the command line are the registration key associated with the license pool you wish to report on. Reports can be automatically submitted to F5 or manually created.
/!\ This feature will be included with BIG-IQ 6.1 /!\
BIG-IQ makes a REST call over SSL to api.f5.com to upload the report.
In this workflow, the customer generates the report, extracts it, then emails it to F5 (/shared/scripts/F5_Billing_License_Report.<date>.json).
Pre-Requisist:
Make sure you can access api.f5.com port 443 if automatic reporting is chosen (nslookup api.f5.com, ping api.f5.com, telnet api.f5.com 443). The script has to be executed locally from the BIG-IQ.
Installation:
The script must be installed in BIG-IQ under /shared/scripts:
# mkdir /shared/scripts
# chmod +x /shared/scripts/licenseUtilityReport.pl
Allowed command line options:
-h Help
-c Path to CSV file with all regKey - REQUIRED if not using -k
-k regKey(s) separated by , - REQUIRED if not using -c
-r Report option automatic or manual - OPTIONAL (default is automatic)
# cd /shared/scripts
# ./licenseUtilityReport.pl -k DRLPZ-JISKU-VPUPT-HZMMV-LERVPYQ,GYCWI-FOUEZ-YMWPX-LYROB-PXTKMTG
# ./licenseUtilityReport.pl -c listregkey.csv -r manual
# cat listregkey.csv
# crontab -e
(edit: type 'o' to add a new line, then 'ESC' and ':x' to save and quit)# crontab -l
(list)0 10 1 * * /usr/bin/perl /shared/scripts/licenseUtilityReport.pl -k DRLPZ-JISKU-VPUPT-HZMMV-LERVPYQ
0 10 1 * * /usr/bin/perl /shared/scripts/licenseUtilityReport.pl -c /shared/script/listregkey.csv -r manual
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday;
│ │ │ │ │ 7 is also Sunday on some systems)
│ │ │ │ │
│ │ │ │ │
* * * * *
In case you need to obfuscate the Utility Billing Report before sending it, use manual export, then use the following script to mask IP/Mac addresses and Hostnames from the report. Then submit/email report to F5 (Please contact F5 Support for assistance).
# ./f5_sanitize_usage_report.sh F5_Billing_License_Report.<date>.json
Location of the scripts on GitHub: https://github.com/f5devcentral/f5-big-iq-pm-team