MCP ExplorerExplorer

Zabbix Ai Mcp

@kairogynon 9 months ago
2 MIT
FreeCommunity
AI Systems
Zabbix MCP Server connects AI agents with Zabbix for automated monitoring and analysis.

Overview

What is Zabbix Ai Mcp

Zabbix-ai-mcp is a Model Context Protocol (MCP) server that facilitates interaction between AI agents and the Zabbix monitoring system through a secure and authenticated interface. It acts as a bridge for intelligent automation of monitoring, maintenance, and analysis tasks.

Use cases

Use cases for zabbix-ai-mcp include automatic detection and resolution of high CPU usage issues, resource optimization, conducting security audits, and integrating with DevOps workflows for continuous monitoring.

How to use

To use zabbix-ai-mcp, set up your environment by cloning the repository, installing dependencies, and configuring environment variables. Ensure you have a Cloudflare account and a Zabbix instance with API access. Deploy the server locally for development or to Cloudflare for production.

Key features

Key features of zabbix-ai-mcp include proactive monitoring and incident resolution, automation of maintenance based on usage patterns, resource analysis and optimization, security audits, and monitoring of deployments and DevOps integrations.

Where to use

Zabbix-ai-mcp can be used in various fields including IT infrastructure management, cloud services, DevOps environments, and any scenario requiring automated monitoring and maintenance of systems.

Content

Zabbix MCP Server

This is an MCP (Model Context Protocol) server that enables AI agents to interact with Zabbix through a secure and authenticated interface. The server provides a bridge between AI agents and the Zabbix monitoring system, enabling intelligent automation of monitoring, maintenance, and analysis tasks.

Overview

The Zabbix MCP Server enables AI agents to:

  • Proactively monitor and resolve issues
  • Automate maintenance based on usage patterns
  • Analyze and optimize resources
  • Conduct security audits
  • Monitor deployments and DevOps integrations

Prerequisites

  • Node.js 18 or higher
  • Cloudflare account
  • Zabbix instance with API enabled
  • Zabbix API access with appropriate permissions

Installation

1. Environment Setup

# Clone the repository
git clone https://github.com/your-username/zabbix-mcp.git
cd zabbix-mcp

# Install dependencies
npm install

# Configure environment variables
cp .env.example .env

2. Cloudflare Setup

# Install Wrangler CLI
npm install -g wrangler

# Login to Cloudflare
wrangler login

# Configure the project
wrangler config

3. Zabbix Setup

  1. Enable the Zabbix API on your server
  2. Create a dedicated API user with appropriate permissions
  3. Configure credentials in the .env file:
ZABBIX_URL=https://your-zabbix.com
ZABBIX_USER=api_user
ZABBIX_PASSWORD=api_password

Deployment

Local Development

# Start the server in development mode
npm run dev

# Server will be available at http://localhost:8787

Production

# Deploy to Cloudflare
wrangler deploy

Available Tools

1. Proactive Monitoring and Incident Resolution

handleHighCPUUsage

Scope: Automatic monitoring and resolution of high CPU usage issues

  • Detects hosts with CPU usage above threshold
  • Identifies problematic processes
  • Executes automatic resolution actions
  • Generates incident reports

Parameters:

{
  "threshold": 80,    // CPU threshold percentage
  "duration": 300     // Monitoring duration in seconds
}

monitorCriticalServices

Scope: Continuous monitoring of critical services

  • Monitors status of specific services
  • Performs periodic checks
  • Notifies on state changes
  • Records availability history

Parameters:

{
  "services": ["nginx", "mysql", "redis"],  // List of services
  "checkInterval": 60                       // Check interval in seconds
}

2. Maintenance Automation

scheduleSmartMaintenance

Scope: Intelligent maintenance scheduling

  • Analyzes usage patterns
  • Identifies ideal windows
  • Schedules maintenance
  • Notifies stakeholders

Parameters:

{
  "hostGroup": "production-servers",        // Host group
  "preferredTime": "2024-03-26T02:00:00Z", // Preferred time
  "maxDuration": 3600                       // Maximum duration in seconds
}

3. Performance Analysis and Optimization

optimizeResources

Scope: Resource analysis and optimization

  • Collects usage metrics
  • Identifies bottlenecks
  • Generates recommendations
  • Monitors trends

Parameters:

{
  "resourceType": "memory",     // Resource type
  "timeRange": "now-24h"       // Analysis period
}

4. Security and Compliance

securityAudit

Scope: Security and compliance auditing

  • Verifies security configurations
  • Analyzes access logs
  • Identifies vulnerabilities
  • Generates compliance reports

Parameters:

{
  "scope": "critical",                    // Audit scope
  "checks": ["access_control", "firewall"] // Specific checks
}

5. DevOps Integration

monitorDeployment

Scope: Deployment and integration monitoring

  • Monitors post-deploy health
  • Analyzes performance metrics
  • Detects regressions
  • Generates deployment reports

Parameters:

{
  "application": "web-app",                    // Application name
  "version": "1.2.3",                         // Deployment version
  "metrics": ["response_time", "error_rate"]   // Metrics to monitor
}

Use Cases

1. Proactive Monitoring

// Example of handleHighCPUUsage
{
  "threshold": 85,
  "duration": 600
}

2. Smart Maintenance

// Example of scheduleSmartMaintenance
{
  "hostGroup": "production-servers",
  "preferredTime": "2024-03-26T02:00:00Z",
  "maxDuration": 3600
}

3. Resource Optimization

// Example of optimizeResources
{
  "resourceType": "memory",
  "timeRange": "now-24h"
}

4. Security Audit

// Example of securityAudit
{
  "scope": "critical",
  "checks": ["access_control", "firewall_rules"]
}

5. Deployment Monitoring

// Example of monitorDeployment
{
  "application": "web-app",
  "version": "1.2.3",
  "metrics": ["response_time", "error_rate", "cpu_usage"]
}

Security

  • All credentials are securely stored in Cloudflare
  • OAuth 2.1 authentication for tool access
  • Limited scope access tokens
  • Encrypted communication between client and server
  • Audit logging of all operations

Troubleshooting

Common Issues

  1. Authentication Error

    • Verify Zabbix credentials
    • Confirm API is enabled
    • Check user permissions
  2. Connection Error

    • Verify Zabbix URL
    • Confirm server accessibility
    • Check firewall settings
  3. Permission Error

    • Verify Zabbix user permissions
    • Confirm OAuth scopes
    • Check access policies

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Support

For support:

License

This project is licensed under the MIT License - see the LICENSE file for details.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers