Monitoring for Asterisk by ZABBIX using AMI

How to monitor Asterisk

There are three main ways to monitor Asterisk.
Choose the method that suits your environment.

CLI (Command Line Interface)

Execute Asterisk CLI commands from zabbix-agent for monitoring.
Format the return value with grep or awk to make it into a form of data that can be imported into ZABBIX.

sudo asterisk -rx “core show calls” | grep active | awk ‘{ print $1 }’

SNMP (Simple Network Management Protocol)

SNMP (Simple Network Management Protocol) is used.
You need to have Net-SNMP installed and Asterisk ready to use SNMP.

snmpwalk -v2c -c public .
. = INTEGER: 2
. = INTEGER: 2
. = INTEGER: 1
. = INTEGER: 1
. = INTEGER: 1

AMI (Asterisk Manager Interface)

Originally, telnet 5038 is used, but Asterisk has a built-in HTTP/HTTPS server, so it is possible to use AMI via HTTP/HTTPS.

telnet 5038
Connected to
Escape character is ‘^]’.
Asterisk Call Manager/2.7.0
Action: Login
Username: zabbix
Secret: password
Response: Success
Message: Authentication accepted

Use AMI over HTTP(S)

The official site has a page for monitoring Asterisk using AMI over HTTP(S).
There is also a list of available data.


You should enable the mini-HTTP Server, add the option webenabled=yes in the general section of the manager.conf file and create Asterisk Manager user with system and command write permissions within your Asterisk instance.

Create an AMI user with webenabled=yes in the general section of manager.conf with system privileges and write privileges.

Create an AMI user

vi /etc/asterisk/manager.conf
enabled = yes
webenabled = yes
port = 5038
bindaddr =
displayconnects = yes
secret = password
sudo asterisk -rx “core reload”

Official:sample of manager.conf

Setting for HTTP

vi /etc/asterisk/http.conf
tlsenable=yes          ; enable tls -- default no.

Default is HTTP. You can also support HTTPS if you set http.conf as above.
An example of using 8088 for HTTP and 10089 for HTTPS.

Official:sample of http.conf

Setting for Firewall

Allow communication from ZABBIX server on TCP5038 (AMI) TCP8088 (HTTP).
When using HTTPS, open TCP10089 in the above example.

Check using AMI from browser via HTTP


画像に alt 属性が指定されていません。ファイル名: amiping.png

Check for response:

Saving cookies is required for testing with curl from the Linux terminal.

Import template to ZABBIX server

Download template_tel_asterisk_http.yaml and import it to ZABBIX server.

Assign templates to hosts and set macros

Assign templates to monitored hosts.
Change the macro.

  • {$AMI.SECRET} set password
  • {$AMI.URL} http(s)://<IP or FQDN>:8088/rawman

The template default AMI.URL is http://asterisk:8088/asterisk/rawman, but this is the case when prefix=asterisk is set in http.conf, so specify :8088/rawman.

Check data

How to monitoring

ZABBIX official Asterisk by HTTP template obtains call volume information such as active calls via AMI via HTTP(S).

The original AMI of TCP5038 is used for Asterisk’s life and death monitoring and response speed monitoring.
Since we are only checking whether there is a TCP connection response without authentication, an authentication error will be output to the log on the Asterisk side, but there is no problem.

tail -f /var/log/asterisk/full
[Jun 19 13:24:32] VERBOSE[16644] manager.c: Connect attempt from ‘’ unable to authenticate
[Jun 19 13:24:33] VERBOSE[16645] manager.c: Connect attempt from ‘’ unable to authenticate

TwitterFacebookLinkedInHatenaPocketCopy Link