AI-powered problem analysis for Zabbix 7.0+ with support for multiple AI backends (Claude, OpenAI, Custom).
- π€ AI-Powered Analysis: Get intelligent insights on Zabbix problems
- π Multiple AI Backends: Support for Claude, OpenAI, and custom AI APIs
- π― Context-Aware: Analyzes events with full context (history, related events, host info)
- π‘ Actionable Insights: Root cause analysis, troubleshooting steps, and prevention tips
- β‘ On-Demand: Analysis generated when you need it
- π Secure: Uses user's own Zabbix permissions
Create the following directory structure in your Zabbix frontend:
ui/modules/ai-problem-analysis/
βββ manifest.json
βββ Module.php
βββ actions/
β βββ Popup.php
β βββ Analyze.php
βββ Services/
β βββ AIAnalyzer.php
β βββ Backends/
β βββ AIBackendInterface.php
β βββ ClaudeBackend.php
β βββ OpenAIBackend.php
β βββ CustomBackend.php
βββ views/
β βββ popup.php
βββ assets/
β βββ js/
β β βββ ai-analysis.js
β βββ css/
β βββ ai-analysis.css
βββ README.md
Copy all the provided files to their respective locations in the module directory.
chown -R www-data:www-data ui/modules/ai-problem-analysis
chmod -R 755 ui/modules/ai-problem-analysis- Log in to Zabbix as an administrator
- Go to Administration β General β Modules
- Click Scan directory
- Find "AI Problem Analysis" and click Enable
- Configure your AI backend settings (see Configuration section)
Edit your Zabbix frontend configuration to include the module's JavaScript and CSS:
Option A: Via Module Hook (Recommended)
Add to Module.php in the init() method:
public function init(): void {
// Add CSS
APP::Component()->get('page.assets')
->addCssFile('modules/ai-problem-analysis/assets/css/ai-analysis.css');
// Add JavaScript
APP::Component()->get('page.assets')
->addJavaScriptFile('modules/ai-problem-analysis/assets/js/ai-analysis.js');
}Option B: Manual Include
Add to include/page_footer.php or your theme's footer:
echo '<link rel="stylesheet" href="modules/ai-problem-analysis/assets/css/ai-analysis.css">';
echo '<script src="modules/ai-problem-analysis/assets/js/ai-analysis.js"></script>';- Get API key from https://console.anthropic.com/
- In module settings, set:
ai_backend:claudeanthropic_api_key: Your API keyclaude_model:claude-sonnet-4-20250514(or other model)
- Get API key from https://platform.openai.com/
- In module settings, set:
ai_backend:openaiopenai_api_key: Your API keyopenai_model:gpt-4orgpt-4-turbo
For local LLMs (Ollama, LM Studio, etc.) or other APIs:
- In module settings, set:
ai_backend:customcustom_api_url: Your API endpointcustom_api_key: Your API key (if required)
Example for Ollama:
{
"ai_backend": "custom",
"custom_api_url": "http://localhost:11434/api/generate",
"custom_api_key": ""
}| Option | Description | Default |
|---|---|---|
ai_backend |
AI backend to use (claude, openai, custom) |
claude |
anthropic_api_key |
Claude API key | `` |
claude_model |
Claude model name | claude-sonnet-4-20250514 |
openai_api_key |
OpenAI API key | `` |
openai_model |
OpenAI model name | gpt-4 |
custom_api_url |
Custom API endpoint | `` |
custom_api_key |
Custom API key | `` |
analysis_timeout |
API request timeout (seconds) | 30 |
include_history_hours |
Hours of history to include | 24 |
cache_duration |
Cache duration (seconds) | 300 |
- Go to Monitoring β Problems
- Click the π€ (robot) button next to any problem
- Wait for AI analysis (usually 5-15 seconds)
- Review the analysis with:
- Root cause analysis
- Immediate actions to take
- Step-by-step resolution
- Prevention measures
- Severity assessment
- Check file permissions
- Verify directory structure matches exactly
- Check Zabbix frontend logs:
/var/log/zabbix/zabbix_server.log - Ensure PHP version >= 7.4
- Clear browser cache
- Check JavaScript console for errors
- Verify
ai-analysis.jsis loaded - Check that you're on the Problems page
- Claude: Verify API key at https://console.anthropic.com/
- OpenAI: Check API key and billing at https://platform.openai.com/
- Custom: Test API endpoint with curl:
curl -X POST http://localhost:11434/api/generate \ -H "Content-Type: application/json" \ -d '{"prompt": "test"}'
- Check PHP error logs:
/var/log/php/error.log - Enable debug mode in Zabbix
- Verify API keys are correct
- Check network connectivity to AI APIs
- Review
analysis_timeoutsetting
- Create new class in
Services/Backends/YourBackend.php - Implement
AIBackendInterface - Add to
AIAnalyzerconstructor:$this->backends['yourbackend'] = new Backends\YourBackend($config);
- Add configuration options to
manifest.json
Edit buildPrompt() method in Services/AIAnalyzer.php to customize what information is sent to the AI.
Modify assets/css/ai-analysis.css to match your Zabbix theme.
- API keys are stored in module configuration (ensure proper file permissions)
- All API requests use HTTPS
- User permissions are checked before displaying analysis
- No sensitive data is logged (except in debug mode)
- Consider using environment variables for API keys in production
- Analysis is on-demand (not pre-cached)
- Average response time: 5-15 seconds
- Backend fallback ensures availability
- Adjust
analysis_timeoutbased on your needs
Be aware of API costs when using cloud AI services:
- Claude: ~$0.003-0.015 per analysis
- OpenAI GPT-4: ~$0.01-0.03 per analysis
- Custom/Local: Free (requires own infrastructure)
Contributions welcome! Please submit issues and pull requests to the GitHub repository.
[Your chosen license]
For issues and questions:
- GitHub Issues: [your-repo-url]
- Zabbix Forum: [forum-thread]
- Email: [your-email]
- Initial release
- Support for Claude, OpenAI, and custom backends
- Comprehensive event analysis
- Modal popup interface