CodeShare
Have some code. Share some code.
cancel
Showing results for 
Search instead for 
Did you mean: 
mihaic
MVP
MVP
Code is community submitted, community supported, and recognized as ‘Use At Your Own Risk’.

Short Description

In this article, I will explore how to create a graphical representation of a virtual server using Python Flask, Pyvis libraries, and the IControl REST F5 API. This graphical representation will provide a visual representation of the virtual server, including the pools and pool members(servers) it is connected to, and also the URI.

(As irules can be really complex, this is mainly for irules with "if" and "switch" clauses.)

sslVIP3.PNG

Problem solved by this Code Snippet

Having a graphical representation of how a virtual server distributes the traffic to its pools, makes it easier to understand.

How to use this Code Snippet

There are 2 main files:

  • F5_VIP_grapher.py
  • app.py

F5_VIP_grapher.py <VIP_name>  - this is how you run it and will generate the HTML files "static" folder.

app.py - this is the app that starts the Flask web server and provides a front-end to the F5_VIP_grapher.py.

There is also a Dockerfile that you can use to containerize this app.

There are 2 environment variables: Authorization_string (this is credentials(user:pass) for Basic authentication)
and IP_ADDRESS (this is the IP of the F5 device).

Code Snippet Meta Information

  1. Version: 1
  2. Coding Language: Python 3.10.9

Full Code Snippet

Here you can find the code: https://github.com/czirakim/F5_VIP_graph

 

Version history
Last update:
‎25-Apr-2023 05:16
Updated by:
Contributors