Would you like to learn how to use Zabbix to monitor an Asterisk server?In this tutorial, we are going to show you how to configure Zabbix to monitor the Asterisk VoIP server installed on a computer running Ubuntu linux.
• Zabbix 4.2.6
• Zabbix 4.4.0
• Ubuntu 18.04
• Ubuntu 19.04
• Asterisk 16.5.1
• Asterisk 16.6.0
If you need, here is an Asterisk installation guide.
Hardware List:
The following section presents the list of equipment used to create this Zabbix tutorial.
Every piece of hardware listed above can be found at Amazon website.
Zabbix Playlist:
On this page, we offer quick access to a list of videos related to Zabbix installation.
Don’t forget to subscribe to our youtube channel named FKIT.
Zabbix Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Zabbix installation.
Tutorial – Asterisk SNMP Installation
On the Asterisk server, use the following commands to install the SNMP service.
Find the location of the snmpd.conf file on your system.
Before we begin, create a backup of the original SNMP configuration file.
Next, you need to edit the snmpd.conf file.
Here is the original file, before our configuration and without the comments.
Here is the new file with our configuration.
The GokuBlack Community has read-only permission on the Linux server.
The contact person responsible for this Linux was configured as Zamasu.
The location of the equipment was configured as the IT Room of Universe 10.
You should also restart SNMP manually and verify the service status.
You have finished the Asterisk SNMP required configuration on Linux.
Tutorial – Asterisk SNMP Configuration
Edit the Asterisk res_snmp.conf configuration file to enable the SNMP integration.
Add the following lines to the end of the res_snmp.conf file.
Restart the Asterisk service.
Connect to the Asterisk console and verify if the Asterisk SNMP module was loaded.
In our example, we can see the Asterisk SNMP module was loaded.
To test your Asterisk SNMP configuration, use the following command.
Keep in mind that we used an SNMP community named GokuBlack just as an example.
You should see a SNMP output:
You have successfully configured the Asterisk SNMP feature.
Tutorial – Asterisk MIB Installation
Access the SNMP mib repository directory and create a file named ASTERISK-MIB.txt
Access this Asterisk website and copy the text content of the page to inside the MIB-ASTERISK.txt file.
Here is an example of the beginning of this file.
Access the SNMP mib repository directory and create a file named DIGIUM-MIB.txt
Access this Asterisk website and copy the text content of the page to inside the DIGIUM-ASTERISK.txt file.
Here is the file content.
Edit the SNMP configuration file named snmp.conf.
Here is the original file, before our configuration.
Here is the new file with our configuration.
Restart the SNMP service.
Restart the Asterisk service.
Perform another SNMP communication test to see if the OID translation to MIB is working.
You should see a SNMP output using words instead of numbers.
Congratulations, you have installed the Asterisk MIB successfully.
Zabbix – How to Monitor the Asterisk VoIP Server
Now, we need to access the Zabbix server dashboard and add the Asterisk Linux computer as a Host.
Open your browser and enter the IP address of your web server plus /zabbix.
In our example, the following URL was entered in the Browser:
• http://192.168.15.100/zabbix
On the login screen, use the default username and default password.
• Default Username: Admin
• Default Password: zabbix
After a successful login, you will be sent to the Zabbix Dashboard.
On the dashboard screen, access the Configuration menu and select the Host option.
On the top right of the screen, click on the Create host button.
On the Host configuration screen, you will have to enter the following information:
• Host Name – Enter a Hostname to identify the Asterisk server.
• Visible Hostname – Repeat the hostname.
• New group – Enter a name to identify a group of similar devices.
• Agent Interface – Click on the Remove option.
• SNMP Interface – Enter the IP address of the Asterisk server.
Here is the original image, before our configuration.
Here is the new image with our configuration.
Next, we need to configure the SNMP community that Zabbix will use to connect on the Zabbix server.
Access the Macros tab on the top of the screen.
Create a macro named: {$SNMP_COMMUNITY}
The {$SNMP_COMMUNITY} macro value should be the Linux Computer SNMP community.
Click on the Add button to include this host on the Zabbix database.
On the dashboard screen, access the Configuration menu and select the Host option.
Locate and click on the hostname that you created before.
In our example, we selected the hostname: LINUX-SERVER-01
On the Host properties screen, access the Applications tab.
On the top right part of the screen, click on the Create application button.
On the Host applications screen, create a new application named: Asterisk.
After finishing the Application creation, access the Items tab.
On the top right part of the screen, click on the Create item button.
On the Item creation screen, you need to configure the following items:
Example 01 – SNMP item to monitor Asterisk Version:
• Name: Asterisk Version
• Type: SNMPv2 Agent
• Key: asterisk.version
• OID: 1.3.6.1.4.1.22736.1.1.1.0
• SNMP Community: {$SNMP_COMMUNITY}
• Type of Information: Text
• Update interval: 1m
• Application: Asterisk
Example 02 – SNMP item to monitor Asterisk Uptime:
• Name: Asterisk Uptime
• Type: SNMPv2 Agent
• Key: asterisk.uptime
• OID: 1.3.6.1.4.1.22736.1.2.1.0
• SNMP Community: {$SNMP_COMMUNITY}
• Type of Information: Numeric(Unsigned)
• Units: uptime
• Update interval: 30s
• Application: Asterisk
Example 03 – SNMP item to monitor Asterisk Calls Active:
• Name: Asterisk Calls Active
• Type: SNMPv2 Agent
• Key: asterisk.calls.active
• OID: 1.3.6.1.4.1.22736.1.2.5.0
• SNMP Community: {$SNMP_COMMUNITY}
• Type of Information: Numeric(Unsigned)
• Update interval: 1m
• Application: Asterisk
Example 04 – SNMP item to monitor Asterisk Calls Processed:
• Name: Asterisk Calls Processed
• Type: SNMPv2 Agent
• Key: asterisk.calls.processed
• OID: 1.3.6.1.4.1.22736.1.2.6.0
• SNMP Community: {$SNMP_COMMUNITY}
• Type of Information: Numeric(Unsigned)
• Update interval: 1m
• Application: Asterisk
Click on the Add button to finish the Item creation and wait 5 minutes.
In order to test your configuration, access the Monitoring menu and click on the Latest data option.
Use the filter configuration to select the desired hostname and click on the Apply button.
In our example, we selected the hostname LINUX-SERVER-01
You should be able to see the results of your Asterisk monitoring using Zabbix.
Congratulations! You have configured Zabbix to monitor an Asterisk server.