This project provides a monitoring ecosystem for ISPConfig using Zabbix 7.4. It includes scripts for autodiscovery and reading individual keys, along with templates for each module, starting with the websites module.
ispconfig-zabbix-monitoring ├── src │ ├── autodiscovery │ │ ├── websites.php │ │ ├── emails.php │ │ └── mail_domains.php │ ├── keys │ │ ├── websites.php │ │ ├── emails.php │ │ └── mail_domains.php │ └── lib │ ├── ISPConfigClient.php │ └── ZabbixHelper.php ├── templates │ ├── websites │ │ └── template_ispconfig_websites.yaml │ └── email │ ├── template_ispconfig_mail_accounts.yaml │ └── template_ispconfig_mail_domains.yaml ├── config │ ├── config.example.php │ └── config.php ├── scripts │ └── install.sh ├── composer.json ├── README.md ├── PROJECT_PLAN.md └── LICENSE The ISPConfig remote user used for monitoring must have the following permissions enabled:
For Websites Module:
- Sites functions →
sites_web_domain_get
For Email Modules:
- Mail User functions →
mail_user_get - Mail Domain functions →
mail_domain_get
To configure permissions in ISPConfig:
- Go to System → Remote Users
- Edit or create a remote user
- Enable the required function checkboxes in the Functions section
- Save the user
Note: Without these permissions, the monitoring scripts will fail with "You do not have the permissions to access this function" errors.
The repository with packages for Debian & Ubuntu is available:
sudo apt install lsb-release wget apt-transport-https wget -qO- https://repo.vitexsoftware.com/keyring.gpg | sudo tee /etc/apt/trusted.gpg.d/vitexsoftware.gpg echo "deb [signed-by=/etc/apt/trusted.gpg.d/vitexsoftware.gpg] https://repo.vitexsoftware.com $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list sudo apt update sudo apt install ispconfig-zabbix-monitoringDuring installation, you'll be prompted for:
- ISPConfig Remote API URL
- ISPConfig API username
- ISPConfig API password
The configuration will be saved to /etc/ispconfig-zabbix-monitoring/config.php.
To reconfigure after installation:
sudo dpkg-reconfigure ispconfig-zabbix-monitoring-
Clone the repository:
git clone https://github.com/Spoje-NET/ispconfig-zabbix-monitoring.git cd ispconfig-zabbix-monitoring -
Install dependencies using Composer:
composer install
-
Configure the project by copying the example configuration file:
cp config/config.example.php config/config.php
Edit
config/config.phpto add your ISPConfig API credentials. -
Copy the Zabbix agent configuration:
sudo cp config/zabbix_agentd.d/ispconfig-monitoring.conf /etc/zabbix/zabbix_agentd.d/ sudo systemctl restart zabbix-agent
The src/autodiscovery/websites.php script automatically discovers websites in ISPConfig and formats the data for Zabbix.
The src/keys/websites.php script retrieves metrics for individual websites:
php src/keys/websites.php <website_id> <key>Available keys: active, domain, server_id, document_root, php_version, ssl_enabled, traffic, disk_usage, hd_quota
The src/autodiscovery/emails.php script discovers all email accounts in ISPConfig.
The src/keys/emails.php script retrieves metrics for individual email accounts:
php src/keys/emails.php <email_id> <key>Available keys: active, email, domain, quota, used, usage_percent, spamfilter_enabled, antivirus_enabled, mail_domain_id, server_id, homedir
The src/autodiscovery/mail_domains.php script discovers all mail domains in ISPConfig.
The src/keys/mail_domains.php script retrieves metrics for mail domains:
php src/keys/mail_domains.php <domain_id> <key>Available keys: active, domain, server_id, mail_catchall, account_count, total_quota, total_used
Import the following templates into Zabbix:
templates/websites/template_ispconfig_websites.yaml- Websites monitoringtemplates/email/template_ispconfig_mail_accounts.yaml- Email accounts monitoringtemplates/email/template_ispconfig_mail_domains.yaml- Mail domains monitoring
After installation, the Zabbix agent configuration is automatically installed to:
/etc/zabbix/zabbix_agentd.d/ispconfig-monitoring.conf(Zabbix Agent 1)/etc/zabbix/zabbix_agent2.d/ispconfig-monitoring.conf(Zabbix Agent 2)
The following UserParameters are available:
ispconfig.websites.discovery- Website autodiscoveryispconfig.website[*]- Website metricsispconfig.emails.discovery- Email account autodiscoveryispconfig.email[*]- Email account metricsispconfig.maildomains.discovery- Mail domain autodiscoveryispconfig.maildomain[*]- Mail domain metrics
The project includes a comprehensive test suite:
composer install vendor/bin/phpunit42 tests with 82 assertions covering:
- ISPConfigClient configuration validation and error handling
- ZabbixHelper data formatting and discovery
- Value conversion (numeric, boolean, bytes, timestamps)
- LLD data validation
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new features
- Submit a pull request
Follow the existing code style and ensure all tests pass before submitting.