How abdallahfathii/zabbix-monitoring-platform works
Monitoring Platform collects IoT readings through MQTT, persists them in PostgreSQL, evaluates alerts, and exposes live dashboards and reports while provisioning and synchronizing Zabbix. The principal workflow runs from sensors through Mosquitto and the Python service to storage and Zabbix; HTTP users reach live views and report generation through FastAPI. The graph also preserves documented charting, history, alert, and dashboard capabilities. Some subsystem links rely on README documentation because their implementation excerpts were incomplete.
Main entry points: main.py FastAPI endpoints · database.py Monitoring PostgreSQL · mqtt_client.py MQTT ingestion · zabbix_setup.py Zabbix provisioning
Components 19
Collection & alerts
- Mosquitto broker
mosquitto/config/mosquitto.conf - MQTT ingestion
python-service/app/mqtt_client.py - Threshold alerts
python-service/app/mqtt_client.py
API & reporting
- FastAPI endpoints
python-service/app/main.py - Data retrieval
python-service/app/data_retrieval.py - Chart payloads
python-service/app/chart_utils.py - History reports
python-service/app/history_report.py - PDF reports
python-service/app/pdf_reports.py - Report aggregation
python-service/app/reports.py - Daily PDF renderer
python-service/app/pdf_report.py
Monitoring data
- Monitoring PostgreSQL
python-service/app/database.py - Monitoring entities
python-service/app/models.py - Monitoring schema
database/migrations/002_monitoring_tables.sql
Zabbix integration
- Zabbix provisioning
python-service/app/zabbix_setup.py - Zabbix synchronization
python-service/app/zabbix_sync.py - Zabbix server
- Zabbix frontend
Other components
- IoT sensors
- Dashboard/report user
Connections 25
- IoT sensors → Mosquitto broker: publishes MQTT
README.md - Mosquitto broker → MQTT ingestion: routes messages
README.md - MQTT ingestion → Monitoring PostgreSQL: stores readings
README.md - MQTT ingestion → Threshold alerts: evaluates thresholds
README.md - MQTT ingestion → Zabbix server: sends trapper values
README.md - MQTT ingestion → Zabbix provisioning: provisions devices
README.md - Threshold alerts → Monitoring PostgreSQL: persists alerts
README.md - Monitoring PostgreSQL → Monitoring entities: maps entities
python-service/app/models.py - Dashboard/report user → FastAPI endpoints: requests views
README.md - FastAPI endpoints → Data retrieval: loads summaries
python-service/app/main.py - FastAPI endpoints → Chart payloads: builds chart data
python-service/app/main.py - FastAPI endpoints → History reports: generates history PDF
python-service/app/main.py - FastAPI endpoints → PDF reports: generates device PDF
python-service/app/main.py - FastAPI endpoints → Report aggregation: aggregates report
python-service/app/main.py - FastAPI endpoints → Daily PDF renderer: renders daily PDF
python-service/app/main.py - Data retrieval → Monitoring PostgreSQL: queries measurements
python-service/app/data_retrieval.py - History reports → Monitoring PostgreSQL: reads history
python-service/app/history_report.py - Report aggregation → Monitoring PostgreSQL: queries records
- Zabbix provisioning → Zabbix server: configures items
README.md - Zabbix provisioning → Zabbix server: creates dashboards
README.md - Zabbix server → Zabbix frontend: displays dashboards
README.md - FastAPI endpoints → Zabbix synchronization: triggers sync
python-service/app/main.py - Zabbix synchronization → Zabbix server: reads host data
README.md - Zabbix synchronization → Monitoring PostgreSQL: syncs records
python-service/app/zabbix_sync.py - Monitoring schema → Monitoring PostgreSQL: defines schema