Module for integrating Zabbix Agent with MikoPBX. Collects and sends PBX metrics to a Zabbix server for monitoring.
- Zabbix Agent 6.0 LTS (v6.0.44), statically linked (no external dependencies)
- Supports x86_64 and ARM64 (aarch64) architectures
- Web interface for editing
zabbix_agentd.conf - Real-time service status display (running state, PID, version, port, server)
- Download Zabbix template button for easy import into Zabbix server
- REST API v3 with auto-discovery (PHP 8 attributes, Processor + Actions pattern)
- Automatic service management (start/stop/restart)
- Firewall rule for Zabbix port (default 10050)
- Cron-based health check every 5 minutes
- Open the MikoPBX web interface.
- Navigate to Modules > Marketplace.
- Find ModuleZabbixAgent5 in the list and click Install.
- Once installed, enable the module on the Modules > Installed page.
- Download the latest
.ziprelease from the Releases page. - In the MikoPBX web interface, go to Modules > Installed.
- Click Upload module and select the downloaded
.zipfile. - Enable the module after installation.
After enabling the module, open its settings page in MikoPBX to edit the Zabbix agent configuration.
Set the following directives in zabbix_agentd.conf via the built-in editor:
Server-- comma-separated list of Zabbix server/proxy IP addresses allowed to query the agent (passive checks).ServerActive-- Zabbix server/proxy address for active checks (the agent initiates the connection). Format:<address>:<port>.
Example:
Server=192.168.1.100
ServerActive=192.168.1.100:10051
Hostname=mikopbx-office
- In the module settings page, click Download Zabbix Template to save the YAML file.
Alternatively, download it via the REST API:
GET /pbxcore/api/v3/module-zabbix-agent5/status:downloadTemplate. - Open your Zabbix server web interface.
- Navigate to Data collection > Templates (Zabbix 6.0+) or Configuration > Templates (older versions).
- Click Import and upload the downloaded
zbx_export_templates.yamlfile. - Assign the imported template to the host representing your MikoPBX instance.
All metrics are accessed via asterisk[<function>] UserParameter key.
| Metric | Zabbix item key |
|---|---|
| Active calls (Asterisk CLI) | asterisk[callsActive] |
| Processed calls | asterisk[callsProcessed] |
| Active channels | asterisk[channelsActive] |
| Incoming calls (via API) | asterisk[countInCalls] |
| Outgoing calls (via API) | asterisk[countOutCalls] |
| Internal calls (via API) | asterisk[countInnerCalls] |
| SIP peers (total) | asterisk[countSipPeers] |
| SIP peers (online) | asterisk[CountActivePeers] |
| SIP trunks (online) | asterisk[CountActiveProviders] |
| SIP trunks (offline) | asterisk[CountNonActiveProviders] |
| Asterisk uptime | asterisk[statusUptime] |
| Last reload time | asterisk[statusReload] |
| Asterisk version | asterisk[version] |
| Asterisk status (1/0) | asterisk[status] |
| Metric | Zabbix item key |
|---|---|
| Trunk registration status | asterisk[trunkStatus,{#TRUNKID}] |
| Incoming calls per hour | asterisk[trunkCalls,{#TRUNKID},hour,incoming,totalCalls] |
| Outgoing calls per hour | asterisk[trunkCalls,{#TRUNKID},hour,outgoing,totalCalls] |
| Incoming calls per day | asterisk[trunkCalls,{#TRUNKID},day,incoming,totalCalls] |
| Outgoing calls per day | asterisk[trunkCalls,{#TRUNKID},day,outgoing,totalCalls] |
| Answered incoming per hour | asterisk[trunkCalls,{#TRUNKID},hour,incoming,answeredCalls] |
| Answered outgoing per hour | asterisk[trunkCalls,{#TRUNKID},hour,outgoing,answeredCalls] |
| Metric | Zabbix item key |
|---|---|
| Total size | vfs.fs.size[/storage,total] |
| Used space | vfs.fs.size[/storage,used] |
| Free space | vfs.fs.size[/storage,free] |
| Free space (%) | vfs.fs.size[/storage,pfree] |
REST API v3 endpoints (auto-discovered via PHP 8 attributes):
| Method | Endpoint | Description |
|---|---|---|
| GET | /pbxcore/api/v3/module-zabbix-agent5/status:getStatus |
Service status (running, pid, version, port, server) |
| GET | /pbxcore/api/v3/module-zabbix-agent5/status:downloadTemplate |
Download Zabbix template YAML |
Included template (bin/zbx_export_templates.yaml) provides:
- All Asterisk metric items
- SIP trunk LLD with per-trunk status and call statistics
- Storage disk monitoring items with triggers (WARNING <10%, HIGH <5%)
- Graphs: Calls overview, SIP endpoints, Trunk calls per hour, Storage usage
- Triggers: Asterisk not running, non-active trunks, no SIP peers, no data from agent
Binaries are built automatically in GitHub Actions:
- AMD64: native Alpine Linux build with musl (static linking)
- ARM64: cross-compile on AMD64 using
aarch64-linux-gnu-gcc
Both produce fully statically linked binaries with OpenSSL support.
- MikoPBX 2025.1.1+
- PHP 8.4
- Zabbix Server 5.0+ (template compatible with 5.0, 6.0, 7.0)
- Issues: GitHub Issues
- Wiki: GitHub Wiki
- Email: help@miko.ru
- Telegram: @mikaboris
GPL-3.0-or-later