VOOZH about

URL: https://www.zabbix.com/integrations/asterisk

⇱ Asterisk monitoring and integration with Zabbix


Propose integration

Asterisk

Asterisk is a software implementation of a telephone private branch exchange (PBX). It allows telephones interfaced with a variety of hardware technologies to make calls to one another, and to connect to telephony services, such as the public switched telephone network (PSTN) and voice over Internet Protocol (VoIP) services.

Available solutions




This template is for Zabbix version: 7.4

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/tel/asterisk_http?at=release/7.4

Asterisk by HTTP

Overview

The template for monitoring Asterisk over HTTP that works without any external scripts. It collects metrics by polling the Asterisk Manager API remotely using an HTTP agent and JS preprocessing. All metrics are collected at once, thanks to Zabbix's bulk data collection.

Requirements

Zabbix version: 7.4 and higher.

Tested versions

This template has been tested on:

  • Asterisk, version 13 and later

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

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. Disable the PJSIP driver if you do not use PJSIP or do not have PJSIP endpoints. Please, define AMI address in the {$AMI.URL} macro. Also, set the hostname or IP address of the AMI host in the {$AMI.HOST} macro for Zabbix to check Asterisk service status. Then you can define {$AMI.USERNAME} and {$AMI.SECRET} macros in the template for using on the host level. If there are errors, increase the logging to debug level and see the Zabbix server log.

Macros used

Name Description Default
{$AMI.URL}

The Asterisk Manager API URL in the format <scheme>://<host>:<port>/<prefix>/rawman.

http://asterisk:8088/asterisk/rawman
{$AMI.HOST}

The hostname or IP address of the Asterisk Manager API host.

<SET AMI HOST>
{$AMI.PORT}

AMI port number for checking service availability.

5038
{$AMI.USERNAME}

The Asterisk Manager name.

zabbix
{$AMI.SECRET}

The Asterisk Manager secret.

zabbix
{$AMI.TRUNK_REGEXP}

The regexp for the identification of trunk peers.

trunk
{$AMI.RESPONSE_TIME.MAX.WARN}

The Asterisk Manager API page maximum response time in seconds for trigger expression.

10s
{$AMI.QUEUE_CALLERS.MAX.WARN}

The maximum number of callers in a queue for trigger expression.

10
{$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN}

The maximum number of busy channels of a trunk for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"}

The total maximum number of busy channels of PJSIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"}

The total maximum number of busy channels of SIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"}

The total maximum number of busy channels of IAX trunks for trigger expression.

28

Items

Name Description Type Key and additional info
Service status

Asterisk Manager API port availability.

Simple check net.tcp.service["tcp","{$AMI.HOST}","{$AMI.PORT}"]

Preprocessing

  • Discard unchanged with heartbeat: 10m

Service response time

Asterisk Manager API performance.

Simple check net.tcp.service.perf["tcp","{$AMI.HOST}","{$AMI.PORT}"]
Get stats

Asterisk system information in JSON format.

HTTP agent asterisk.get_stats

Preprocessing

  • JavaScript: The text is too long. Please see the template.

Version

Service version

Dependent item asterisk.version

Preprocessing

  • JSON Path: $.version

Uptime

The system uptime expressed in the following format: "N days, hh:mm:ss".

Dependent item asterisk.uptime

Preprocessing

  • JSON Path: $.uptime

Uptime after reload

System uptime after a config reload in 'N days, hh:mm:ss' format.

Dependent item asterisk.uptime_reload

Preprocessing

  • JSON Path: $.uptime_reload

Active channels

The number of active channels at the moment.

Dependent item asterisk.active_channels

Preprocessing

  • JSON Path: $.active_channels

Active calls

The number of active calls at the moment.

Dependent item asterisk.active_calls

Preprocessing

  • JSON Path: $.active_calls

Calls processed

The number of calls processed after the last service restart.

Dependent item asterisk.calls_processed

Preprocessing

  • JSON Path: $.calls_processed

Calls processed per second

The number of calls processed per second.

Dependent item asterisk.calls_processed.rate

Preprocessing

  • JSON Path: $.calls_processed

  • Change per second
Total queues

The number of configured queues.

Dependent item asterisk.total_queues

Preprocessing

  • JSON Path: $.queue.total

SIP monitored online

The number of monitored online SIP peers.

Dependent item asterisk.sip.monitored_online

Preprocessing

  • JSON Path: $.sip.monitored_online

SIP monitored offline

The number of monitored offline SIP peers.

Dependent item asterisk.sip.monitored_offline

Preprocessing

  • JSON Path: $.sip.monitored_offline

SIP unmonitored online

The number of unmonitored online SIP peers.

Dependent item asterisk.sip.unmonitored_online

Preprocessing

  • JSON Path: $.sip.unmonitored_online

SIP unmonitored offline

The number of unmonitored offline SIP peers.

Dependent item asterisk.sip.unmonitored_offline

Preprocessing

  • JSON Path: $.sip.unmonitored_offline

SIP peers

The total number of SIP peers.

Dependent item asterisk.sip.total

Preprocessing

  • JSON Path: $.sip.total

SIP trunks active channels

The total number of SIP trunks active channels.

Dependent item asterisk.sip.active_channels

Preprocessing

  • JSON Path: $.sip.active_channels

IAX online peers

The number of online IAX peers.

Dependent item asterisk.iax.online

Preprocessing

  • JSON Path: $.iax.online

IAX offline peers

The number of offline IAX peers.

Dependent item asterisk.iax.offline

Preprocessing

  • JSON Path: $.iax.offline

IAX unmonitored peers

The number of unmonitored IAX peers.

Dependent item asterisk.iax.unmonitored

Preprocessing

  • JSON Path: $.iax.unmonitored

IAX peers

The total number of IAX peers.

Dependent item asterisk.iax.total

Preprocessing

  • JSON Path: $.iax.total

IAX trunks active channels

The total number of IAX trunks active channels.

Dependent item asterisk.iax.active_channels

Preprocessing

  • JSON Path: $.iax.active_channels

PJSIP available endpoints

The number of available PJSIP peers.

Dependent item asterisk.pjsip.available

Preprocessing

  • JSON Path: $.pjsip.available

PJSIP unavailable endpoints

The number of unavailable PJSIP peers.

Dependent item asterisk.pjsip.unavailable

Preprocessing

  • JSON Path: $.pjsip.unavailable

PJSIP endpoints

The total number of PJSIP peers.

Dependent item asterisk.pjsip.total

Preprocessing

  • JSON Path: $.pjsip.total

PJSIP trunks active channels

The total number of PJSIP trunks active channels.

Dependent item asterisk.pjsip.active_channels

Preprocessing

  • JSON Path: $.pjsip.active_channels

Triggers

Name Description Expression Severity Dependencies and additional info
Asterisk: Service is down last(/Asterisk by HTTP/net.tcp.service["tcp","{$AMI.HOST}","{$AMI.PORT}"])=0 Average Manual close: Yes
Asterisk: Service response time is too high min(/Asterisk by HTTP/net.tcp.service.perf["tcp","{$AMI.HOST}","{$AMI.PORT}"],5m)>{$AMI.RESPONSE_TIME.MAX.WARN} Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: Version has changed

The Asterisk version has changed. Acknowledge to close the problem manually.

last(/Asterisk by HTTP/asterisk.version,#1)<>last(/Asterisk by HTTP/asterisk.version,#2) and length(last(/Asterisk by HTTP/asterisk.version))>0 Info Manual close: Yes
Asterisk: Service has been restarted

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime)<10m Info Manual close: Yes
Asterisk: Failed to fetch AMI page

Zabbix has not received any data for items for the last 30 minutes.

nodata(/Asterisk by HTTP/asterisk.uptime,30m)=1 Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: Configuration has been reloaded

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime_reload)<10m Info Manual close: Yes
Asterisk: Total number of active channels of SIP trunks is too high

The SIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"} Warning
Asterisk: Total number of active channels of IAX trunks is too high

The IAX trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"} Warning
Asterisk: Total number of active channels of PJSIP trunks is too high

The PJSIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"} Warning

LLD rule SIP peers discovery

Name Description Type Key and additional info
SIP peers discovery Dependent item asterisk.sip_peers.discovery

Preprocessing

  • JSON Path: $.sip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for SIP peers discovery

Name Description Type Key and additional info
SIP trunk "{#OBJECTNAME}": Get SIP trunk

Raw data for a SIP trunk.

Dependent item asterisk.sip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.sip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

SIP trunk "{#OBJECTNAME}": Status

SIP trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.sip.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

SIP trunk "{#OBJECTNAME}": Active channels

The total number of active SIP trunk channels.

Dependent item asterisk.sip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for SIP peers discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: SIP trunk "{#OBJECTNAME}": SIP trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The SIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
Asterisk: SIP trunk "{#OBJECTNAME}": Number of the SIP trunk "{#OBJECTNAME}" active channels is too high

The SIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule IAX peers discovery

Name Description Type Key and additional info
IAX peers discovery Dependent item asterisk.iax_peers.discovery

Preprocessing

  • JSON Path: $.iax.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for IAX peers discovery

Name Description Type Key and additional info
IAX trunk "{#OBJECTNAME}": Get IAX trunk

Raw data for an IAX trunk.

Dependent item asterisk.iax.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.iax.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

IAX trunk "{#OBJECTNAME}": Status

IAX trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.iax.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

IAX trunk "{#OBJECTNAME}": Active channels

The total number of active IAX trunk channels.

Dependent item asterisk.iax.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for IAX peers discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: IAX trunk "{#OBJECTNAME}": IAX trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The IAX trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
Asterisk: IAX trunk "{#OBJECTNAME}": Number of the IAX trunk "{#OBJECTNAME}" active channels is too high

The IAX trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP endpoints discovery Dependent item asterisk.pjsip_endpoints.discovery

Preprocessing

  • JSON Path: $.pjsip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP trunk "{#OBJECTNAME}": Get PJSIP trunk

Raw data for a PJSIP trunk.

Dependent item asterisk.pjsip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.pjsip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

PJSIP trunk "{#OBJECTNAME}": Device state

PJSIP trunk status. Here are the possible states that a device state may have:

Unavailable

Not in use

In use

Dependent item asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.DeviceState

  • Discard unchanged with heartbeat: 1h

PJSIP trunk "{#OBJECTNAME}": Active channels

The total number of active PJSIP trunk channels.

Dependent item asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for PJSIP endpoints discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: PJSIP trunk "{#OBJECTNAME}": PJSIP trunk {#OBJECTNAME} has a state Unavailable

The PJSIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}])="Unavailable" Average
Asterisk: PJSIP trunk "{#OBJECTNAME}": Number of the PJSIP trunk "{#OBJECTNAME}" active channels is too high

The PJSIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule Queues discovery

