Skip to content

Commit

Permalink
BIG-IP collection script updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziofiorucci committed Mar 22, 2023
1 parent c51a3d6 commit efd5429
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 10 deletions.
47 changes: 41 additions & 6 deletions contrib/bigip-collect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The `bigIPCollect.sh` script must be copied and run on a BIG-IP instance (hardware-based or Virtual Edition). It will collect raw JSON files and package them into a single .tgz file:
the .tgz file can then be processed offline by Second Sight to build all target JSON files

## Usage - Data collection
## Installation on BIG-IP

- Copy (scp) `bigIPCollect.sh` from your local host to your BIG-IP instance, under `/tmp/`

Expand All @@ -26,17 +26,52 @@ Last login: Fri Nov 19 00:00:05 2021 from 192.168.1.18
[root@bigiq:Active:Standalone] config # /tmp/bigIPCollect.sh
Second Sight - https://github.com/F5Networks/SecondSight
This tool collects usage tracking data from BIG-IP for offline postprocessing.
=== Usage:
./bigIPCollect.sh [options]
=== Options:
-h - This help
-i - Interactive mode
-u [username] - BIG-IQ username (batch mode)
-p [password] - BIG-IQ password (batch mode)
-u [username] - BIG-IP username (batch mode)
-p [password] - BIG-IP password (batch mode)
-s [http(s)://address] - Upload data to Second Sight (optional)
=== Examples:
Interactive mode:
./bigIPCollect.sh -i
./bigIPCollect.sh -i -s https://<SECOND SIGHT GUI ADDRESS>
Interactive mode: ./bigIPCollect.sh -i
Batch mode: ./bigIPCollect.sh -u [username] -p [password]
Batch mode:
./bigIPCollect.sh -u [username] -p [password]
./bigIPCollect.sh -u [username] -p [password] -s https://<SECOND SIGHT GUI ADDRESS>
```

## Automated data collection

- On BIG-IP run the collection script using "admin" as the authentication username and its password

```
[root@bigip1:Active:Disconnected] tmp # ./bigIPCollect.sh -i -s http://192.168.1.19:8080
Username: admin
Password:
-> Collecting License info
-> Collecting software details
-> Collecting hardware details
-> Collecting provisioned modules
-> Collecting APM usage
-> Data collection completed, building JSON payload
-> Uploading /tmp/20230322-1154-bigIPCollect.json to Second Sight at http://192.168.1.19:8080
{"success":true,"status":"File upload completed","filename":"20230322-1154-bigIPCollect.json","content-type":"application/octet-stream","description":"20230322-1154-bigIPCollect.json","uid":"73096b05-995f-43cd-be8d-6fc39100c839"}-> Upload complete
[root@bigip1:Active:Disconnected] tmp #
```

## Manual data collection

- On BIG-IP run the collection script using "admin" as the authentication username and its password

```
Expand All @@ -53,7 +88,7 @@ Password:
[root@bigip1:Active:Disconnected] tmp #
```

- Retrieve the tgz file generated by `bigIPCollect.sh`
- Retrieve the tgz file

```
$ scp [email protected]:/tmp/20221122-2351-bigIPCollect.tgz .
Expand Down
10 changes: 6 additions & 4 deletions contrib/bigip-collect/bigIPCollect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ $0 [options]\n\n
-p [password]\t- BIG-IP password (batch mode)\n
-s [http(s)://address]\t- Upload data to Second Sight (optional)\n\n
=== Examples:\n\n
Interactive mode:\t$0 -i\n
Batch mode:\t\t$0 -u [username] -p [password]\n
Interactive mode:\n
\t$0 -i\n
\t$0 -i -s https://<SECOND SIGHT GUI ADDRESS>\n\n
Batch mode:\n
\t$0 -u [username] -p [password]\n
\t$0 -u [username] -p [password] -s https://<SECOND SIGHT GUI ADDRESS>\n
"

while getopts 'hiu:p:s:' OPTION
Expand Down Expand Up @@ -102,8 +106,6 @@ JSONFILEBASENAME=`date +"%Y%m%d-%H%M"`-bigIPCollect.json
JSONFILE=/tmp/$JSONFILEBASENAME
echo $JSON_STRING > $JSONFILE

echo "-> All done, copy $JSONFILE to your local host using scp"

if [ "$UPLOAD_SS" = "" ]
then
echo "-> All done, copy $JSONFILE to your local host using scp"
Expand Down

0 comments on commit efd5429

Please sign in to comment.