Skip to content

Asterisk

Auto-Detection
Exporter Metrics

Glouton automatically detects Asterisk when it is running on the monitored host.

Detailed Asterisk metrics are available through the third-party gonicus/asterisk-prometheus-exporter.

  • Asterisk PBX installed and running
  • Glouton agent installed on the same host
  • Go toolchain (if building from source) or access to GitHub releases

Enable the Asterisk Manager Interface (AMI) in /etc/asterisk/manager.conf:

[general]
enabled = yes
port = 5038
bindaddr = 127.0.0.1
[glouton]
secret = monitoring_password
read = system,call

Restart Asterisk to apply the change:

Terminal window
sudo systemctl restart asterisk

Verify the AMI is accessible:

Terminal window
telnet 127.0.0.1 5038

Download the latest release from the asterisk-prometheus-exporter releases page, or install with Go:

Terminal window
go install github.com/gonicus/asterisk-prometheus-exporter@latest

Start the exporter:

Terminal window
asterisk-exporter --ami.address=127.0.0.1:5038 --ami.username=glouton --ami.password=monitoring_password

The exporter listens on port 9461 by default. Verify it is working:

Terminal window
curl http://localhost:9461/metrics

For production use, create a systemd service unit to manage the exporter process.

Terminal window
sudo tee /etc/glouton/conf.d/99-asterisk.conf > /dev/null << 'EOF'
metric:
prometheus:
targets:
- url: "http://localhost:9461/metrics"
name: "asterisk"
allow_metrics:
- "asterisk_calls_active"
- "asterisk_calls_processed_total"
- "asterisk_channels_active"
- "asterisk_peers_online"
- "asterisk_uptime_seconds"
EOF
Metric Description
asterisk_calls_active Number of currently active calls
asterisk_calls_processed_total Total number of calls processed since startup
asterisk_channels_active Number of currently active channels
asterisk_peers_online Number of peers currently online
asterisk_uptime_seconds Asterisk server uptime in seconds