Asterisk
Auto-Detection
Exporter Metrics
Auto-Detection
Section titled “Auto-Detection”Glouton automatically detects Asterisk when it is running on the monitored host.
Exporter Metrics
Section titled “Exporter Metrics”Detailed Asterisk metrics are available through the third-party gonicus/asterisk-prometheus-exporter.
Prerequisites
Section titled “Prerequisites”- Asterisk PBX installed and running
- Glouton agent installed on the same host
- Go toolchain (if building from source) or access to GitHub releases
Service Configuration
Section titled “Service Configuration”Enable the Asterisk Manager Interface (AMI) in /etc/asterisk/manager.conf:
[general]enabled = yesport = 5038bindaddr = 127.0.0.1
[glouton]secret = monitoring_passwordread = system,callRestart Asterisk to apply the change:
sudo systemctl restart asteriskVerify the AMI is accessible:
telnet 127.0.0.1 5038Installing the Exporter
Section titled “Installing the Exporter”Download the latest release from the asterisk-prometheus-exporter releases page, or install with Go:
go install github.com/gonicus/asterisk-prometheus-exporter@latestStart the exporter:
asterisk-exporter --ami.address=127.0.0.1:5038 --ami.username=glouton --ami.password=monitoring_passwordThe exporter listens on port 9461 by default. Verify it is working:
curl http://localhost:9461/metricsFor production use, create a systemd service unit to manage the exporter process.
Glouton Configuration
Section titled “Glouton Configuration”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"EOFCreate or edit C:\ProgramData\glouton\conf.d\99-asterisk.conf:
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"| 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 |