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.
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
- Node.js 18 or higher
- Cloudflare account
- Zabbix instance with API enabled
- Zabbix API access with appropriate permissions
# 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# Install Wrangler CLI
npm install -g wrangler
# Login to Cloudflare
wrangler login
# Configure the project
wrangler config- Enable the Zabbix API on your server
- Create a dedicated API user with appropriate permissions
- Configure credentials in the
.envfile:
ZABBIX_URL=https://your-zabbix.com
ZABBIX_USER=api_user
ZABBIX_PASSWORD=api_password# Start the server in development mode
npm run dev
# Server will be available at http://localhost:8787# Deploy to Cloudflare
wrangler deployScope: 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
}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
}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
}Scope: Resource analysis and optimization
- Collects usage metrics
- Identifies bottlenecks
- Generates recommendations
- Monitors trends
Parameters:
{
"resourceType": "memory", // Resource type
"timeRange": "now-24h" // Analysis period
}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
}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
}// Example of handleHighCPUUsage
{
"threshold": 85,
"duration": 600
}// Example of scheduleSmartMaintenance
{
"hostGroup": "production-servers",
"preferredTime": "2024-03-26T02:00:00Z",
"maxDuration": 3600
}// Example of optimizeResources
{
"resourceType": "memory",
"timeRange": "now-24h"
}// Example of securityAudit
{
"scope": "critical",
"checks": ["access_control", "firewall_rules"]
}// Example of monitorDeployment
{
"application": "web-app",
"version": "1.2.3",
"metrics": ["response_time", "error_rate", "cpu_usage"]
}- 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
-
Authentication Error
- Verify Zabbix credentials
- Confirm API is enabled
- Check user permissions
-
Connection Error
- Verify Zabbix URL
- Confirm server accessibility
- Check firewall settings
-
Permission Error
- Verify Zabbix user permissions
- Confirm OAuth scopes
- Check access policies
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For support:
- Open an issue on GitHub
- Contact via email: [email protected]
- Check complete documentation at: docs.example.com
This project is licensed under the MIT License - see the LICENSE file for details.