# jmkdoc/zabbix architecture

> Architecture diagram of the GitHub repository jmkdoc/zabbix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jmkdoc/zabbix
- Repository: https://github.com/jmkdoc/zabbix

## Overview

Zabbix AI Tool collects monitoring data, analyzes numeric metrics, logs, database metrics, and events, then exports JSON results. Its main entry point orchestrates collection and analysis; a separate Flask API serves exported results for Grafana. The principal relationships are supported by the main.py excerpt and SOURCE INDEX, while the README documents analysis capabilities and output files. The Grafana dashboard’s runtime wiring is not shown, so that connection is marked unverified.

Main entry points: [`main.py`](https://github.com/jmkdoc/zabbix/blob/main/main.py) (Analysis runner), [`zabbix_client.py`](https://github.com/jmkdoc/zabbix/blob/main/zabbix_client.py) (Zabbix API client), [`api_server.py`](https://github.com/jmkdoc/zabbix/blob/main/api_server.py) (Grafana API), [`grafana/dashboards/zabbix-ai-dashboard.json`](https://github.com/jmkdoc/zabbix/blob/main/grafana/dashboards/zabbix-ai-dashboard.json) (Grafana dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_runner["Analysis runner<br/>[main.py]"]
  node_client["Zabbix API client<br/>[zabbix_client.py]"]
end

subgraph group_analysis["Analysis"]
  node_numeric["Numeric processing<br/>[data_processor.py]"]
  node_anomaly["Anomaly detection"]
  node_correlation["Correlation analysis"]
  node_logs["Log analysis<br/>[log_analyzer.py]"]
  node_database["Database analysis<br/>[db_analyzer.py]"]
  node_events["Event analysis<br/>[main.py]"]
end

subgraph group_delivery["Results and dashboards"]
  node_exports["JSON exports"]
  node_api["Grafana API<br/>[api_server.py]"]
  node_dashboard["Grafana dashboard"]
end

node_operator(("Operator"))
node_zabbix{{"Zabbix"}}

node_operator -->|"starts analysis"| node_runner
node_runner -->|"collects data"| node_client
node_client -->|"requests monitoring data"| node_zabbix
node_runner -->|"processes metrics"| node_numeric
node_runner -->|"detects anomalies"| node_anomaly
node_runner -->|"analyzes correlations"| node_correlation
node_runner -->|"analyzes logs"| node_logs
node_runner -->|"analyzes database metrics"| node_database
node_runner -->|"analyzes events"| node_events
node_runner -->|"writes results"| node_exports
node_api -->|"reads JSON"| node_exports
node_dashboard -.->|"queries API"| node_api

click node_runner "https://github.com/jmkdoc/zabbix/blob/main/main.py"
click node_client "https://github.com/jmkdoc/zabbix/blob/main/zabbix_client.py"
click node_numeric "https://github.com/jmkdoc/zabbix/blob/main/data_processor.py"
click node_anomaly "https://github.com/jmkdoc/zabbix/blob/main/anomaly_detector.py"
click node_correlation "https://github.com/jmkdoc/zabbix/blob/main/correlation_analyzer.py"
click node_logs "https://github.com/jmkdoc/zabbix/blob/main/log_analyzer.py"
click node_database "https://github.com/jmkdoc/zabbix/blob/main/db_analyzer.py"
click node_events "https://github.com/jmkdoc/zabbix/blob/main/main.py"
click node_api "https://github.com/jmkdoc/zabbix/blob/main/api_server.py"
click node_dashboard "https://github.com/jmkdoc/zabbix/blob/main/grafana/dashboards/zabbix-ai-dashboard.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runner,node_client toneBlue
class node_numeric,node_anomaly,node_correlation,node_logs,node_database,node_events toneAmber
class node_exports,node_api,node_dashboard toneMint
class node_operator,node_zabbix toneIndigo
```

## Components

### Data collection

- [Analysis runner](https://github.com/jmkdoc/zabbix/blob/main/main.py): `main.py`
- [Zabbix API client](https://github.com/jmkdoc/zabbix/blob/main/zabbix_client.py): `zabbix_client.py`

### Analysis

- [Numeric processing](https://github.com/jmkdoc/zabbix/blob/main/data_processor.py): `data_processor.py`
- [Anomaly detection](https://github.com/jmkdoc/zabbix/blob/main/anomaly_detector.py): `anomaly_detector.py`
- [Correlation analysis](https://github.com/jmkdoc/zabbix/blob/main/correlation_analyzer.py): `correlation_analyzer.py`
- [Log analysis](https://github.com/jmkdoc/zabbix/blob/main/log_analyzer.py): `log_analyzer.py`
- [Database analysis](https://github.com/jmkdoc/zabbix/blob/main/db_analyzer.py): `db_analyzer.py`
- [Event analysis](https://github.com/jmkdoc/zabbix/blob/main/main.py): `main.py`

### Results and dashboards

- **JSON exports**
- [Grafana API](https://github.com/jmkdoc/zabbix/blob/main/api_server.py): `api_server.py`
- [Grafana dashboard](https://github.com/jmkdoc/zabbix/blob/main/grafana/dashboards/zabbix-ai-dashboard.json): `grafana/dashboards/zabbix-ai-dashboard.json`

### Other components

- **Operator**
- **Zabbix**

## Connections

- Operator → Analysis runner: starts analysis (evidence: `README.md`)
- Analysis runner → Zabbix API client: collects data (evidence: `main.py`)
- Zabbix API client → Zabbix: requests monitoring data (evidence: `zabbix_client.py`)
- Analysis runner → Numeric processing: processes metrics (evidence: `main.py`)
- Analysis runner → Anomaly detection: detects anomalies (evidence: `main.py`)
- Analysis runner → Correlation analysis: analyzes correlations (evidence: `main.py`)
- Analysis runner → Log analysis: analyzes logs (evidence: `main.py`)
- Analysis runner → Database analysis: analyzes database metrics (evidence: `main.py`)
- Analysis runner → Event analysis: analyzes events (evidence: `main.py`)
- Analysis runner → JSON exports: writes results (evidence: `main.py`)
- Grafana API → JSON exports: reads JSON (evidence: `api_server.py`)
- Grafana dashboard → Grafana API: queries API