Name Description Type Key and additional info
Queues discovery Dependent item asterisk.queues.discovery

Preprocessing

  • JSON Path: $.queue.queues

  • Discard unchanged with heartbeat: 1h

Item prototypes for Queues discovery

Name Description Type Key and additional info
"{#QUEUE}": Get queue

Raw data for a queue.

Dependent item asterisk.queue.get[{#QUEUE}]

Preprocessing

  • JSON Path: $.queue.queues[?(@.Queue=='{#QUEUE}')].first()

"{#QUEUE}": Logged in

The number of queue members.

Dependent item asterisk.queue.loggedin[{#QUEUE}]

Preprocessing

  • JSON Path: $.LoggedIn

"{#QUEUE}": Available

The number of available queue members.

Dependent item asterisk.queue.available[{#QUEUE}]

Preprocessing

  • JSON Path: $.Available

"{#QUEUE}": Callers

The number incoming calls in queue.

Dependent item asterisk.queue.callers[{#QUEUE}]

Preprocessing

  • JSON Path: $.Callers

Trigger prototypes for Queues discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: "{#QUEUE}": Number of callers in the queue "{#QUEUE}" is too high

There is a large number of calls in the queue.

min(/Asterisk by HTTP/asterisk.queue.callers[{#QUEUE}],10m)>{$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"} Warning

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template, or ask for help at ZABBIX forums

This template is for Zabbix version: 7.2

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/tel/asterisk_http?at=release/7.2

Asterisk by HTTP

Overview

The template for monitoring Asterisk over HTTP that works without any external scripts. It collects metrics by polling the Asterisk Manager API remotely using an HTTP agent and JS preprocessing. All metrics are collected at once, thanks to Zabbix's bulk data collection.

Requirements

Zabbix version: 7.2 and higher.

Tested versions

This template has been tested on:

  • Asterisk, version 13 and later

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

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. Disable the PJSIP driver if you do not use PJSIP or do not have PJSIP endpoints. Please, define AMI address in the {$AMI.URL} macro. Also, set the hostname or IP address of the AMI host in the {$AMI.HOST} macro for Zabbix to check Asterisk service status. Then you can define {$AMI.USERNAME} and {$AMI.SECRET} macros in the template for using on the host level. If there are errors, increase the logging to debug level and see the Zabbix server log.

Macros used

Name Description Default
{$AMI.URL}

The Asterisk Manager API URL in the format <scheme>://<host>:<port>/<prefix>/rawman.

http://asterisk:8088/asterisk/rawman
{$AMI.HOST}

The hostname or IP address of the Asterisk Manager API host.

<SET AMI HOST>
{$AMI.PORT}

AMI port number for checking service availability.

5038
{$AMI.USERNAME}

The Asterisk Manager name.

zabbix
{$AMI.SECRET}

The Asterisk Manager secret.

zabbix
{$AMI.TRUNK_REGEXP}

The regexp for the identification of trunk peers.

trunk
{$AMI.RESPONSE_TIME.MAX.WARN}

The Asterisk Manager API page maximum response time in seconds for trigger expression.

10s
{$AMI.QUEUE_CALLERS.MAX.WARN}

The maximum number of callers in a queue for trigger expression.

10
{$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN}

The maximum number of busy channels of a trunk for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"}

The total maximum number of busy channels of PJSIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"}

The total maximum number of busy channels of SIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"}

The total maximum number of busy channels of IAX trunks for trigger expression.

28

Items

Name Description Type Key and additional info
Service status

Asterisk Manager API port availability.

Simple check net.tcp.service["tcp","{$AMI.HOST}","{$AMI.PORT}"]

Preprocessing

  • Discard unchanged with heartbeat: 10m

Service response time

Asterisk Manager API performance.

Simple check net.tcp.service.perf["tcp","{$AMI.HOST}","{$AMI.PORT}"]
Get stats

Asterisk system information in JSON format.

HTTP agent asterisk.get_stats

Preprocessing

  • JavaScript: The text is too long. Please see the template.

Version

Service version

Dependent item asterisk.version

Preprocessing

  • JSON Path: $.version

Uptime

The system uptime expressed in the following format: "N days, hh:mm:ss".

Dependent item asterisk.uptime

Preprocessing

  • JSON Path: $.uptime

Uptime after reload

System uptime after a config reload in 'N days, hh:mm:ss' format.

Dependent item asterisk.uptime_reload

Preprocessing

  • JSON Path: $.uptime_reload

Active channels

The number of active channels at the moment.

Dependent item asterisk.active_channels

Preprocessing

  • JSON Path: $.active_channels

Active calls

The number of active calls at the moment.

Dependent item asterisk.active_calls

Preprocessing

  • JSON Path: $.active_calls

Calls processed

The number of calls processed after the last service restart.

Dependent item asterisk.calls_processed

Preprocessing

  • JSON Path: $.calls_processed

Calls processed per second

The number of calls processed per second.

Dependent item asterisk.calls_processed.rate

Preprocessing

  • JSON Path: $.calls_processed

  • Change per second
Total queues

The number of configured queues.

Dependent item asterisk.total_queues

Preprocessing

  • JSON Path: $.queue.total

SIP monitored online

The number of monitored online SIP peers.

Dependent item asterisk.sip.monitored_online

Preprocessing

  • JSON Path: $.sip.monitored_online

SIP monitored offline

The number of monitored offline SIP peers.

Dependent item asterisk.sip.monitored_offline

Preprocessing

  • JSON Path: $.sip.monitored_offline

SIP unmonitored online

The number of unmonitored online SIP peers.

Dependent item asterisk.sip.unmonitored_online

Preprocessing

  • JSON Path: $.sip.unmonitored_online

SIP unmonitored offline

The number of unmonitored offline SIP peers.

Dependent item asterisk.sip.unmonitored_offline

Preprocessing

  • JSON Path: $.sip.unmonitored_offline

SIP peers

The total number of SIP peers.

Dependent item asterisk.sip.total

Preprocessing

  • JSON Path: $.sip.total

SIP trunks active channels

The total number of SIP trunks active channels.

Dependent item asterisk.sip.active_channels

Preprocessing

  • JSON Path: $.sip.active_channels

IAX online peers

The number of online IAX peers.

Dependent item asterisk.iax.online

Preprocessing

  • JSON Path: $.iax.online

IAX offline peers

The number of offline IAX peers.

Dependent item asterisk.iax.offline

Preprocessing

  • JSON Path: $.iax.offline

IAX unmonitored peers

The number of unmonitored IAX peers.

Dependent item asterisk.iax.unmonitored

Preprocessing

  • JSON Path: $.iax.unmonitored

IAX peers

The total number of IAX peers.

Dependent item asterisk.iax.total

Preprocessing

  • JSON Path: $.iax.total

IAX trunks active channels

The total number of IAX trunks active channels.

Dependent item asterisk.iax.active_channels

Preprocessing

  • JSON Path: $.iax.active_channels

PJSIP available endpoints

The number of available PJSIP peers.

Dependent item asterisk.pjsip.available

Preprocessing

  • JSON Path: $.pjsip.available

PJSIP unavailable endpoints

The number of unavailable PJSIP peers.

Dependent item asterisk.pjsip.unavailable

Preprocessing

  • JSON Path: $.pjsip.unavailable

PJSIP endpoints

The total number of PJSIP peers.

Dependent item asterisk.pjsip.total

Preprocessing

  • JSON Path: $.pjsip.total

PJSIP trunks active channels

The total number of PJSIP trunks active channels.

Dependent item asterisk.pjsip.active_channels

Preprocessing

  • JSON Path: $.pjsip.active_channels

Triggers

Name Description Expression Severity Dependencies and additional info
Asterisk: Service is down last(/Asterisk by HTTP/net.tcp.service["tcp","{$AMI.HOST}","{$AMI.PORT}"])=0 Average Manual close: Yes
Asterisk: Service response time is too high min(/Asterisk by HTTP/net.tcp.service.perf["tcp","{$AMI.HOST}","{$AMI.PORT}"],5m)>{$AMI.RESPONSE_TIME.MAX.WARN} Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: Version has changed

The Asterisk version has changed. Acknowledge to close the problem manually.

last(/Asterisk by HTTP/asterisk.version,#1)<>last(/Asterisk by HTTP/asterisk.version,#2) and length(last(/Asterisk by HTTP/asterisk.version))>0 Info Manual close: Yes
Asterisk: Service has been restarted

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime)<10m Info Manual close: Yes
Asterisk: Failed to fetch AMI page

Zabbix has not received any data for items for the last 30 minutes.

nodata(/Asterisk by HTTP/asterisk.uptime,30m)=1 Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: Configuration has been reloaded

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime_reload)<10m Info Manual close: Yes
Asterisk: Total number of active channels of SIP trunks is too high

The SIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"} Warning
Asterisk: Total number of active channels of IAX trunks is too high

The IAX trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"} Warning
Asterisk: Total number of active channels of PJSIP trunks is too high

The PJSIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"} Warning

LLD rule SIP peers discovery

Name Description Type Key and additional info
SIP peers discovery Dependent item asterisk.sip_peers.discovery

Preprocessing

  • JSON Path: $.sip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for SIP peers discovery

Name Description Type Key and additional info
SIP trunk "{#OBJECTNAME}": Get SIP trunk

Raw data for a SIP trunk.

Dependent item asterisk.sip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.sip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

SIP trunk "{#OBJECTNAME}": Status

SIP trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.sip.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

SIP trunk "{#OBJECTNAME}": Active channels

The total number of active SIP trunk channels.

Dependent item asterisk.sip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for SIP peers discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: SIP trunk "{#OBJECTNAME}": SIP trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The SIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
Asterisk: SIP trunk "{#OBJECTNAME}": Number of the SIP trunk "{#OBJECTNAME}" active channels is too high

The SIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule IAX peers discovery

Name Description Type Key and additional info
IAX peers discovery Dependent item asterisk.iax_peers.discovery

Preprocessing

  • JSON Path: $.iax.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for IAX peers discovery

Name Description Type Key and additional info
IAX trunk "{#OBJECTNAME}": Get IAX trunk

Raw data for an IAX trunk.

Dependent item asterisk.iax.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.iax.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

IAX trunk "{#OBJECTNAME}": Status

IAX trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.iax.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

IAX trunk "{#OBJECTNAME}": Active channels

The total number of active IAX trunk channels.

Dependent item asterisk.iax.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for IAX peers discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: IAX trunk "{#OBJECTNAME}": IAX trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The IAX trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
Asterisk: IAX trunk "{#OBJECTNAME}": Number of the IAX trunk "{#OBJECTNAME}" active channels is too high

The IAX trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP endpoints discovery Dependent item asterisk.pjsip_endpoints.discovery

Preprocessing

  • JSON Path: $.pjsip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP trunk "{#OBJECTNAME}": Get PJSIP trunk

Raw data for a PJSIP trunk.

Dependent item asterisk.pjsip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.pjsip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

PJSIP trunk "{#OBJECTNAME}": Device state

PJSIP trunk status. Here are the possible states that a device state may have:

Unavailable

Not in use

In use

Dependent item asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.DeviceState

  • Discard unchanged with heartbeat: 1h

PJSIP trunk "{#OBJECTNAME}": Active channels

The total number of active PJSIP trunk channels.

Dependent item asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for PJSIP endpoints discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: PJSIP trunk "{#OBJECTNAME}": PJSIP trunk {#OBJECTNAME} has a state Unavailable

The PJSIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}])="Unavailable" Average
Asterisk: PJSIP trunk "{#OBJECTNAME}": Number of the PJSIP trunk "{#OBJECTNAME}" active channels is too high

The PJSIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule Queues discovery

Name Description Type Key and additional info
Queues discovery Dependent item asterisk.queues.discovery

Preprocessing

  • JSON Path: $.queue.queues

  • Discard unchanged with heartbeat: 1h

Item prototypes for Queues discovery

Name Description Type Key and additional info
"{#QUEUE}": Get queue

Raw data for a queue.

Dependent item asterisk.queue.get[{#QUEUE}]

Preprocessing

  • JSON Path: $.queue.queues[?(@.Queue=='{#QUEUE}')].first()

"{#QUEUE}": Logged in

The number of queue members.

Dependent item asterisk.queue.loggedin[{#QUEUE}]

Preprocessing

  • JSON Path: $.LoggedIn

"{#QUEUE}": Available

The number of available queue members.

Dependent item asterisk.queue.available[{#QUEUE}]

Preprocessing

  • JSON Path: $.Available

"{#QUEUE}": Callers

The number incoming calls in queue.

Dependent item asterisk.queue.callers[{#QUEUE}]

Preprocessing

  • JSON Path: $.Callers

Trigger prototypes for Queues discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: "{#QUEUE}": Number of callers in the queue "{#QUEUE}" is too high

There is a large number of calls in the queue.

min(/Asterisk by HTTP/asterisk.queue.callers[{#QUEUE}],10m)>{$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"} Warning

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template, or ask for help at ZABBIX forums

This template is for Zabbix version: 7.0

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/tel/asterisk_http?at=release/7.0

Asterisk by HTTP

Overview

The template for monitoring Asterisk over HTTP that works without any external scripts. It collects metrics by polling the Asterisk Manager API remotely using an HTTP agent and JS preprocessing. All metrics are collected at once, thanks to Zabbix's bulk data collection.

Requirements

Zabbix version: 7.0 and higher.

Tested versions

This template has been tested on:

  • Asterisk, version 13 and later

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

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. Disable the PJSIP driver if you do not use PJSIP or do not have PJSIP endpoints. Please, define AMI address in the {$AMI.URL} macro. Also, set the hostname or IP address of the AMI host in the {$AMI.HOST} macro for Zabbix to check Asterisk service status. Then you can define {$AMI.USERNAME} and {$AMI.SECRET} macros in the template for using on the host level. If there are errors, increase the logging to debug level and see the Zabbix server log.

Macros used

Name Description Default
{$AMI.URL}

The Asterisk Manager API URL in the format <scheme>://<host>:<port>/<prefix>/rawman.

http://asterisk:8088/asterisk/rawman
{$AMI.HOST}

The hostname or IP address of the Asterisk Manager API host.

<SET AMI HOST>
{$AMI.PORT}

AMI port number for checking service availability.

5038
{$AMI.USERNAME}

The Asterisk Manager name.

zabbix
{$AMI.SECRET}

The Asterisk Manager secret.

zabbix
{$AMI.TRUNK_REGEXP}

The regexp for the identification of trunk peers.

trunk
{$AMI.RESPONSE_TIME.MAX.WARN}

The Asterisk Manager API page maximum response time in seconds for trigger expression.

10s
{$AMI.QUEUE_CALLERS.MAX.WARN}

The maximum number of callers in a queue for trigger expression.

10
{$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN}

The maximum number of busy channels of a trunk for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"}

The total maximum number of busy channels of PJSIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"}

The total maximum number of busy channels of SIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"}

The total maximum number of busy channels of IAX trunks for trigger expression.

28

Items

Name Description Type Key and additional info
Service status

Asterisk Manager API port availability.

Simple check net.tcp.service["tcp","{$AMI.HOST}","{$AMI.PORT}"]

Preprocessing

  • Discard unchanged with heartbeat: 10m

Service response time

Asterisk Manager API performance.

Simple check net.tcp.service.perf["tcp","{$AMI.HOST}","{$AMI.PORT}"]
Get stats

Asterisk system information in JSON format.

HTTP agent asterisk.get_stats

Preprocessing

  • JavaScript: The text is too long. Please see the template.

Version

Service version

Dependent item asterisk.version

Preprocessing

  • JSON Path: $.version

Uptime

The system uptime expressed in the following format: "N days, hh:mm:ss".

Dependent item asterisk.uptime

Preprocessing

  • JSON Path: $.uptime

Uptime after reload

System uptime after a config reload in 'N days, hh:mm:ss' format.

Dependent item asterisk.uptime_reload

Preprocessing

  • JSON Path: $.uptime_reload

Active channels

The number of active channels at the moment.

Dependent item asterisk.active_channels

Preprocessing

  • JSON Path: $.active_channels

Active calls

The number of active calls at the moment.

Dependent item asterisk.active_calls

Preprocessing

  • JSON Path: $.active_calls

Calls processed

The number of calls processed after the last service restart.

Dependent item asterisk.calls_processed

Preprocessing

  • JSON Path: $.calls_processed

Calls processed per second

The number of calls processed per second.

Dependent item asterisk.calls_processed.rate

Preprocessing

  • JSON Path: $.calls_processed

  • Change per second
Total queues

The number of configured queues.

Dependent item asterisk.total_queues

Preprocessing

  • JSON Path: $.queue.total

SIP monitored online

The number of monitored online SIP peers.

Dependent item asterisk.sip.monitored_online

Preprocessing

  • JSON Path: $.sip.monitored_online

SIP monitored offline

The number of monitored offline SIP peers.

Dependent item asterisk.sip.monitored_offline

Preprocessing

  • JSON Path: $.sip.monitored_offline

SIP unmonitored online

The number of unmonitored online SIP peers.

Dependent item asterisk.sip.unmonitored_online

Preprocessing

  • JSON Path: $.sip.unmonitored_online

SIP unmonitored offline

The number of unmonitored offline SIP peers.

Dependent item asterisk.sip.unmonitored_offline

Preprocessing

  • JSON Path: $.sip.unmonitored_offline

SIP peers

The total number of SIP peers.

Dependent item asterisk.sip.total

Preprocessing

  • JSON Path: $.sip.total

SIP trunks active channels

The total number of SIP trunks active channels.

Dependent item asterisk.sip.active_channels

Preprocessing

  • JSON Path: $.sip.active_channels

IAX online peers

The number of online IAX peers.

Dependent item asterisk.iax.online

Preprocessing

  • JSON Path: $.iax.online

IAX offline peers

The number of offline IAX peers.

Dependent item asterisk.iax.offline

Preprocessing

  • JSON Path: $.iax.offline

IAX unmonitored peers

The number of unmonitored IAX peers.

Dependent item asterisk.iax.unmonitored

Preprocessing

  • JSON Path: $.iax.unmonitored

IAX peers

The total number of IAX peers.

Dependent item asterisk.iax.total

Preprocessing

  • JSON Path: $.iax.total

IAX trunks active channels

The total number of IAX trunks active channels.

Dependent item asterisk.iax.active_channels

Preprocessing

  • JSON Path: $.iax.active_channels

PJSIP available endpoints

The number of available PJSIP peers.

Dependent item asterisk.pjsip.available

Preprocessing

  • JSON Path: $.pjsip.available

PJSIP unavailable endpoints

The number of unavailable PJSIP peers.

Dependent item asterisk.pjsip.unavailable

Preprocessing

  • JSON Path: $.pjsip.unavailable

PJSIP endpoints

The total number of PJSIP peers.

Dependent item asterisk.pjsip.total

Preprocessing

  • JSON Path: $.pjsip.total

PJSIP trunks active channels

The total number of PJSIP trunks active channels.

Dependent item asterisk.pjsip.active_channels

Preprocessing

  • JSON Path: $.pjsip.active_channels

Triggers

Name Description Expression Severity Dependencies and additional info
Asterisk: Service is down last(/Asterisk by HTTP/net.tcp.service["tcp","{$AMI.HOST}","{$AMI.PORT}"])=0 Average Manual close: Yes
Asterisk: Service response time is too high min(/Asterisk by HTTP/net.tcp.service.perf["tcp","{$AMI.HOST}","{$AMI.PORT}"],5m)>{$AMI.RESPONSE_TIME.MAX.WARN} Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: Version has changed

The Asterisk version has changed. Acknowledge to close the problem manually.

last(/Asterisk by HTTP/asterisk.version,#1)<>last(/Asterisk by HTTP/asterisk.version,#2) and length(last(/Asterisk by HTTP/asterisk.version))>0 Info Manual close: Yes
Asterisk: Service has been restarted

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime)<10m Info Manual close: Yes
Asterisk: Failed to fetch AMI page

Zabbix has not received any data for items for the last 30 minutes.

nodata(/Asterisk by HTTP/asterisk.uptime,30m)=1 Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: Configuration has been reloaded

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime_reload)<10m Info Manual close: Yes
Asterisk: Total number of active channels of SIP trunks is too high

The SIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"} Warning
Asterisk: Total number of active channels of IAX trunks is too high

The IAX trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"} Warning
Asterisk: Total number of active channels of PJSIP trunks is too high

The PJSIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"} Warning

LLD rule SIP peers discovery

Name Description Type Key and additional info
SIP peers discovery Dependent item asterisk.sip_peers.discovery

Preprocessing

  • JSON Path: $.sip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for SIP peers discovery

Name Description Type Key and additional info
SIP trunk "{#OBJECTNAME}": Get SIP trunk

Raw data for a SIP trunk.

Dependent item asterisk.sip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.sip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

SIP trunk "{#OBJECTNAME}": Status

SIP trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.sip.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

SIP trunk "{#OBJECTNAME}": Active channels

The total number of active SIP trunk channels.

Dependent item asterisk.sip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for SIP peers discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: SIP trunk "{#OBJECTNAME}": SIP trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The SIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
Asterisk: SIP trunk "{#OBJECTNAME}": Number of the SIP trunk "{#OBJECTNAME}" active channels is too high

The SIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule IAX peers discovery

Name Description Type Key and additional info
IAX peers discovery Dependent item asterisk.iax_peers.discovery

Preprocessing

  • JSON Path: $.iax.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for IAX peers discovery

Name Description Type Key and additional info
IAX trunk "{#OBJECTNAME}": Get IAX trunk

Raw data for an IAX trunk.

Dependent item asterisk.iax.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.iax.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

IAX trunk "{#OBJECTNAME}": Status

IAX trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.iax.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

IAX trunk "{#OBJECTNAME}": Active channels

The total number of active IAX trunk channels.

Dependent item asterisk.iax.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for IAX peers discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: IAX trunk "{#OBJECTNAME}": IAX trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The IAX trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
Asterisk: IAX trunk "{#OBJECTNAME}": Number of the IAX trunk "{#OBJECTNAME}" active channels is too high

The IAX trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP endpoints discovery Dependent item asterisk.pjsip_endpoints.discovery

Preprocessing

  • JSON Path: $.pjsip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP trunk "{#OBJECTNAME}": Get PJSIP trunk

Raw data for a PJSIP trunk.

Dependent item asterisk.pjsip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.pjsip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

PJSIP trunk "{#OBJECTNAME}": Device state

PJSIP trunk status. Here are the possible states that a device state may have:

Unavailable

Not in use

In use

Dependent item asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.DeviceState

  • Discard unchanged with heartbeat: 1h

PJSIP trunk "{#OBJECTNAME}": Active channels

The total number of active PJSIP trunk channels.

Dependent item asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for PJSIP endpoints discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: PJSIP trunk "{#OBJECTNAME}": PJSIP trunk {#OBJECTNAME} has a state Unavailable

The PJSIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}])="Unavailable" Average
Asterisk: PJSIP trunk "{#OBJECTNAME}": Number of the PJSIP trunk "{#OBJECTNAME}" active channels is too high

The PJSIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule Queues discovery

Name Description Type Key and additional info
Queues discovery Dependent item asterisk.queues.discovery

Preprocessing

  • JSON Path: $.queue.queues

  • Discard unchanged with heartbeat: 1h

Item prototypes for Queues discovery

Name Description Type Key and additional info
"{#QUEUE}": Get queue

Raw data for a queue.

Dependent item asterisk.queue.get[{#QUEUE}]

Preprocessing

  • JSON Path: $.queue.queues[?(@.Queue=='{#QUEUE}')].first()

"{#QUEUE}": Logged in

The number of queue members.

Dependent item asterisk.queue.loggedin[{#QUEUE}]

Preprocessing

  • JSON Path: $.LoggedIn

"{#QUEUE}": Available

The number of available queue members.

Dependent item asterisk.queue.available[{#QUEUE}]

Preprocessing

  • JSON Path: $.Available

"{#QUEUE}": Callers

The number incoming calls in queue.

Dependent item asterisk.queue.callers[{#QUEUE}]

Preprocessing

  • JSON Path: $.Callers

Trigger prototypes for Queues discovery

Name Description Expression Severity Dependencies and additional info
Asterisk: "{#QUEUE}": Number of callers in the queue "{#QUEUE}" is too high

There is a large number of calls in the queue.

min(/Asterisk by HTTP/asterisk.queue.callers[{#QUEUE}],10m)>{$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"} Warning

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template, or ask for help at ZABBIX forums

This template is for Zabbix version: 6.4

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/tel/asterisk_http?at=release/6.4

Asterisk by HTTP

Overview

The template for monitoring Asterisk over HTTP that works without any external scripts. It collects metrics by polling the Asterisk Manager API remotely using an HTTP agent and JS preprocessing. All metrics are collected at once, thanks to Zabbix's bulk data collection.

Requirements

Zabbix version: 6.4 and higher.

Tested versions

This template has been tested on:

  • Asterisk, version 13 and later

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

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. Disable the PJSIP driver if you do not use PJSIP or do not have PJSIP endpoints. Please, define AMI address in the {$AMI.URL} macro. Also, set the hostname or IP address of the AMI host in the {$AMI.HOST} macro for Zabbix to check Asterisk service status. Then you can define {$AMI.USERNAME} and {$AMI.SECRET} macros in the template for using on the host level. If there are errors, increase the logging to debug level and see the Zabbix server log.

Macros used

Name Description Default
{$AMI.URL}

The Asterisk Manager API URL in the format <scheme>://<host>:<port>/<prefix>/rawman.

http://asterisk:8088/asterisk/rawman
{$AMI.HOST}

The hostname or IP address of the Asterisk Manager API host.

<SET AMI HOST>
{$AMI.PORT}

AMI port number for checking service availability.

5038
{$AMI.USERNAME}

The Asterisk Manager name.

zabbix
{$AMI.SECRET}

The Asterisk Manager secret.

zabbix
{$AMI.TRUNK_REGEXP}

The regexp for the identification of trunk peers.

trunk
{$AMI.RESPONSE_TIME.MAX.WARN}

The Asterisk Manager API page maximum response time in seconds for trigger expression.

10s
{$AMI.QUEUE_CALLERS.MAX.WARN}

The maximum number of callers in a queue for trigger expression.

10
{$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN}

The maximum number of busy channels of a trunk for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"}

The total maximum number of busy channels of PJSIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"}

The total maximum number of busy channels of SIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"}

The total maximum number of busy channels of IAX trunks for trigger expression.

28

Items

Name Description Type Key and additional info
Asterisk: Service status

Asterisk Manager API port availability.

Simple check net.tcp.service["tcp","{$AMI.HOST}","{$AMI.PORT}"]

Preprocessing

  • Discard unchanged with heartbeat: 10m

Asterisk: Service response time

Asterisk Manager API performance.

Simple check net.tcp.service.perf["tcp","{$AMI.HOST}","{$AMI.PORT}"]
Asterisk: Get stats

Asterisk system information in JSON format.

HTTP agent asterisk.get_stats

Preprocessing

  • JavaScript: The text is too long. Please see the template.

Asterisk: Version

Service version

Dependent item asterisk.version

Preprocessing

  • JSON Path: $.version

Asterisk: Uptime

The system uptime expressed in the following format: "N days, hh:mm:ss".

Dependent item asterisk.uptime

Preprocessing

  • JSON Path: $.uptime

Asterisk: Uptime after reload

System uptime after a config reload in 'N days, hh:mm:ss' format.

Dependent item asterisk.uptime_reload

Preprocessing

  • JSON Path: $.uptime_reload

Asterisk: Active channels

The number of active channels at the moment.

Dependent item asterisk.active_channels

Preprocessing

  • JSON Path: $.active_channels

Asterisk: Active calls

The number of active calls at the moment.

Dependent item asterisk.active_calls

Preprocessing

  • JSON Path: $.active_calls

Asterisk: Calls processed

The number of calls processed after the last service restart.

Dependent item asterisk.calls_processed

Preprocessing

  • JSON Path: $.calls_processed

Asterisk: Calls processed per second

The number of calls processed per second.

Dependent item asterisk.calls_processed.rate

Preprocessing

  • JSON Path: $.calls_processed

  • Change per second
Asterisk: Total queues

The number of configured queues.

Dependent item asterisk.total_queues

Preprocessing

  • JSON Path: $.queue.total

Asterisk: SIP monitored online

The number of monitored online SIP peers.

Dependent item asterisk.sip.monitored_online

Preprocessing

  • JSON Path: $.sip.monitored_online

Asterisk: SIP monitored offline

The number of monitored offline SIP peers.

Dependent item asterisk.sip.monitored_offline

Preprocessing

  • JSON Path: $.sip.monitored_offline

Asterisk: SIP unmonitored online

The number of unmonitored online SIP peers.

Dependent item asterisk.sip.unmonitored_online

Preprocessing

  • JSON Path: $.sip.unmonitored_online

Asterisk: SIP unmonitored offline

The number of unmonitored offline SIP peers.

Dependent item asterisk.sip.unmonitored_offline

Preprocessing

  • JSON Path: $.sip.unmonitored_offline

Asterisk: SIP peers

The total number of SIP peers.

Dependent item asterisk.sip.total

Preprocessing

  • JSON Path: $.sip.total

Asterisk: SIP trunks active channels

The total number of SIP trunks active channels.

Dependent item asterisk.sip.active_channels

Preprocessing

  • JSON Path: $.sip.active_channels

Asterisk: IAX online peers

The number of online IAX peers.

Dependent item asterisk.iax.online

Preprocessing

  • JSON Path: $.iax.online

Asterisk: IAX offline peers

The number of offline IAX peers.

Dependent item asterisk.iax.offline

Preprocessing

  • JSON Path: $.iax.offline

Asterisk: IAX unmonitored peers

The number of unmonitored IAX peers.

Dependent item asterisk.iax.unmonitored

Preprocessing

  • JSON Path: $.iax.unmonitored

Asterisk: IAX peers

The total number of IAX peers.

Dependent item asterisk.iax.total

Preprocessing

  • JSON Path: $.iax.total

Asterisk: IAX trunks active channels

The total number of IAX trunks active channels.

Dependent item asterisk.iax.active_channels

Preprocessing

  • JSON Path: $.iax.active_channels

Asterisk: PJSIP available endpoints

The number of available PJSIP peers.

Dependent item asterisk.pjsip.available

Preprocessing

  • JSON Path: $.pjsip.available

Asterisk: PJSIP unavailable endpoints

The number of unavailable PJSIP peers.

Dependent item asterisk.pjsip.unavailable

Preprocessing

  • JSON Path: $.pjsip.unavailable

Asterisk: PJSIP endpoints

The total number of PJSIP peers.

Dependent item asterisk.pjsip.total

Preprocessing

  • JSON Path: $.pjsip.total

Asterisk: PJSIP trunks active channels

The total number of PJSIP trunks active channels.

Dependent item asterisk.pjsip.active_channels

Preprocessing

  • JSON Path: $.pjsip.active_channels

Triggers

Name Description Expression Severity Dependencies and additional info
Asterisk: Service is down last(/Asterisk by HTTP/net.tcp.service["tcp","{$AMI.HOST}","{$AMI.PORT}"])=0 Average Manual close: Yes
Asterisk: Service response time is too high min(/Asterisk by HTTP/net.tcp.service.perf["tcp","{$AMI.HOST}","{$AMI.PORT}"],5m)>{$AMI.RESPONSE_TIME.MAX.WARN} Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: Version has changed

The Asterisk version has changed. Acknowledge to close the problem manually.

last(/Asterisk by HTTP/asterisk.version,#1)<>last(/Asterisk by HTTP/asterisk.version,#2) and length(last(/Asterisk by HTTP/asterisk.version))>0 Info Manual close: Yes
Asterisk: Host has been restarted

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime)<10m Info Manual close: Yes
Asterisk: Failed to fetch AMI page

Zabbix has not received any data for items for the last 30 minutes.

nodata(/Asterisk by HTTP/asterisk.uptime,30m)=1 Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: has been reloaded

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime_reload)<10m Info Manual close: Yes
Asterisk: Total number of active channels of SIP trunks is too high

The SIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"} Warning
Asterisk: Total number of active channels of IAX trunks is too high

The IAX trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"} Warning
Asterisk: Total number of active channels of PJSIP trunks is too high

The PJSIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"} Warning

LLD rule SIP peers discovery

Name Description Type Key and additional info
SIP peers discovery Dependent item asterisk.sip_peers.discovery

Preprocessing

  • JSON Path: $.sip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for SIP peers discovery

Name Description Type Key and additional info
SIP trunk "{#OBJECTNAME}": Get SIP trunk

Raw data for a SIP trunk.

Dependent item asterisk.sip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.sip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

SIP trunk "{#OBJECTNAME}": Status

SIP trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.sip.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

SIP trunk "{#OBJECTNAME}": Active channels

The total number of active SIP trunk channels.

Dependent item asterisk.sip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for SIP peers discovery

Name Description Expression Severity Dependencies and additional info
SIP trunk "{#OBJECTNAME}": SIP trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The SIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
SIP trunk "{#OBJECTNAME}": Number of the SIP trunk "{#OBJECTNAME}" active channels is too high

The SIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule IAX peers discovery

Name Description Type Key and additional info
IAX peers discovery Dependent item asterisk.iax_peers.discovery

Preprocessing

  • JSON Path: $.iax.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for IAX peers discovery

Name Description Type Key and additional info
IAX trunk "{#OBJECTNAME}": Get IAX trunk

Raw data for an IAX trunk.

Dependent item asterisk.iax.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.iax.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

IAX trunk "{#OBJECTNAME}": Status

IAX trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.iax.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

IAX trunk "{#OBJECTNAME}": Active channels

The total number of active IAX trunk channels.

Dependent item asterisk.iax.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for IAX peers discovery

Name Description Expression Severity Dependencies and additional info
IAX trunk "{#OBJECTNAME}": IAX trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The IAX trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
IAX trunk "{#OBJECTNAME}": Number of the IAX trunk "{#OBJECTNAME}" active channels is too high

The IAX trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP endpoints discovery Dependent item asterisk.pjsip_endpoints.discovery

Preprocessing

  • JSON Path: $.pjsip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP trunk "{#OBJECTNAME}": Get PJSIP trunk

Raw data for a PJSIP trunk.

Dependent item asterisk.pjsip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.pjsip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

PJSIP trunk "{#OBJECTNAME}": Device state

PJSIP trunk status. Here are the possible states that a device state may have:

Unavailable

Not in use

In use

Dependent item asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.DeviceState

  • Discard unchanged with heartbeat: 1h

PJSIP trunk "{#OBJECTNAME}": Active channels

The total number of active PJSIP trunk channels.

Dependent item asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for PJSIP endpoints discovery

Name Description Expression Severity Dependencies and additional info
PJSIP trunk "{#OBJECTNAME}": PJSIP trunk {#OBJECTNAME} has a state Unavailable

The PJSIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}])="Unavailable" Average
PJSIP trunk "{#OBJECTNAME}": Number of the PJSIP trunk "{#OBJECTNAME}" active channels is too high

The PJSIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule Queues discovery

Name Description Type Key and additional info
Queues discovery Dependent item asterisk.queues.discovery

Preprocessing

  • JSON Path: $.queue.queues

  • Discard unchanged with heartbeat: 1h

Item prototypes for Queues discovery

Name Description Type Key and additional info
"{#QUEUE}": Get queue

Raw data for a queue.

Dependent item asterisk.queue.get[{#QUEUE}]

Preprocessing

  • JSON Path: $.queue.queues[?(@.Queue=='{#QUEUE}')].first()

"{#QUEUE}": Logged in

The number of queue members.

Dependent item asterisk.queue.loggedin[{#QUEUE}]

Preprocessing

  • JSON Path: $.LoggedIn

"{#QUEUE}": Available

The number of available queue members.

Dependent item asterisk.queue.available[{#QUEUE}]

Preprocessing

  • JSON Path: $.Available

"{#QUEUE}": Callers

The number incoming calls in queue.

Dependent item asterisk.queue.callers[{#QUEUE}]

Preprocessing

  • JSON Path: $.Callers

Trigger prototypes for Queues discovery

Name Description Expression Severity Dependencies and additional info
"{#QUEUE}": Number of callers in the queue "{#QUEUE}" is too high

There is a large number of calls in the queue.

min(/Asterisk by HTTP/asterisk.queue.callers[{#QUEUE}],10m)>{$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"} Warning

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template, or ask for help at ZABBIX forums

This template is for Zabbix version: 6.2

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/tel/asterisk_http?at=release/6.2

Asterisk by HTTP

Overview

For Zabbix version: 6.2 and higher
The template for monitoring Asterisk over HTTP that works without any external scripts.
It collects metrics by polling the Asterisk Manager API remotely using an HTTP agent and JS preprocessing.
All metrics are collected at once, thanks to Zabbix's bulk data collection.

This template was tested on:

  • Asterisk, version 13 and later

Setup

See Zabbix template operation for basic instructions.

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. Disable the PJSIP driver if you do not use PJSIP or do not have PJSIP endpoints.
Please, define AMI address in the {$AMI.URL} macro. Also, the Zabbix host should have an Agent interface with the AMI address to check Asterisk service status. Then you can define {$AMI.USERNAME} and {$AMI.SECRET} macros in the template for using on the host level.
If there are errors, increase the logging to debug level and see the Zabbix server log.

Zabbix configuration

No specific Zabbix configuration is required.

Macros used

Name Description Default
{$AMI.PORT}

AMI port number for checking service availability.

5038
{$AMI.QUEUE_CALLERS.MAX.WARN}

The maximum number of callers in a queue for trigger expression.

10
{$AMI.RESPONSE_TIME.MAX.WARN}

The Asterisk Manager API page maximum response time in seconds for trigger expression.

10s
{$AMI.SECRET}

The Asterisk Manager secret.

zabbix
{$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN}

The maximum number of busy channels of a trunk for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"}

The total maximum number of busy channels of IAX trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"}

The total maximum number of busy channels of PJSIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"}

The total maximum number of busy channels of SIP trunks for trigger expression.

28
{$AMI.TRUNK_REGEXP}

The regexp for the identification of trunk peers.

trunk
{$AMI.URL}

The Asterisk Manager API URL in the format <scheme>://<host>:<port>/<prefix>/rawman.

http://asterisk:8088/asterisk/rawman
{$AMI.USERNAME}

The Asterisk Manager name.

zabbix

Template links

There are no template links in this template.

Discovery rules

Name Description Type Key and additional info
IAX peers discovery

-

DEPENDENT asterisk.iax_peers.discovery

Preprocessing:

- JSONPATH: $.iax.trunks

- DISCARD_UNCHANGED_HEARTBEAT: 1h

PJSIP endpoints discovery

-

DEPENDENT asterisk.pjsip_endpoints.discovery

Preprocessing:

- JSONPATH: $.pjsip.trunks

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Queues discovery

-

DEPENDENT asterisk.queues.discovery

Preprocessing:

- JSONPATH: $.queue.queues

- DISCARD_UNCHANGED_HEARTBEAT: 1h

SIP peers discovery

-

DEPENDENT asterisk.sip_peers.discovery

Preprocessing:

- JSONPATH: $.sip.trunks

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Items collected

Group Name Description Type Key and additional info
Asterisk Asterisk: Service status

Asterisk Manager API port availability.

SIMPLE net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

Asterisk Asterisk: Service response time

Asterisk Manager API performance.

SIMPLE net.tcp.service.perf["tcp","{HOST.CONN}","{$AMI.PORT}"]
Asterisk Asterisk: Version

Service version

DEPENDENT asterisk.version

Preprocessing:

- JSONPATH: $.version

Asterisk Asterisk: Uptime

System uptime in 'N days, hh:mm:ss' format.

DEPENDENT asterisk.uptime

Preprocessing:

- JSONPATH: $.uptime

Asterisk Asterisk: Uptime after reload

System uptime after a config reload in 'N days, hh:mm:ss' format.

DEPENDENT asterisk.uptime_reload

Preprocessing:

- JSONPATH: $.uptime_reload

Asterisk Asterisk: Active channels

The number of active channels at the moment.

DEPENDENT asterisk.active_channels

Preprocessing:

- JSONPATH: $.active_channels

Asterisk Asterisk: Active calls

The number of active calls at the moment.

DEPENDENT asterisk.active_calls

Preprocessing:

- JSONPATH: $.active_calls

Asterisk Asterisk: Calls processed

The number of calls processed after the last service restart.

DEPENDENT asterisk.calls_processed

Preprocessing:

- JSONPATH: $.calls_processed

Asterisk Asterisk: Calls processed per second

The number of calls processed per second.

DEPENDENT asterisk.calls_processed.rate

Preprocessing:

- JSONPATH: $.calls_processed

- CHANGE_PER_SECOND

Asterisk Asterisk: Total queues

The number of configured queues.

DEPENDENT asterisk.total_queues

Preprocessing:

- JSONPATH: $.queue.total

Asterisk Asterisk: SIP monitored online

The number of monitored online SIP peers.

DEPENDENT asterisk.sip.monitored_online

Preprocessing:

- JSONPATH: $.sip.monitored_online

Asterisk Asterisk: SIP monitored offline

The number of monitored offline SIP peers.

DEPENDENT asterisk.sip.monitored_offline

Preprocessing:

- JSONPATH: $.sip.monitored_offline

Asterisk Asterisk: SIP unmonitored online

The number of unmonitored online SIP peers.

DEPENDENT asterisk.sip.unmonitored_online

Preprocessing:

- JSONPATH: $.sip.unmonitored_online

Asterisk Asterisk: SIP unmonitored offline

The number of unmonitored offline SIP peers.

DEPENDENT asterisk.sip.unmonitored_offline

Preprocessing:

- JSONPATH: $.sip.unmonitored_offline

Asterisk Asterisk: SIP peers

The total number of SIP peers.

DEPENDENT asterisk.sip.total

Preprocessing:

- JSONPATH: $.sip.total

Asterisk Asterisk: SIP trunks active channels

The total number of SIP trunks active channels.

DEPENDENT asterisk.sip.active_channels

Preprocessing:

- JSONPATH: $.sip.active_channels

Asterisk Asterisk: IAX online peers

The number of online IAX peers.

DEPENDENT asterisk.iax.online

Preprocessing:

- JSONPATH: $.iax.online

Asterisk Asterisk: IAX offline peers

The number of offline IAX peers.

DEPENDENT asterisk.iax.offline

Preprocessing:

- JSONPATH: $.iax.offline

Asterisk Asterisk: IAX unmonitored peers

The number of unmonitored IAX peers.

DEPENDENT asterisk.iax.unmonitored

Preprocessing:

- JSONPATH: $.iax.unmonitored

Asterisk Asterisk: IAX peers

The total number of IAX peers.

DEPENDENT asterisk.iax.total

Preprocessing:

- JSONPATH: $.iax.total

Asterisk Asterisk: IAX trunks active channels

The total number of IAX trunks active channels.

DEPENDENT asterisk.iax.active_channels

Preprocessing:

- JSONPATH: $.iax.active_channels

Asterisk Asterisk: PJSIP available endpoints

The number of available PJSIP peers.

DEPENDENT asterisk.pjsip.available

Preprocessing:

- JSONPATH: $.pjsip.available

Asterisk Asterisk: PJSIP unavailable endpoints

The number of unavailable PJSIP peers.

DEPENDENT asterisk.pjsip.unavailable

Preprocessing:

- JSONPATH: $.pjsip.unavailable

Asterisk Asterisk: PJSIP endpoints

The total number of PJSIP peers.

DEPENDENT asterisk.pjsip.total

Preprocessing:

- JSONPATH: $.pjsip.total

Asterisk Asterisk: PJSIP trunks active channels

The total number of PJSIP trunks active channels.

DEPENDENT asterisk.pjsip.active_channels

Preprocessing:

- JSONPATH: $.pjsip.active_channels

Asterisk SIP trunk "{#OBJECTNAME}": Status

SIP trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

DEPENDENT asterisk.sip.trunk.status[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.sip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].Status.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Asterisk SIP trunk "{#OBJECTNAME}": Active channels

The total number of active SIP trunk channels.

DEPENDENT asterisk.sip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.sip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].active_channels.first()

Asterisk IAX trunk "{#OBJECTNAME}": Status

IAX trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

DEPENDENT asterisk.iax.trunk.status[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.iax.trunks[?(@.ObjectName=='{#OBJECTNAME}')].Status.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Asterisk IAX trunk "{#OBJECTNAME}": Active channels

The total number of active IAX trunk channels.

DEPENDENT asterisk.iax.trunk.active_channels[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.iax.trunks[?(@.ObjectName=='{#OBJECTNAME}')].active_channels.first()

Asterisk PJSIP trunk "{#OBJECTNAME}": Device state

PJSIP trunk status. Here are the possible states that a device state may have:

Unavailable

Not in use

In use

DEPENDENT asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.pjsip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].DeviceState.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Asterisk PJSIP trunk "{#OBJECTNAME}": Active channels

The total number of active PJSIP trunk channels.

DEPENDENT asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.pjsip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].active_channels.first()

Asterisk "{#QUEUE}": Logged in

The number of queue members.

DEPENDENT asterisk.queue.loggedin[{#QUEUE}]

Preprocessing:

- JSONPATH: $.queue.queues[?(@.Queue=='{#QUEUE}')].LoggedIn.first()

Asterisk "{#QUEUE}": Available

The number of available queue members.

DEPENDENT asterisk.queue.available[{#QUEUE}]

Preprocessing:

- JSONPATH: $.queue.queues[?(@.Queue=='{#QUEUE}')].Available.first()

Asterisk "{#QUEUE}": Callers

The number incoming calls in queue.

DEPENDENT asterisk.queue.callers[{#QUEUE}]

Preprocessing:

- JSONPATH: $.queue.queues[?(@.Queue=='{#QUEUE}')].Callers.first()

Zabbix raw items Asterisk: Get stats

Asterisk system information in JSON format.

HTTP_AGENT asterisk.get_stats

Preprocessing:

- JAVASCRIPT: The text is too long. Please see the template.

Triggers

Name Description Expression Severity Dependencies and additional info
Asterisk: Service is down

-

last(/Asterisk by HTTP/net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"])=0 AVERAGE

Manual close: YES

Asterisk: Service response time is too high

-

min(/Asterisk by HTTP/net.tcp.service.perf["tcp","{HOST.CONN}","{$AMI.PORT}"],5m)>{$AMI.RESPONSE_TIME.MAX.WARN} WARNING

Manual close: YES

Depends on:

- Asterisk: Service is down

Asterisk: Version has changed

Asterisk version has changed. Ack to close.

last(/Asterisk by HTTP/asterisk.version,#1)<>last(/Asterisk by HTTP/asterisk.version,#2) and length(last(/Asterisk by HTTP/asterisk.version))>0 INFO

Manual close: YES

Asterisk: has been restarted

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime)<10m INFO

Manual close: YES

Asterisk: Failed to fetch AMI page

Zabbix has not received data for items for the last 30 minutes.

nodata(/Asterisk by HTTP/asterisk.uptime,30m)=1 WARNING

Manual close: YES

Depends on:

- Asterisk: Service is down

Asterisk: has been reloaded

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime_reload)<10m INFO

Manual close: YES

Asterisk: Total number of active channels of SIP trunks is too high

The SIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"} WARNING
Asterisk: Total number of active channels of IAX trunks is too high

The IAX trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"} WARNING
Asterisk: Total number of active channels of PJSIP trunks is too high

The PJSIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"} WARNING
SIP trunk "{#OBJECTNAME}": SIP trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The SIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNREACHABLE" AVERAGE
SIP trunk "{#OBJECTNAME}": Number of the SIP trunk "{#OBJECTNAME}" active channels is too high

The SIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} WARNING
IAX trunk "{#OBJECTNAME}": IAX trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The IAX trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNREACHABLE" AVERAGE
IAX trunk "{#OBJECTNAME}": Number of the IAX trunk "{#OBJECTNAME}" active channels is too high

The IAX trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} WARNING
PJSIP trunk "{#OBJECTNAME}": PJSIP trunk {#OBJECTNAME} has a state Unavailable

The PJSIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}])="Unavailable" AVERAGE
PJSIP trunk "{#OBJECTNAME}": Number of the PJSIP trunk "{#OBJECTNAME}" active channels is too high

The PJSIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} WARNING
"{#QUEUE}": Number of callers in the queue "{#QUEUE}" is too high

There is a large number of calls in the queue.

min(/Asterisk by HTTP/asterisk.queue.callers[{#QUEUE}],10m)>{$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"} WARNING

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template or ask for help with it at ZABBIX forums.

References

https://wiki.asterisk.org/wiki/display/AST/Home

This template is for Zabbix version: 6.0

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/tel/asterisk_http?at=release/6.0

Asterisk by HTTP

Overview

The template for monitoring Asterisk over HTTP that works without any external scripts. It collects metrics by polling the Asterisk Manager API remotely using an HTTP agent and JS preprocessing. All metrics are collected at once, thanks to Zabbix's bulk data collection.

Requirements

Zabbix version: 6.0 and higher.

Tested versions

This template has been tested on:

  • Asterisk, version 13 and later

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

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. Disable the PJSIP driver if you do not use PJSIP or do not have PJSIP endpoints. Please, define AMI address in the {$AMI.URL} macro. Also, the Zabbix host should have an Agent interface with the AMI address to check Asterisk service status. Then you can define {$AMI.USERNAME} and {$AMI.SECRET} macros in the template for using on the host level. If there are errors, increase the logging to debug level and see the Zabbix server log.

Macros used

Name Description Default
{$AMI.URL}

The Asterisk Manager API URL in the format <scheme>://<host>:<port>/<prefix>/rawman.

http://asterisk:8088/asterisk/rawman
{$AMI.PORT}

AMI port number for checking service availability.

5038
{$AMI.USERNAME}

The Asterisk Manager name.

zabbix
{$AMI.SECRET}

The Asterisk Manager secret.

zabbix
{$AMI.TRUNK_REGEXP}

The regexp for the identification of trunk peers.

trunk
{$AMI.RESPONSE_TIME.MAX.WARN}

The Asterisk Manager API page maximum response time in seconds for trigger expression.

10s
{$AMI.QUEUE_CALLERS.MAX.WARN}

The maximum number of callers in a queue for trigger expression.

10
{$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN}

The maximum number of busy channels of a trunk for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"}

The total maximum number of busy channels of PJSIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"}

The total maximum number of busy channels of SIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"}

The total maximum number of busy channels of IAX trunks for trigger expression.

28

Items

Name Description Type Key and additional info
Asterisk: Service status

Asterisk Manager API port availability.

Simple check net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"]

Preprocessing

  • Discard unchanged with heartbeat: 10m

Asterisk: Service response time

Asterisk Manager API performance.

Simple check net.tcp.service.perf["tcp","{HOST.CONN}","{$AMI.PORT}"]
Asterisk: Get stats

Asterisk system information in JSON format.

HTTP agent asterisk.get_stats

Preprocessing

  • JavaScript: The text is too long. Please see the template.

Asterisk: Version

Service version

Dependent item asterisk.version

Preprocessing

  • JSON Path: $.version

Asterisk: Uptime

The system uptime expressed in the following format: "N days, hh:mm:ss".

Dependent item asterisk.uptime

Preprocessing

  • JSON Path: $.uptime

Asterisk: Uptime after reload

System uptime after a config reload in 'N days, hh:mm:ss' format.

Dependent item asterisk.uptime_reload

Preprocessing

  • JSON Path: $.uptime_reload

Asterisk: Active channels

The number of active channels at the moment.

Dependent item asterisk.active_channels

Preprocessing

  • JSON Path: $.active_channels

Asterisk: Active calls

The number of active calls at the moment.

Dependent item asterisk.active_calls

Preprocessing

  • JSON Path: $.active_calls

Asterisk: Calls processed

The number of calls processed after the last service restart.

Dependent item asterisk.calls_processed

Preprocessing

  • JSON Path: $.calls_processed

Asterisk: Calls processed per second

The number of calls processed per second.

Dependent item asterisk.calls_processed.rate

Preprocessing

  • JSON Path: $.calls_processed

  • Change per second
Asterisk: Total queues

The number of configured queues.

Dependent item asterisk.total_queues

Preprocessing

  • JSON Path: $.queue.total

Asterisk: SIP monitored online

The number of monitored online SIP peers.

Dependent item asterisk.sip.monitored_online

Preprocessing

  • JSON Path: $.sip.monitored_online

Asterisk: SIP monitored offline

The number of monitored offline SIP peers.

Dependent item asterisk.sip.monitored_offline

Preprocessing

  • JSON Path: $.sip.monitored_offline

Asterisk: SIP unmonitored online

The number of unmonitored online SIP peers.

Dependent item asterisk.sip.unmonitored_online

Preprocessing

  • JSON Path: $.sip.unmonitored_online

Asterisk: SIP unmonitored offline

The number of unmonitored offline SIP peers.

Dependent item asterisk.sip.unmonitored_offline

Preprocessing

  • JSON Path: $.sip.unmonitored_offline

Asterisk: SIP peers

The total number of SIP peers.

Dependent item asterisk.sip.total

Preprocessing

  • JSON Path: $.sip.total

Asterisk: SIP trunks active channels

The total number of SIP trunks active channels.

Dependent item asterisk.sip.active_channels

Preprocessing

  • JSON Path: $.sip.active_channels

Asterisk: IAX online peers

The number of online IAX peers.

Dependent item asterisk.iax.online

Preprocessing

  • JSON Path: $.iax.online

Asterisk: IAX offline peers

The number of offline IAX peers.

Dependent item asterisk.iax.offline

Preprocessing

  • JSON Path: $.iax.offline

Asterisk: IAX unmonitored peers

The number of unmonitored IAX peers.

Dependent item asterisk.iax.unmonitored

Preprocessing

  • JSON Path: $.iax.unmonitored

Asterisk: IAX peers

The total number of IAX peers.

Dependent item asterisk.iax.total

Preprocessing

  • JSON Path: $.iax.total

Asterisk: IAX trunks active channels

The total number of IAX trunks active channels.

Dependent item asterisk.iax.active_channels

Preprocessing

  • JSON Path: $.iax.active_channels

Asterisk: PJSIP available endpoints

The number of available PJSIP peers.

Dependent item asterisk.pjsip.available

Preprocessing

  • JSON Path: $.pjsip.available

Asterisk: PJSIP unavailable endpoints

The number of unavailable PJSIP peers.

Dependent item asterisk.pjsip.unavailable

Preprocessing

  • JSON Path: $.pjsip.unavailable

Asterisk: PJSIP endpoints

The total number of PJSIP peers.

Dependent item asterisk.pjsip.total

Preprocessing

  • JSON Path: $.pjsip.total

Asterisk: PJSIP trunks active channels

The total number of PJSIP trunks active channels.

Dependent item asterisk.pjsip.active_channels

Preprocessing

  • JSON Path: $.pjsip.active_channels

Triggers

Name Description Expression Severity Dependencies and additional info
Asterisk: Service is down last(/Asterisk by HTTP/net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"])=0 Average Manual close: Yes
Asterisk: Service response time is too high min(/Asterisk by HTTP/net.tcp.service.perf["tcp","{HOST.CONN}","{$AMI.PORT}"],5m)>{$AMI.RESPONSE_TIME.MAX.WARN} Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: Version has changed

The Asterisk version has changed. Acknowledge to close the problem manually.

last(/Asterisk by HTTP/asterisk.version,#1)<>last(/Asterisk by HTTP/asterisk.version,#2) and length(last(/Asterisk by HTTP/asterisk.version))>0 Info Manual close: Yes
Asterisk: Host has been restarted

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime)<10m Info Manual close: Yes
Asterisk: Failed to fetch AMI page

Zabbix has not received any data for items for the last 30 minutes.

nodata(/Asterisk by HTTP/asterisk.uptime,30m)=1 Warning Manual close: Yes
Depends on:
  • Asterisk: Service is down
Asterisk: has been reloaded

Uptime is less than 10 minutes.

last(/Asterisk by HTTP/asterisk.uptime_reload)<10m Info Manual close: Yes
Asterisk: Total number of active channels of SIP trunks is too high

The SIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"} Warning
Asterisk: Total number of active channels of IAX trunks is too high

The IAX trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"} Warning
Asterisk: Total number of active channels of PJSIP trunks is too high

The PJSIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"} Warning

LLD rule SIP peers discovery

Name Description Type Key and additional info
SIP peers discovery Dependent item asterisk.sip_peers.discovery

Preprocessing

  • JSON Path: $.sip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for SIP peers discovery

Name Description Type Key and additional info
SIP trunk "{#OBJECTNAME}": Get SIP trunk

Raw data for a SIP trunk.

Dependent item asterisk.sip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.sip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

SIP trunk "{#OBJECTNAME}": Status

SIP trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.sip.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

SIP trunk "{#OBJECTNAME}": Active channels

The total number of active SIP trunk channels.

Dependent item asterisk.sip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for SIP peers discovery

Name Description Expression Severity Dependencies and additional info
SIP trunk "{#OBJECTNAME}": SIP trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The SIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
SIP trunk "{#OBJECTNAME}": Number of the SIP trunk "{#OBJECTNAME}" active channels is too high

The SIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule IAX peers discovery

Name Description Type Key and additional info
IAX peers discovery Dependent item asterisk.iax_peers.discovery

Preprocessing

  • JSON Path: $.iax.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for IAX peers discovery

Name Description Type Key and additional info
IAX trunk "{#OBJECTNAME}": Get IAX trunk

Raw data for an IAX trunk.

Dependent item asterisk.iax.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.iax.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

IAX trunk "{#OBJECTNAME}": Status

IAX trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

Dependent item asterisk.iax.trunk.status[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.Status

  • Discard unchanged with heartbeat: 1h

IAX trunk "{#OBJECTNAME}": Active channels

The total number of active IAX trunk channels.

Dependent item asterisk.iax.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for IAX peers discovery

Name Description Expression Severity Dependencies and additional info
IAX trunk "{#OBJECTNAME}": IAX trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The IAX trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNREACHABLE" Average
IAX trunk "{#OBJECTNAME}": Number of the IAX trunk "{#OBJECTNAME}" active channels is too high

The IAX trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP endpoints discovery Dependent item asterisk.pjsip_endpoints.discovery

Preprocessing

  • JSON Path: $.pjsip.trunks

  • Discard unchanged with heartbeat: 1h

Item prototypes for PJSIP endpoints discovery

Name Description Type Key and additional info
PJSIP trunk "{#OBJECTNAME}": Get PJSIP trunk

Raw data for a PJSIP trunk.

Dependent item asterisk.pjsip.trunk.get[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.pjsip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].first()

PJSIP trunk "{#OBJECTNAME}": Device state

PJSIP trunk status. Here are the possible states that a device state may have:

Unavailable

Not in use

In use

Dependent item asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.DeviceState

  • Discard unchanged with heartbeat: 1h

PJSIP trunk "{#OBJECTNAME}": Active channels

The total number of active PJSIP trunk channels.

Dependent item asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing

  • JSON Path: $.active_channels

Trigger prototypes for PJSIP endpoints discovery

Name Description Expression Severity Dependencies and additional info
PJSIP trunk "{#OBJECTNAME}": PJSIP trunk {#OBJECTNAME} has a state Unavailable

The PJSIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}])="Unavailable" Average
PJSIP trunk "{#OBJECTNAME}": Number of the PJSIP trunk "{#OBJECTNAME}" active channels is too high

The PJSIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} Warning

LLD rule Queues discovery

Name Description Type Key and additional info
Queues discovery Dependent item asterisk.queues.discovery

Preprocessing

  • JSON Path: $.queue.queues

  • Discard unchanged with heartbeat: 1h

Item prototypes for Queues discovery

Name Description Type Key and additional info
"{#QUEUE}": Get queue

Raw data for a queue.

Dependent item asterisk.queue.get[{#QUEUE}]

Preprocessing

  • JSON Path: $.queue.queues[?(@.Queue=='{#QUEUE}')].first()

"{#QUEUE}": Logged in

The number of queue members.

Dependent item asterisk.queue.loggedin[{#QUEUE}]

Preprocessing

  • JSON Path: $.LoggedIn

"{#QUEUE}": Available

The number of available queue members.

Dependent item asterisk.queue.available[{#QUEUE}]

Preprocessing

  • JSON Path: $.Available

"{#QUEUE}": Callers

The number incoming calls in queue.

Dependent item asterisk.queue.callers[{#QUEUE}]

Preprocessing

  • JSON Path: $.Callers

Trigger prototypes for Queues discovery

Name Description Expression Severity Dependencies and additional info
"{#QUEUE}": Number of callers in the queue "{#QUEUE}" is too high

There is a large number of calls in the queue.

min(/Asterisk by HTTP/asterisk.queue.callers[{#QUEUE}],10m)>{$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"} Warning

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template, or ask for help at ZABBIX forums

This template is for Zabbix version: 5.4

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/tel/asterisk_http?at=release/5.4

Asterisk by HTTP

Overview

For Zabbix version: 5.4 and higher
The template for monitoring Asterisk over HTTP that works without any external scripts.
It collects metrics by polling the Asterisk Manager API remotely using an HTTP agent and JS preprocessing.
All metrics are collected at once, thanks to Zabbix's bulk data collection.

This template was tested on:

  • Asterisk, version 13 and later

Setup

See Zabbix template operation for basic instructions.

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. Disable the PJSIP driver if you do not use PJSIP or do not have PJSIP endpoints.
Please, define AMI address in the {$AMI.URL} macro. Also, the Zabbix host should have an Agent interface with the AMI address to check Asterisk service status. Then you can define {$AMI.USERNAME} and {$AMI.SECRET} macros in the template for using on the host level.
If there are errors, increase the logging to debug level and see the Zabbix server log.

Zabbix configuration

No specific Zabbix configuration is required.

Macros used

Name Description Default
{$AMI.PORT}

AMI port number for checking service availability.

5038
{$AMI.QUEUE_CALLERS.MAX.WARN}

The maximum number of callers in a queue for trigger expression.

10
{$AMI.RESPONSE_TIME.MAX.WARN}

The Asterisk Manager API page maximum response time in seconds for trigger expression.

10s
{$AMI.SECRET}

The Asterisk Manager secret.

zabbix
{$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN}

The maximum number of busy channels of a trunk for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"}

The total maximum number of busy channels of IAX trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"}

The total maximum number of busy channels of PJSIP trunks for trigger expression.

28
{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"}

The total maximum number of busy channels of SIP trunks for trigger expression.

28
{$AMI.TRUNK_REGEXP}

The regexp for the identification of trunk peers.

trunk
{$AMI.URL}

The Asterisk Manager API URL in the format <scheme>://<host>:<port>/<prefix>/rawman.

http://asterisk:8088/asterisk/rawman
{$AMI.USERNAME}

The Asterisk Manager name.

zabbix

Template links

There are no template links in this template.

Discovery rules

Name Description Type Key and additional info
SIP peers discovery

-

DEPENDENT asterisk.sip_peers.discovery

Preprocessing:

- JSONPATH: $.sip.trunks

- DISCARD_UNCHANGED_HEARTBEAT: 1h

IAX peers discovery

-

DEPENDENT asterisk.iax_peers.discovery

Preprocessing:

- JSONPATH: $.iax.trunks

- DISCARD_UNCHANGED_HEARTBEAT: 1h

PJSIP endpoints discovery

-

DEPENDENT asterisk.pjsip_endpoints.discovery

Preprocessing:

- JSONPATH: $.pjsip.trunks

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Queues discovery

-

DEPENDENT asterisk.queues.discovery

Preprocessing:

- JSONPATH: $.queue.queues

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Items collected

Group Name Description Type Key and additional info
Asterisk Asterisk: Service status

Asterisk Manager API port availability.

SIMPLE net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

Asterisk Asterisk: Service response time

Asterisk Manager API performance.

SIMPLE net.tcp.service.perf["tcp","{HOST.CONN}","{$AMI.PORT}"]
Asterisk Asterisk: Version

Service version

DEPENDENT asterisk.version

Preprocessing:

- JSONPATH: $.version

Asterisk Asterisk: Uptime

System uptime in 'N days, hh:mm:ss' format.

DEPENDENT asterisk.uptime

Preprocessing:

- JSONPATH: $.uptime

Asterisk Asterisk: Uptime after reload

System uptime after a config reload in 'N days, hh:mm:ss' format.

DEPENDENT asterisk.uptime_reload

Preprocessing:

- JSONPATH: $.uptime_reload

Asterisk Asterisk: Active channels

The number of active channels at the moment.

DEPENDENT asterisk.active_channels

Preprocessing:

- JSONPATH: $.active_channels

Asterisk Asterisk: Active calls

The number of active calls at the moment.

DEPENDENT asterisk.active_calls

Preprocessing:

- JSONPATH: $.active_calls

Asterisk Asterisk: Calls processed

The number of calls processed after the last service restart.

DEPENDENT asterisk.calls_processed

Preprocessing:

- JSONPATH: $.calls_processed

Asterisk Asterisk: Calls processed per second

The number of calls processed per second.

DEPENDENT asterisk.calls_processed.rate

Preprocessing:

- JSONPATH: $.calls_processed

- CHANGE_PER_SECOND

Asterisk Asterisk: Total queues

The number of configured queues.

DEPENDENT asterisk.total_queues

Preprocessing:

- JSONPATH: $.queue.total

Asterisk Asterisk: SIP monitored online

The number of monitored online SIP peers.

DEPENDENT asterisk.sip.monitored_online

Preprocessing:

- JSONPATH: $.sip.monitored_online

Asterisk Asterisk: SIP monitored offline

The number of monitored offline SIP peers.

DEPENDENT asterisk.sip.monitored_offline

Preprocessing:

- JSONPATH: $.sip.monitored_offline

Asterisk Asterisk: SIP unmonitored online

The number of unmonitored online SIP peers.

DEPENDENT asterisk.sip.unmonitored_online

Preprocessing:

- JSONPATH: $.sip.unmonitored_online

Asterisk Asterisk: SIP unmonitored offline

The number of unmonitored offline SIP peers.

DEPENDENT asterisk.sip.unmonitored_offline

Preprocessing:

- JSONPATH: $.sip.unmonitored_offline

Asterisk Asterisk: SIP peers

The total number of SIP peers.

DEPENDENT asterisk.sip.total

Preprocessing:

- JSONPATH: $.sip.total

Asterisk Asterisk: SIP trunks active channels

The total number of SIP trunks active channels.

DEPENDENT asterisk.sip.active_channels

Preprocessing:

- JSONPATH: $.sip.active_channels

Asterisk Asterisk: IAX online peers

The number of online IAX peers.

DEPENDENT asterisk.iax.online

Preprocessing:

- JSONPATH: $.iax.online

Asterisk Asterisk: IAX offline peers

The number of offline IAX peers.

DEPENDENT asterisk.iax.offline

Preprocessing:

- JSONPATH: $.iax.offline

Asterisk Asterisk: IAX unmonitored peers

The number of unmonitored IAX peers.

DEPENDENT asterisk.iax.unmonitored

Preprocessing:

- JSONPATH: $.iax.unmonitored

Asterisk Asterisk: IAX peers

The total number of IAX peers.

DEPENDENT asterisk.iax.total

Preprocessing:

- JSONPATH: $.iax.total

Asterisk Asterisk: IAX trunks active channels

The total number of IAX trunks active channels.

DEPENDENT asterisk.iax.active_channels

Preprocessing:

- JSONPATH: $.iax.active_channels

Asterisk Asterisk: PJSIP available endpoints

The number of available PJSIP peers.

DEPENDENT asterisk.pjsip.available

Preprocessing:

- JSONPATH: $.pjsip.available

Asterisk Asterisk: PJSIP unavailable endpoints

The number of unavailable PJSIP peers.

DEPENDENT asterisk.pjsip.unavailable

Preprocessing:

- JSONPATH: $.pjsip.unavailable

Asterisk Asterisk: PJSIP endpoints

The total number of PJSIP peers.

DEPENDENT asterisk.pjsip.total

Preprocessing:

- JSONPATH: $.pjsip.total

Asterisk Asterisk: PJSIP trunks active channels

The total number of PJSIP trunks active channels.

DEPENDENT asterisk.pjsip.active_channels

Preprocessing:

- JSONPATH: $.pjsip.active_channels

Asterisk SIP trunk "{#OBJECTNAME}": Status

SIP trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

DEPENDENT asterisk.sip.trunk.status[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.sip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].Status.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Asterisk SIP trunk "{#OBJECTNAME}": Active channels

The total number of active SIP trunk channels.

DEPENDENT asterisk.sip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.sip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].active_channels.first()

Asterisk IAX trunk "{#OBJECTNAME}": Status

IAX trunk status. Here are the possible states that a device state may have:

Unmonitored

UNKNOWN

UNREACHABLE

OK

DEPENDENT asterisk.iax.trunk.status[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.iax.trunks[?(@.ObjectName=='{#OBJECTNAME}')].Status.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Asterisk IAX trunk "{#OBJECTNAME}": Active channels

The total number of active IAX trunk channels.

DEPENDENT asterisk.iax.trunk.active_channels[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.iax.trunks[?(@.ObjectName=='{#OBJECTNAME}')].active_channels.first()

Asterisk PJSIP trunk "{#OBJECTNAME}": Device state

PJSIP trunk status. Here are the possible states that a device state may have:

Unavailable

Not in use

In use

DEPENDENT asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.pjsip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].DeviceState.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1h

Asterisk PJSIP trunk "{#OBJECTNAME}": Active channels

The total number of active PJSIP trunk channels.

DEPENDENT asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}]

Preprocessing:

- JSONPATH: $.pjsip.trunks[?(@.ObjectName=='{#OBJECTNAME}')].active_channels.first()

Asterisk "{#QUEUE}": Logged in

The number of queue members.

DEPENDENT asterisk.queue.loggedin[{#QUEUE}]

Preprocessing:

- JSONPATH: $.queue.queues[?(@.Queue=='{#QUEUE}')].LoggedIn.first()

Asterisk "{#QUEUE}": Available

The number of available queue members.

DEPENDENT asterisk.queue.available[{#QUEUE}]

Preprocessing:

- JSONPATH: $.queue.queues[?(@.Queue=='{#QUEUE}')].Available.first()

Asterisk "{#QUEUE}": Callers

The number incoming calls in queue.

DEPENDENT asterisk.queue.callers[{#QUEUE}]

Preprocessing:

- JSONPATH: $.queue.queues[?(@.Queue=='{#QUEUE}')].Callers.first()

Zabbix_raw_items Asterisk: Get stats

Asterisk system information in JSON format.

HTTP_AGENT asterisk.get_stats

Preprocessing:

- JAVASCRIPT: The text is too long. Please see the template.

Triggers

Name Description Expression Severity Dependencies and additional info
Asterisk: Service is down

-

last(/Asterisk by HTTP/net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"])=0 AVERAGE

Manual close: YES

Asterisk: Service response time is too high (over {$AMI.RESPONSE_TIME.MAX.WARN} for 5m)

-

min(/Asterisk by HTTP/net.tcp.service.perf["tcp","{HOST.CONN}","{$AMI.PORT}"],5m)>{$AMI.RESPONSE_TIME.MAX.WARN} WARNING

Manual close: YES

Depends on:

- Asterisk: Service is down

Asterisk: Version has changed (new version: {ITEM.VALUE})

Asterisk version has changed. Ack to close.

last(/Asterisk by HTTP/asterisk.version,#1)<>last(/Asterisk by HTTP/asterisk.version,#2) and length(last(/Asterisk by HTTP/asterisk.version))>0 INFO

Manual close: YES

Asterisk: has been restarted (uptime < 10m)

Uptime is less than 10 minutes

last(/Asterisk by HTTP/asterisk.uptime)<10m INFO

Manual close: YES

Asterisk: Failed to fetch AMI page (or no data for 30m)

Zabbix has not received data for items for the last 30 minutes.

nodata(/Asterisk by HTTP/asterisk.uptime,30m)=1 WARNING

Manual close: YES

Depends on:

- Asterisk: Service is down

Asterisk: has been reloaded (uptime < 10m)

Uptime is less than 10 minutes

last(/Asterisk by HTTP/asterisk.uptime_reload)<10m INFO

Manual close: YES

Asterisk: Total number of active channels of SIP trunks is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"} for 10m)

The SIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"} WARNING
Asterisk: Total number of active channels of IAX trunks is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"} for 10m)

The IAX trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"} WARNING
Asterisk: Total number of active channels of PJSIP trunks is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"} for 10m)

The PJSIP trunks may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"} WARNING
SIP trunk "{#OBJECTNAME}": SIP trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The SIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNREACHABLE" AVERAGE
SIP trunk "{#OBJECTNAME}": Number of the SIP trunk "{#OBJECTNAME}" active channels is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} for 10m)

The SIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.sip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} WARNING
IAX trunk "{#OBJECTNAME}": IAX trunk {#OBJECTNAME} has a state {ITEM.VALUE}

The IAX trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNREACHABLE" AVERAGE
IAX trunk "{#OBJECTNAME}": Number of the IAX trunk "{#OBJECTNAME}" active channels is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} for 10m)

The IAX trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.iax.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} WARNING
PJSIP trunk "{#OBJECTNAME}": PJSIP trunk {#OBJECTNAME} has a state Unavailable

The PJSIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.

last(/Asterisk by HTTP/asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}])="Unavailable" AVERAGE
PJSIP trunk "{#OBJECTNAME}": Number of the PJSIP trunk "{#OBJECTNAME}" active channels is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} for 10m)

The PJSIP trunk may not be able to process new calls.

min(/Asterisk by HTTP/asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} WARNING
"{#QUEUE}": Number of callers in the queue "{#QUEUE}" is too high (over {$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"} for 10m)

There is a large number of calls in the queue.

min(/Asterisk by HTTP/asterisk.queue.callers[{#QUEUE}],10m)>{$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"} WARNING

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide a feedback, discuss the template or ask for help with it at ZABBIX forums.

References

https://wiki.asterisk.org/wiki/display/AST/Home

Articles and documentation

+ Propose new article
πŸ‘ Image

Request custom integration

Zabbix integration team will develop custom integration based on your requirements and Zabbix best practices.

Request
πŸ‘ Image

Propose integration

Have you already developed high quality integration and want to submit to Zabbix integration repository?

Propose