One possible architecture:
- Agent is a process that sits on the database server written in Python.
- Code a VERY lightweight, highly stable plugin written in the native code of the database. The sole purpose is to connect with the local agent and give it data.
Agent connects to the central server to dump data and do reports. The agent can poll every 60 seconds for new management commands or new settings.