UWSGI
You can use the UWSGI plugin to report on the health of your Python application server. This includes information surrounding worker status/throughput, exception counts and overall performance. If you can not find this plugin in the /usr/lib/fm-agent/plugins folder, then your version of the Agent is out of date and you should update it to gain access to this feature.
Agent Configuration
In order to use this plugin, you will need to add the host server address and port of your UWSGI stats page. This can be specified when starting up an application with uwsgi using the extra option “–stats 127.0.0.1:1313 –stats-http”. Replacing the IP address and port with whatever you wished to bind the stats page to. Once you have done this, add the address and port to the /etc/fm-agent/fm_agent.cfg file as shown below:
[uwsgi]
server = 127.0.0.1
port = 1313
Control Panel Configuration
To add a UWSGI agent resource to your server, read Add FortiMonitor Agent checks. To use the UWSGI plugin, first select UWSGI from the App Server option in the Add Monitoring dropdown.
The Options Allow you to select the UWSGI worker you wish to monitor. The Metric drop-down will have nine options:
Metric |
Units |
---|---|
Average request time |
ms |
Exceptions |
exceptions |
How long worker is working |
workers |
How many data was transmitted by worker |
data |
How many requests worker did since worker (re)spawn |
requests |
Requests per second |
requests |
Worker is busy or free to use(BUSY=1, FREE=0) |
|
Worker RSS (Resident Set Size) |
|
Worker VSZ (Virtual Memory Size) |
If you would like to inspect the UWSGI plugin in more detail you can find the python script for it in the /usr/lib/fm-agent/plugins folder.
If you have followed the steps above and the new metric and plugin do not show properly, you may need to manually rebuild the agent’s metadata. You can do this by following the guide here.