Some customers may want to leverage the opCharts API with python scripts. This article will provide one example of how this could be done.
For this example we'll build a HTML Network Status web page via a CGI script. This page will be comprised of tables; the first table will summarize group status while the subsequent tables will provide node level details for each group.
Define modules and variables
This example will utilize the following modules.
- urllib.request - https://docs.python.org/3/library/urllib.request.html
- http.cookiejar - https://docs.python.org/3/library/http.cookiejar.html
- json - https://docs.python.org/3/library/json.html
We also need to define the following variables.
- Protocol (http or https)