# luizkarlus/projeto-zabbix-opencode architecture

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

- Interactive diagram: https://gitdiagram.com/luizkarlus/projeto-zabbix-opencode
- Repository: https://github.com/luizkarlus/projeto-zabbix-opencode

## Overview

Zabbix AI Lab is a local monitoring and alerting stack with two user-facing paths: chat-based AI access to Zabbix, and Zabbix alerts delivered to WhatsApp; Grafana provides a separate dashboard path. Zabbix also monitors a demo agent. The repository contains Laya’s MCP tool server and Zabbix provisioning automation, while several other services are external projects run as part of the stack. Relationships follow the README diagram and descriptions or the shown source excerpts; unsampled service internals are not inferred.

Main entry points: [`docker-compose.yml`](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml) (Zabbix), [`scripts/zabbix_bootstrap.py`](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/scripts/zabbix_bootstrap.py) (Zabbix provisioner), [`config/zabbix-mcp/config.toml.example`](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/config/zabbix-mcp/config.toml.example) (Zabbix MCP server), [`laya/app/laya_mcp_server.py`](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/laya/app/laya_mcp_server.py) (Laya MCP tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_monitoring["Monitoring"]
  node_zabbix["Zabbix<br/>[docker-compose.yml]"]
  node_postgres[("PostgreSQL<br/>[docker-compose.yml]")]
  node_agent["Demo agent<br/>[docker-compose.yml]"]
end

subgraph group_ai["AI access"]
  node_openwebui["Open WebUI<br/>[docker-compose.yml]"]
  node_ollama["Ollama<br/>[docker-compose.yml]"]
  node_mcp["Zabbix MCP server"]
  node_laya_tools["Laya MCP tools<br/>[laya_mcp_server.py]"]
  node_laya_daemon["Laya decision daemon<br/>[laya_mcp_server.py]"]
end

subgraph group_alerting["Alert delivery"]
  node_wa_gateway["WA-AKG gateway<br/>[docker-compose.yml]"]
end

subgraph group_provisioning["Provisioning"]
  node_provisioner["Zabbix provisioner"]
  node_mcp_config["MCP configuration"]
end

subgraph group_observability["Dashboards"]
  node_grafana["Grafana<br/>[docker-compose.yml]"]
  node_grafana_datasource["Zabbix datasource config<br/>[zabbix.yml]"]
end

node_operator(("Chat user"))
node_recipient(("WhatsApp recipient"))

node_operator -->|"chats with"| node_openwebui
node_openwebui -->|"uses model"| node_ollama
node_openwebui -->|"uses tools"| node_mcp
node_mcp -->|"calls API"| node_zabbix
node_openwebui -.->|"connects MCP"| node_laya_tools
node_laya_tools -->|"sends decisions"| node_laya_daemon
node_agent -->|"reports metrics"| node_zabbix
node_zabbix -->|"sends webhook"| node_wa_gateway
node_wa_gateway -->|"delivers alert"| node_recipient
node_zabbix -->|"uses database"| node_postgres
node_provisioner -->|"provisions API"| node_zabbix
node_provisioner -->|"writes token"| node_mcp_config
node_grafana_datasource -->|"provisions datasource"| node_grafana
node_grafana -->|"queries API"| node_zabbix

click node_zabbix "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml"
click node_postgres "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml"
click node_agent "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml"
click node_openwebui "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml"
click node_ollama "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml"
click node_mcp "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/config/zabbix-mcp/config.toml.example"
click node_laya_tools "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/laya/app/laya_mcp_server.py"
click node_laya_daemon "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/laya/app/laya_mcp_server.py"
click node_wa_gateway "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml"
click node_provisioner "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/scripts/zabbix_bootstrap.py"
click node_mcp_config "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/config/zabbix-mcp/config.toml.example"
click node_grafana "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml"
click node_grafana_datasource "https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/config/grafana/provisioning/datasources/zabbix.yml"

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_zabbix,node_postgres,node_agent,node_operator toneBlue
class node_openwebui,node_ollama,node_mcp,node_laya_tools,node_laya_daemon toneAmber
class node_wa_gateway toneMint
class node_provisioner,node_mcp_config toneRose
class node_grafana,node_grafana_datasource,node_recipient toneIndigo
```

## Components

### Monitoring

- [Zabbix](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml): `docker-compose.yml`
- [PostgreSQL](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml): `docker-compose.yml`
- [Demo agent](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml): `docker-compose.yml`

### AI access

- [Open WebUI](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml): `docker-compose.yml`
- [Ollama](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml): `docker-compose.yml`
- [Zabbix MCP server](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/config/zabbix-mcp/config.toml.example): `config/zabbix-mcp/config.toml.example`
- [Laya MCP tools](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/laya/app/laya_mcp_server.py): `laya/app/laya_mcp_server.py`
- [Laya decision daemon](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/laya/app/laya_mcp_server.py): `laya/app/laya_mcp_server.py`

### Alert delivery

- [WA-AKG gateway](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml): `docker-compose.yml`

### Provisioning

- [Zabbix provisioner](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/scripts/zabbix_bootstrap.py): `scripts/zabbix_bootstrap.py`
- [MCP configuration](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/config/zabbix-mcp/config.toml.example): `config/zabbix-mcp/config.toml.example`

### Dashboards

- [Grafana](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/docker-compose.yml): `docker-compose.yml`
- [Zabbix datasource config](https://github.com/luizkarlus/projeto-zabbix-opencode/blob/main/config/grafana/provisioning/datasources/zabbix.yml): `config/grafana/provisioning/datasources/zabbix.yml`

### Other components

- **Chat user**
- **WhatsApp recipient**

## Connections

- Chat user → Open WebUI: chats with (evidence: `README.md`)
- Open WebUI → Ollama: uses model (evidence: `README.md`)
- Open WebUI → Zabbix MCP server: uses tools (evidence: `README.md`)
- Zabbix MCP server → Zabbix: calls API (evidence: `README.md`)
- Open WebUI → Laya MCP tools: connects MCP (evidence: `README.md`)
- Laya MCP tools → Laya decision daemon: sends decisions (evidence: `laya/app/laya_mcp_server.py`)
- Demo agent → Zabbix: reports metrics (evidence: `README.md`)
- Zabbix → WA-AKG gateway: sends webhook
- WA-AKG gateway → WhatsApp recipient: delivers alert (evidence: `README.md`)
- Zabbix → PostgreSQL: uses database (evidence: `README.md`)
- Zabbix provisioner → Zabbix: provisions API (evidence: `scripts/zabbix_bootstrap.py`)
- Zabbix provisioner → MCP configuration: writes token (evidence: `scripts/zabbix_bootstrap.py`)
- Zabbix datasource config → Grafana: provisions datasource (evidence: `README.md`)
- Grafana → Zabbix: queries API (evidence: `README.md`)
