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.

Tutorial – Asterisk SNMP Installation

On the Asterisk server, use the following commands to install the SNMP service.

Copy to Clipboard

Find the location of the snmpd.conf file on your system.

Before we begin, create a backup of the original SNMP configuration file.

Copy to Clipboard

Next, you need to edit the snmpd.conf file.

Copy to Clipboard

Here is the original file, before our configuration and without the comments.

Copy to Clipboard

Here is the new file with our configuration.

Copy to Clipboard

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.

Copy to Clipboard

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.

Copy to Clipboard

Add the following lines to the end of the res_snmp.conf file.

Copy to Clipboard

Restart the Asterisk service.

Copy to Clipboard

Connect to the Asterisk console and verify if the Asterisk SNMP module was loaded.

Copy to Clipboard

In our example, we can see the Asterisk SNMP module was loaded.

Copy to Clipboard

To test your Asterisk SNMP configuration, use the following command.

Copy to Clipboard

Keep in mind that we used an SNMP community named GokuBlack just as an example.

You should see a SNMP output:

Copy to Clipboard

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

Copy to Clipboard

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.

Copy to Clipboard

Access the SNMP mib repository directory and create a file named DIGIUM-MIB.txt

Copy to Clipboard

Access this Asterisk website and copy the text content of the page to inside the DIGIUM-ASTERISK.txt file.

Here is the file content.

Copy to Clipboard

Edit the SNMP configuration file named snmp.conf.

Copy to Clipboard

Here is the original file, before our configuration.

Copy to Clipboard

Here is the new file with our configuration.

Copy to Clipboard

Restart the SNMP service.

Copy to Clipboard

Restart the Asterisk service.

Copy to Clipboard

Perform another SNMP communication test to see if the OID translation to MIB is working.

Copy to Clipboard

You should see a SNMP output using words instead of numbers.

Copy to Clipboard

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

zabbix login

After a successful login, you will be sent to the Zabbix Dashboard.

zabbix dashboard

On the dashboard screen, access the Configuration menu and select the Host option.

zabbix add host

On the top right of the screen, click on the Create host button.

Zabbix Create Host

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.

zabbix linux - Antes

Here is the new image with our configuration.

zabbix monitor linux host

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.

Zabbix SNMP Macro Linux

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.

zabbix add host

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.

Zabbix Windows Service Application menu

On the top right part of the screen, click on the Create application button.

Zabbix Linux Service Application

On the Host applications screen, create a new application named: Asterisk.

zabbix monitor asterisk aplication

After finishing the Application creation, access the Items tab.

Zabbix Item 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

Zabbix monitor Asterisk version

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

Zabbix monitor Asterisk Uptime

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

Zabix monitor calls active

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

zabbix asterisk calls processed

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.

Zabbix Latest data

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

Zabbix Linux service Filter

You should be able to see the results of your Asterisk monitoring using Zabbix.

Zabbix monitor asterisk

Congratulations! You have configured Zabbix to monitor an Asterisk server.