It’s very common to start at a place and realizing that the F5 environment contains loads pools with members down. Often, the reason for this is the disconnection between the people setting up and configuring servers and the people managing the load balancers.
This makes my OCD sense tingle full time so I usually reset statistics and wait a month to see if any data has been sent to those members. Then I bring out the sledge hammer. But then, a few weeks later the amount of failed members start to steadily creep up again.
There’s a time however, when admins must rise up, and write sh*t loads of code to keep their environments clean. And this day is now.
Credits to Net Entertainment for allowing me to release this as open source.
Table of Contents
Heads up, this project is originally not meant to be released and is designed to be used in GKE. It is not as polished as BigIPReport but you should be able to get up and running quite fast any way if you follow the guide step by step.
Should you encounter any issues with the instructions, please leave a comment and I will update the post.
How it works
There’s three components involved:
The batch job collects data from all your F5s at least once per day.
- If a member is down it will increase days down for that member by 1.
- If a member does not have a higher data count than the day before the no-data property is increased by 1.
- Same for requests
- Same for connections
Since the statistics is stored per member in the F5s the script will collect data, and wait one day until updating the stats in case there’s a been a failover.
You’ll get a web interface that shows how long members has been down and how many days without data/connections/requests.
Getting started (docker)
Heads up, this project is not as polished as BigIPReport but you should be able to get up and running quite fast any way. Should you encounter any issues with the instructions, please leave a comment.
- Get a Linux server with a fairly modern OS
- Install Docker
- Create a directory, clone the latest version of Consuela:
sudo mkdir -p /opt/consuela
sudo git clone https://github.com/net-utilities/consuela.git .
sudo mv update_db/src/config-example.ts update_db/src/config.ts
- Update the docker-compose.yaml file in the root directory with your desired database user and password.
- Update the configuration file in update_db/src/config.ts. There’s instructions and examples in it. If specifying credentials in the configuration file instead of using environment variables, make sure to specify the same database credentials here.
Testing the report
- Enter to /opt/consuela
- Execute docker-compose build
- Then docker-compose up -d
- Edit update_db/docker-compose.yaml. If you oped for environment variables when editing config.ts earlier, populate the variables here. Otherwise remove all environment variables.
- Then run the script for pulling data
Scheduling the report
- Enter the directory /opt/consuela/update_db
- Build the update db container
docker build . -t consuela
- Create a cron job. Add environment variables matching your update_db/docker-compose.yaml if you decided to use those above.
Example cron job
00 06,21 * * * root /usr/bin/docker run -d --rm --net=host -e 'F5_USERNAME=consuela' -e 'F5_PASSWORD=consuelapass' -e 'COUCHDB_USER=admin' -e 'COUCHDB_PASSWORD=password' -e 'COUCHDB_SERVER=localhost:5984' update_db_update_db:latest
The command above runs the update at 06:00 and 21:00 every day. Please change the path to docker if needed (check your path with the command which docker).
Reason for running it twice per day is that while the records does not increase the counters more than once per day there might have been additions since the last batch or issues executing the job the first time.
There’s way too many combos for me to document them all but I’ve added a sub directory with manifests for GCP. You’ll have to modify them to include certs, container registry addresses and create your own secrets though.
There’s docker files for each of the components in the repo.
Anticipated future questions
Where’s the filters?
Top right corner holds the filter button. When selecting/updating filters you can see the active filters above the table header row.
It’s not showing all of my data
Consuela shows only data that has been touched the last 10.000 seconds (~27 hours) so if Consuela has failed to index a load balancer the data associated with that load balancer won’t show until there’s fresh data again.
If you’re using slack, enable and configure the Slack Hook to get reports when Consuela fails to index a load balancer.
Counters were reset
If running docker-compose, check your database volume mountes and make sure that it’s persistent. If running kubernetes it’s a good idea to kill off the database container in the beginning and start it again to make sure that the volume claims works as they should.