Zabbix MCP Server

Zabbix MCP Server

A middleware service that uses Model Context Protocol to analyze and automate Zabbix events with AI, enabling automated incident response and workflow automation through n8n integration.

Category
Visit Server

README

Zabbix MCP Server

Middleware service sử dụng Model Context Protocol để phân tích và tự động hóa các sự kiện Zabbix với AI.

Tính năng

  • Phân tích sự kiện Zabbix bằng AI (OpenAI/Ollama)
  • Tự động hóa phản hồi sự cố
  • Tích hợp với n8n cho workflow automation
  • Caching và Rate Limiting
  • Health Check System
  • Logging System
  • Unit Tests
  • API Documentation

Yêu cầu hệ thống

Cài đặt bằng Docker

  • Docker 20.10+
  • Docker Compose 2.0+
  • 4GB RAM trở lên
  • 20GB ổ cứng trống

Cài đặt

Cài đặt bằng Docker (Khuyến nghị)

  1. Clone repository:
git clone https://github.com/thichcode/zabbix_mcp.git
cd zabbix_mcp
  1. Cấu hình môi trường:
cp .env.example .env
# Chỉnh sửa file .env với cấu hình của bạn
  1. Build và chạy containers:
docker-compose up -d
  1. Kiểm tra logs:
docker-compose logs -f app
  1. Kiểm tra health:
curl http://localhost:8000/api/v1/health

Cài đặt thủ công

  1. Clone repository:
git clone https://github.com/thichcode/zabbix_mcp.git
cd zabbix_mcp
  1. Tạo và kích hoạt môi trường ảo:
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows
  1. Cài đặt dependencies:
pip install -r requirements.txt
  1. Cấu hình môi trường:
cp .env.example .env
# Chỉnh sửa file .env với cấu hình của bạn
  1. Cài đặt và cấu hình MongoDB:
# Ubuntu/Debian
sudo apt-get install mongodb
sudo systemctl start mongodb

# Windows
# Tải và cài đặt từ https://www.mongodb.com/try/download/community
  1. Cài đặt và cấu hình Redis:
# Ubuntu/Debian
sudo apt-get install redis-server
sudo systemctl start redis-server

# Windows
# Tải từ https://github.com/microsoftarchive/redis/releases
  1. Cấu hình Zabbix:
# Chạy script cấu hình
python scripts/setup_zabbix.py

Chạy ứng dụng

Docker

# Khởi động
docker-compose up -d

# Dừng
docker-compose down

# Xem logs
docker-compose logs -f app

# Restart
docker-compose restart app

Thủ công

  1. Chạy tests:
pytest tests/
  1. Chạy server:
uvicorn app.main:app --reload
  1. Kiểm tra health:
curl http://localhost:8000/api/v1/health
  1. Xem logs:
tail -f logs/api_*.log

Cấu hình Docker

Volumes

  • mongodb_data: Lưu trữ dữ liệu MongoDB
  • redis_data: Lưu trữ dữ liệu Redis
  • ollama_data: Lưu trữ models Ollama
  • ./logs: Log files
  • ./.env: Environment variables

Networks

  • zabbix_network: Network cho các services

Ports

  • 8000: API server
  • 27017: MongoDB
  • 6379: Redis
  • 11434: Ollama (tùy chọn)

API Endpoints

  • GET /api/v1/health: Kiểm tra trạng thái hệ thống
  • POST /api/v1/webhook: Webhook endpoint cho Zabbix
  • GET /docs: API documentation (Swagger UI)

Cấu trúc dự án

zabbix_mcp/
├── app/
│   ├── api/
│   │   ├── webhook.py
│   │   └── health.py
│   ├── core/
│   │   └── logging.py
│   ├── models/
│   │   └── event.py
│   ├── services/
│   │   ├── analysis.py
│   │   ├── auth_service.py
│   │   ├── cache_service.py
│   │   ├── database.py
│   │   ├── deep_research.py
│   │   └── ollama_service.py
│   └── main.py
├── tests/
│   └── test_analysis.py
├── scripts/
│   └── setup_zabbix.py
├── logs/
├── .env.example
├── .gitignore
├── Dockerfile
├── docker-compose.yml
├── README.md
└── requirements.txt

Monitoring

  • Health Check: /api/v1/health
  • Logs: logs/ directory hoặc docker-compose logs
  • Metrics: Prometheus metrics (coming soon)

Development

  1. Cài đặt development dependencies:
pip install -r requirements-dev.txt
  1. Chạy code formatting:
black .
isort .
  1. Chạy linting:
flake8
mypy .
  1. Chạy tests với coverage:
pytest --cov=app tests/

Contributing

  1. Fork repository
  2. Tạo branch mới
  3. Commit changes
  4. Push lên branch
  5. Tạo Pull Request

License

MIT License

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured