18-Apr-2023 22:52 - edited 25-Apr-2023 05:16
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.)
Having a graphical representation of how a virtual server distributes the traffic to its pools, makes it easier to understand.
There are 2 main files:
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).
Here you can find the code: https://github.com/czirakim/F5_VIP_graph
Hello,
This code looks higly intersting but in my environnement, I doesn't manage to execute it. I am launching it through :
python F5_VIP_grapher.py <vs-name>
return :
File "F5_VIP_grapher.py", line 66
vip_name = f"{sys.argv[1]}"