<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export><version>5.0</version><date>2021-11-21T21:32:01Z</date><groups><group><name>Custom templates</name></group></groups><templates><template><template>Asterisk</template><name>Asterisk</name><description>## Description

Asterisk IP PBX template

## Overview


```
Zabbix template for Asterisk IP PBX  
  
  
Finds out the total number of concurrent channels on trunks. Each thunk's name should start with &quot;tru\_&quot;

Installation:

- Put userparameter\_asterisk.conf in /etc/zabbix/zabbix\_agentd.d/ , restart zabbix agent

- Put asterisk\_trunks and asterisk\_calls scripts in /etc/zabbix/externalscripts/ and add execute privileges

- Set up cronjob for asterisk\_trunks script like this:
# crontab -l
  
SHELL=/bin/bash  
# update Asterisk trunks info for zabbix
2 * * * * /etc/zabbix/externalscripts/asterisk\_trunks

- (Optional) If there're no enough permissions for /var/run/asterisk/asterisk.ctl then add following line in /etc/asterisk/asterisk.conf:
astctlpermissions = 775
, and restart Asterisk. Add zabbix user to group asterisk.

- Import Asterisk.xml template in Zabbix. Adjust values if necessary.
```


## Author

Oleg

</description><groups><group><name>Custom templates</name></group></groups><applications><application><name>Asterisk</name></application></applications><discovery_rules><discovery_rule><name>Asterisk trunks</name><key>asterisk.calls.discovery</key><delay>6;6/1-7,07:55-21:05;30/1-7,00:00-07:54;30/1-7,21:06-23:59</delay><description>Finds out number of channels sorted by trunks. Each thunk's name should start with &quot;tru_&quot;</description><item_prototypes><item_prototype><name>Calls in {#TRUNK}</name><type>CALCULATED</type><key>asterisk.calls[{#TRUNK}]</key><delay>6</delay><params>{#CALLS}</params><applications><application><name>Asterisk</name></application></applications><trigger_prototypes><trigger_prototype><expression>{last()}&gt;40</expression><name>Number of calls in {#TRUNK} is {#CALLS}</name><priority>AVERAGE</priority><tags><tag><tag>VoIP</tag></tag></tags></trigger_prototype></trigger_prototypes></item_prototype></item_prototypes><graph_prototypes><graph_prototype><name>Calls in {#TRUNK}</name><width>600</width><height>100</height><ymin_type_1>FIXED</ymin_type_1><graph_items><graph_item><drawtype>GRADIENT_LINE</drawtype><color>EE0000</color><item><host>Asterisk</host><key>asterisk.calls[{#TRUNK}]</key></item></graph_item></graph_items></graph_prototype></graph_prototypes></discovery_rule></discovery_rules><screens><screen><name>Calls</name><hsize>1</hsize><vsize>1</vsize><screen_items><screen_item><resourcetype>20</resourcetype><style>0</style><resource><name>Calls in {#TRUNK}</name><host>Asterisk</host></resource><width>500</width><height>100</height><x>0</x><y>0</y><colspan>1</colspan><rowspan>1</rowspan><elements>0</elements><valign>0</valign><halign>0</halign><dynamic>0</dynamic><sort_triggers>0</sort_triggers><url/><application/><max_columns>2</max_columns></screen_item></screen_items></screen></screens></template></templates></zabbix_export>
