Welcome to mirror list, hosted at ThFree Co, Russian Federation.

template_tel_asterisk_http.yaml « asterisk_http « tel « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f100feca491e3371121e3b924c6b9d79095523e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
zabbix_export:
  version: '6.0'
  date: '2021-12-14T17:44:29Z'
  groups:
    -
      uuid: 1d12408342854fd5a4436dd6d5d1bd4a
      name: Templates/Telephony
  templates:
    -
      uuid: 30cc187a4e994c39b07f53d86b5cc6bc
      template: 'Asterisk by HTTP'
      name: 'Asterisk by HTTP'
      description: |
        The template gets Asterisk metrics from AMI by HTTP agent.
        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.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/410060-discussion-thread-for-official-zabbix-template-asterisk
        
        Template tooling version used: 0.40
      groups:
        -
          name: Templates/Telephony
      items:
        -
          uuid: 72d074f6bb214ef9884d8cc4b1530ad3
          name: 'Asterisk: Active calls'
          type: DEPENDENT
          key: asterisk.active_calls
          delay: '0'
          history: 7d
          description: 'The number of active calls at the moment.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.active_calls
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: bb9ac1ac188b43239456477e13ae555f
          name: 'Asterisk: Active channels'
          type: DEPENDENT
          key: asterisk.active_channels
          delay: '0'
          history: 7d
          description: 'The number of active channels at the moment.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.active_channels
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: ccfc2a8a5880430196e2c874b66370ca
          name: 'Asterisk: Calls processed'
          type: DEPENDENT
          key: asterisk.calls_processed
          delay: '0'
          history: 7d
          description: 'The number of calls processed after the last service restart.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.calls_processed
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: 196af875a190438abd8de5a6803a550f
          name: 'Asterisk: Calls processed per second'
          type: DEPENDENT
          key: asterisk.calls_processed.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: 'The number of calls processed per second.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.calls_processed
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: 7db3e9cdae3d4bffa7429617e351fce1
          name: 'Asterisk: Get stats'
          type: HTTP_AGENT
          key: asterisk.get_stats
          history: '0'
          trends: '0'
          value_type: TEXT
          description: 'Asterisk system information in JSON format.'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var Ami = {
                      params: {
                          url: '{$AMI.URL}',
                          trunk: '{$AMI.TRUNK_REGEXP}'
                      },
                      api_request: new HttpRequest(),
                  
                      request: function (url, action) {
                          url += action;
                          Zabbix.log(4, '[ Asterisk ] Sending request: ' + url);
                          try {
                              response = Ami.api_request.get(url);
                          } catch (error) {
                              Zabbix.log(4, '[ Asterisk ] Get request returned error ' + error);
                              throw 'Get request returned error ' + error + '. Check debug log for more information.';
                          }
                          Zabbix.log(4, '[ Asterisk ] Received response with status code ' +
                              Ami.api_request.getStatus() + '\n' + response);
                  
                          if (Ami.api_request.getStatus() !== 200) {
                              var message = 'Request failed with status code ' + Ami.api_request.getStatus();
                              if (response !== null) {
                                  if (typeof response.message === 'string') {
                                      message += ': ' + response.message;
                                  }
                              }
                  
                              throw message + ' Check debug log for more information.';
                          }
                  
                          var match = response.match('Response: (.+)');
                          if (match !== null && match[1] !== 'Success' && match[1] !== 'Goodbye' && match[1] !== 'Follows') {
                              var responseText = match[1],
                                  message = 'Request failed with message ' + match[1];
                  
                              match = response.match('Message: (.+)');
                              if (match !== null && match[1]) {
                                  var responseMessage = match[1];
                                  message += ': ' + match[1];
                              }
                              if (responseText !== 'Error' || responseMessage !== 'No endpoints found') {
                                  throw message + '. Check debug log for more information.';
                              }
                          }
                  
                          return {
                              status: Ami.api_request.getStatus(),
                              body: response
                          };
                      }
                  };
                  
                  var asterisk = {
                      version: '',
                      uptime: 0,
                      uptime_reload: 0,
                      active_channels: 0,
                      active_calls: 0,
                      calls_processed: 0,
                      sip: {
                          trunks: [],
                          monitored_online: 0,
                          monitored_offline: 0,
                          unmonitored_online: 0,
                          unmonitored_offline: 0,
                          active_channels: 0,
                          total: 0
                      },
                      iax: {
                          trunks: [],
                          online: 0,
                          offline: 0,
                          unmonitored: 0,
                          active_channels: 0,
                          total: 0
                      },
                      pjsip: {
                          trunks: [],
                          available: 0,
                          unavailable: 0,
                          active_channels: 0,
                          total: 0
                      },
                      queue: {
                          queues: [],
                          total: 0
                      }
                  };
                  
                  function block2Object(text) {
                      var parts = [],
                          dict = {};
                  
                      text = text.replace(/^Output: /gm, '');
                  
                      text.split('\n').forEach(function (line) {
                          parts = line.split(':');
                          if (parts.length > 1) {
                              dict[parts.shift().trim()] = parts.join(':').trim();
                          }
                      })
                  
                      return dict;
                  }
                  
                  function text2Object(text) {
                      var blocks = text.split('\r\n\r\n'),
                          arr = [],
                          i = 1,
                          j = blocks.length - 2;
                  
                      for (i; i < j; i++) {
                          arr.push(block2Object(blocks[i]));
                      }
                  
                      return arr;
                  }
                  
                  function getSipPeers() {
                      var response = Ami.request(url, 'SIPpeers'),
                          elements = text2Object(response.body);
                      asterisk.sip.total = elements.length;
                      asterisk.sip.trunks = elements.filter(function (element) {
                          return element.ObjectName.search(Ami.params.trunk) != -1;
                      });
                      elements.forEach(function (element) {
                          if (element.IPaddress === '-none-') {
                              switch (element.Status) {
                                  case 'Unmonitored':
                                      asterisk.sip.unmonitored_offline++;
                                      break;
                  
                                  case 'UNKNOWN':
                                      asterisk.sip.monitored_offline++;
                                      break;
                              }
                          }
                          else {
                              if (element.Status === 'Unmonitored') {
                                  asterisk.sip.unmonitored_online++;
                              }
                              else {
                                  asterisk.sip.monitored_online++;
                                  if (element.Status.search('^OK') != -1) {
                                      element.Status = element.Status.split(' ')[0];
                                  }
                              }
                          }
                      });
                      asterisk.sip.trunks.forEach(function (trunk) {
                          var active_channels = channels.match(new RegExp('[^!J]SIP/' + escapeChars(trunk.ObjectName), 'g'));
                          trunk.active_channels = (active_channels === null) ? 0 : active_channels.length;
                          asterisk.sip.active_channels += trunk.active_channels;
                      });
                  }
                  
                  function getIaxPeerList() {
                      response = Ami.request(url, 'IAXpeerlist');
                      elements = text2Object(response.body);
                      asterisk.iax.total = elements.length;
                      asterisk.iax.trunks = elements.filter(function (element) {
                          return element.ObjectName.search(Ami.params.trunk) != -1;
                      });
                      elements.forEach(function (element) {
                          if (element.Status.search('^OK') != -1) {
                              element.Status = element.Status.split(' ')[0];
                          }
                          switch (element.Status) {
                              case 'Unmonitored':
                                  asterisk.iax.unmonitored++;
                                  break;
                  
                              case 'UNKNOWN':
                                  asterisk.iax.offline++;
                                  break;
                          }
                      });
                      asterisk.iax.online = asterisk.iax.total - asterisk.iax.offline;
                      asterisk.iax.trunks.forEach(function (trunk) {
                          var active_channels = channels.match(new RegExp('[^!](IAX2/' + escapeChars(trunk.ObjectName) +
                              '|IAX2/' + escapeChars(trunk.ObjectUsername) + ')', 'g'));
                          trunk.active_channels = (active_channels === null) ? 0 : active_channels.length;
                          asterisk.iax.active_channels += trunk.active_channels;
                      });
                  }
                  
                  function getPjsipShowEndpoints() {
                      response = Ami.request(url, 'PJSIPShowEndpoints');
                      elements = text2Object(response.body);
                      asterisk.pjsip.total = elements.length;
                      asterisk.pjsip.trunks = elements.filter(function (element) {
                          return element.ObjectName.search(Ami.params.trunk) != -1;
                      });
                  
                      elements.forEach(function (element) {
                          if (element.DeviceState === 'Unavailable') {
                              asterisk.pjsip.unavailable++;
                          }
                      });
                      asterisk.pjsip.available = asterisk.pjsip.total - asterisk.pjsip.unavailable;
                      asterisk.pjsip.trunks.forEach(function (trunk) {
                          var active_channels = channels.match(new RegExp('[^!]PJSIP/' + escapeChars(trunk.ObjectName), 'g'));
                          trunk.active_channels = (active_channels === null) ? 0 : active_channels.length;
                          asterisk.pjsip.active_channels += trunk.active_channels;
                      });
                  }
                  
                  function getQueueSummary() {
                      response = Ami.request(url, 'QueueSummary');
                      asterisk.queue.queues = text2Object(response.body);
                      asterisk.queue.total = asterisk.queue.queues.length;
                  }
                  
                  function escapeChars(str) {
                      return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
                  }
                  
                  function getUptimeSeconds(text) {
                      var date = {
                          years: 0,
                          weeks: 0,
                          days: 0,
                          hours: 0,
                          minutes: 0,
                          seconds: 0
                      };
                  
                      var fields = {
                          years: 'years?',
                          weeks: 'weeks?',
                          days: 'days?',
                          hours: 'hours?',
                          minutes: 'minutes?',
                          seconds: 'seconds?'
                      };
                  
                      Object.keys(fields).forEach(function (field) {
                          var match = text.match('(\\d+) ' + fields[field]);
                          if (match !== null && typeof match[1] !== 'undefined') {
                              date[field] = parseInt(match[1]);
                          }
                      });
                      return date.years * 220752000 + date.weeks * 604800 + date.days * 86400 +
                          date.hours * 3600 + date.minutes * 60 + date.seconds;
                  }
                  
                  var cookie = value.match(/mansession_id="([0-9A-z]+)"/);
                  if (cookie == null) {
                      throw 'Cannot find mansession_id with cookie in response.';
                  }
                  
                  var url = Ami.params.url.split('?')[0] + '?action=';
                  
                  Ami.api_request.addHeader('Cookie: mansession_id="' + cookie[1] + '"');
                  
                  var response = Ami.request(url, 'CoreSettings');
                  var coreSettings = block2Object(response.body);
                  if (typeof coreSettings.AsteriskVersion !== 'undefined') {
                      asterisk.version = coreSettings.AsteriskVersion;
                  }
                  
                  response = Ami.request(url, 'command&command=core%20show%20uptime');
                  var uptime = block2Object(response.body);
                  if (typeof uptime["System uptime"] !== 'undefined') {
                      asterisk.uptime = getUptimeSeconds(uptime["System uptime"]);
                  }
                  if (typeof uptime["Last reload"] !== 'undefined') {
                      asterisk.uptime_reload = getUptimeSeconds(uptime["Last reload"]);
                  }
                  
                  response = Ami.request(url, 'command&command=core%20show%20channels%20count');
                  channels = response.body;
                  var fields = {
                      active_channels: 'active channels?',
                      active_calls: 'active calls?',
                      calls_processed: 'calls? processed'
                  };
                  
                  Object.keys(fields).forEach(function (field) {
                      var match = channels.match('(\\d+) ' + fields[field]);
                      if (match !== null && typeof match[1] !== 'undefined') {
                          asterisk[field] = parseInt(match[1]);
                      }
                  });
                  
                  response = Ami.request(url, 'command&command=core%20show%20channels%20concise');
                  channels = response.body;
                  
                  response = Ami.request(url, 'ListCommands');
                  var list = response.body;
                  if (list.includes('SIPpeers')) {
                      getSipPeers();
                  }
                  if (list.includes('IAXpeerlist')) {
                      getIaxPeerList();
                  }
                  if (list.includes('PJSIPShowEndpoints')) {
                      getPjsipShowEndpoints();
                  }
                  if (list.includes('QueueSummary')) {
                      getQueueSummary();
                  }
                  
                  try {
                      response = Ami.request(url, 'Logoff');
                  }
                  catch (e) {}
                  
                  return JSON.stringify(asterisk);
          url: '{$AMI.URL}'
          query_fields:
            -
              name: action
              value: login
            -
              name: username
              value: '{$AMI.USERNAME}'
            -
              name: secret
              value: '{$AMI.SECRET}'
          retrieve_mode: HEADERS
          tags:
            -
              tag: Application
              value: 'Zabbix raw items'
        -
          uuid: d9900a1f096a4b89a2aa4af89f30b2cc
          name: 'Asterisk: IAX trunks active channels'
          type: DEPENDENT
          key: asterisk.iax.active_channels
          delay: '0'
          history: 7d
          description: 'The total number of IAX trunks active channels.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.iax.active_channels
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
          triggers:
            -
              uuid: 0ae0a5b6123a42dd9722219e5e5839df
              expression: 'min(/Asterisk by HTTP/asterisk.iax.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"}'
              name: 'Asterisk: Total number of active channels of IAX trunks is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"} for 10m)'
              priority: WARNING
              description: 'The IAX trunks may not be able to process new calls.'
        -
          uuid: 0798cf46d82041e6a7091698c7693ec5
          name: 'Asterisk: IAX offline peers'
          type: DEPENDENT
          key: asterisk.iax.offline
          delay: '0'
          history: 7d
          description: 'The number of offline IAX peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.iax.offline
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: bf741f5560734530be352341071c5984
          name: 'Asterisk: IAX online peers'
          type: DEPENDENT
          key: asterisk.iax.online
          delay: '0'
          history: 7d
          description: 'The number of online IAX peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.iax.online
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: ccb62e9b41da4f20b4ab19e4eecd598b
          name: 'Asterisk: IAX peers'
          type: DEPENDENT
          key: asterisk.iax.total
          delay: '0'
          history: 7d
          description: 'The total number of IAX peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.iax.total
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: cf5c07c1a09b4a10af21292b876fcb20
          name: 'Asterisk: IAX unmonitored peers'
          type: DEPENDENT
          key: asterisk.iax.unmonitored
          delay: '0'
          history: 7d
          description: 'The number of unmonitored IAX peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.iax.unmonitored
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: 5ae6135a49764db7b496f5d2378ddd77
          name: 'Asterisk: PJSIP trunks active channels'
          type: DEPENDENT
          key: asterisk.pjsip.active_channels
          delay: '0'
          history: 7d
          description: 'The total number of PJSIP trunks active channels.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.pjsip.active_channels
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
          triggers:
            -
              uuid: 9b158fe0efb4416cb6ad5d53b38c3e38
              expression: 'min(/Asterisk by HTTP/asterisk.pjsip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"}'
              name: 'Asterisk: Total number of active channels of PJSIP trunks is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"} for 10m)'
              priority: WARNING
              description: 'The PJSIP trunks may not be able to process new calls.'
        -
          uuid: cc07f186104842aabec3d26dcd4322d2
          name: 'Asterisk: PJSIP available endpoints'
          type: DEPENDENT
          key: asterisk.pjsip.available
          delay: '0'
          history: 7d
          description: 'The number of available PJSIP peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.pjsip.available
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: fdc888cb355a4b738be8a77354a7ce76
          name: 'Asterisk: PJSIP endpoints'
          type: DEPENDENT
          key: asterisk.pjsip.total
          delay: '0'
          history: 7d
          description: 'The total number of PJSIP peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.pjsip.total
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: 5c10fe1a4bfb4628be20137d0f1ec725
          name: 'Asterisk: PJSIP unavailable endpoints'
          type: DEPENDENT
          key: asterisk.pjsip.unavailable
          delay: '0'
          history: 7d
          description: 'The number of unavailable PJSIP peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.pjsip.unavailable
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: 2df0dca89a744e86b4f5a2cec673d427
          name: 'Asterisk: SIP trunks active channels'
          type: DEPENDENT
          key: asterisk.sip.active_channels
          delay: '0'
          history: 7d
          description: 'The total number of SIP trunks active channels.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.sip.active_channels
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
          triggers:
            -
              uuid: d2fde5d26d284a129346a12ba0949b60
              expression: 'min(/Asterisk by HTTP/asterisk.sip.active_channels,10m)>={$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"}'
              name: 'Asterisk: Total number of active channels of SIP trunks is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"} for 10m)'
              priority: WARNING
              description: 'The SIP trunks may not be able to process new calls.'
        -
          uuid: fb08ec8d143a41a097f8652c8261bad8
          name: 'Asterisk: SIP monitored offline'
          type: DEPENDENT
          key: asterisk.sip.monitored_offline
          delay: '0'
          history: 7d
          description: 'The number of monitored offline SIP peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.sip.monitored_offline
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: 23744b0a04b54637a7dbe1c7f8f5200f
          name: 'Asterisk: SIP monitored online'
          type: DEPENDENT
          key: asterisk.sip.monitored_online
          delay: '0'
          history: 7d
          description: 'The number of monitored online SIP peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.sip.monitored_online
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: fb78998a342942ac942a7e1632b98208
          name: 'Asterisk: SIP peers'
          type: DEPENDENT
          key: asterisk.sip.total
          delay: '0'
          history: 7d
          description: 'The total number of SIP peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.sip.total
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: ae21f8c13063402d9eece400a18c6167
          name: 'Asterisk: SIP unmonitored offline'
          type: DEPENDENT
          key: asterisk.sip.unmonitored_offline
          delay: '0'
          history: 7d
          description: 'The number of unmonitored offline SIP peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.sip.unmonitored_offline
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: 1cd5fb5232ca4f4398f85d959ac11b2c
          name: 'Asterisk: SIP unmonitored online'
          type: DEPENDENT
          key: asterisk.sip.unmonitored_online
          delay: '0'
          history: 7d
          description: 'The number of unmonitored online SIP peers.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.sip.unmonitored_online
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: 9c64cb54c2c541c1862558dcf8c6e3a3
          name: 'Asterisk: Total queues'
          type: DEPENDENT
          key: asterisk.total_queues
          delay: '0'
          history: 7d
          description: 'The number of configured queues.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.queue.total
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
        -
          uuid: 8395ab5b70a7433eb508c513995988bb
          name: 'Asterisk: Uptime'
          type: DEPENDENT
          key: asterisk.uptime
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: uptime
          description: 'System uptime in ''N days, hh:mm:ss'' format.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.uptime
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
          triggers:
            -
              uuid: 35ca01e504a548db9d4db8be1390d6b9
              expression: 'nodata(/Asterisk by HTTP/asterisk.uptime,30m)=1'
              name: 'Asterisk: Failed to fetch AMI page (or no data for 30m)'
              priority: WARNING
              description: 'Zabbix has not received data for items for the last 30 minutes.'
              manual_close: 'YES'
              dependencies:
                -
                  name: 'Asterisk: Service is down'
                  expression: 'last(/Asterisk by HTTP/net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"])=0'
            -
              uuid: 100d38b62c1d4ce298a9fadfbab19e4c
              expression: 'last(/Asterisk by HTTP/asterisk.uptime)<10m'
              name: 'Asterisk: has been restarted (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes'
              manual_close: 'YES'
        -
          uuid: 86e23b5b9fd64e6e840588d25921fcbf
          name: 'Asterisk: Uptime after reload'
          type: DEPENDENT
          key: asterisk.uptime_reload
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: uptime
          description: 'System uptime after a config reload in ''N days, hh:mm:ss'' format.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.uptime_reload
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
          triggers:
            -
              uuid: 4e99b65188264ba1aa80e24662f9b3cd
              expression: 'last(/Asterisk by HTTP/asterisk.uptime_reload)<10m'
              name: 'Asterisk: has been reloaded (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes'
              manual_close: 'YES'
        -
          uuid: 8ed124c5d61541c0ab1dcc3491fb05c6
          name: 'Asterisk: Version'
          type: DEPENDENT
          key: asterisk.version
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          description: 'Service version'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.version
          master_item:
            key: asterisk.get_stats
          tags:
            -
              tag: Application
              value: Asterisk
          triggers:
            -
              uuid: f1a260626ae6446d89e1e725e14c1098
              expression: 'last(/Asterisk by HTTP/asterisk.version,#1)<>last(/Asterisk by HTTP/asterisk.version,#2) and length(last(/Asterisk by HTTP/asterisk.version))>0'
              name: 'Asterisk: Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'Asterisk version has changed. Ack to close.'
              manual_close: 'YES'
        -
          uuid: 09102393dc6a4ac598f02d95801c6ca0
          name: 'Asterisk: Service response time'
          type: SIMPLE
          key: 'net.tcp.service.perf["tcp","{HOST.CONN}","{$AMI.PORT}"]'
          history: 7d
          value_type: FLOAT
          units: s
          description: 'Asterisk Manager API performance.'
          tags:
            -
              tag: Application
              value: Asterisk
          triggers:
            -
              uuid: dbc74502be01498194003dc1a3d90014
              expression: 'min(/Asterisk by HTTP/net.tcp.service.perf["tcp","{HOST.CONN}","{$AMI.PORT}"],5m)>{$AMI.RESPONSE_TIME.MAX.WARN}'
              name: 'Asterisk: Service response time is too high (over {$AMI.RESPONSE_TIME.MAX.WARN} for 5m)'
              priority: WARNING
              manual_close: 'YES'
              dependencies:
                -
                  name: 'Asterisk: Service is down'
                  expression: 'last(/Asterisk by HTTP/net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"])=0'
        -
          uuid: 58e18df6a5534395bf74d3babdb73170
          name: 'Asterisk: Service status'
          type: SIMPLE
          key: 'net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"]'
          history: 7d
          description: 'Asterisk Manager API port availability.'
          valuemap:
            name: 'Service state'
          preprocessing:
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          tags:
            -
              tag: Application
              value: Asterisk
          triggers:
            -
              uuid: 1fa3370fa93f4d07a2c470f993096554
              expression: 'last(/Asterisk by HTTP/net.tcp.service["tcp","{HOST.CONN}","{$AMI.PORT}"])=0'
              name: 'Asterisk: Service is down'
              priority: AVERAGE
              manual_close: 'YES'
      discovery_rules:
        -
          uuid: 3e7facc25a344cec8e384e8a9f8b372a
          name: 'IAX peers discovery'
          type: DEPENDENT
          key: asterisk.iax_peers.discovery
          delay: '0'
          item_prototypes:
            -
              uuid: 72d71ec4fa2b4e88a03d25e3bbe8771a
              name: 'IAX trunk "{#OBJECTNAME}": Active channels'
              type: DEPENDENT
              key: 'asterisk.iax.trunk.active_channels[{#OBJECTNAME}]'
              delay: '0'
              history: 7d
              description: 'The total number of active IAX trunk channels.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.iax.trunks[?(@.ObjectName==''{#OBJECTNAME}'')].active_channels.first()'
              master_item:
                key: asterisk.get_stats
              tags:
                -
                  tag: Application
                  value: 'Asterisk IAX trunks'
              trigger_prototypes:
                -
                  uuid: e2a6c7a9b6234e2aae20c9aa480f9ef1
                  expression: 'min(/Asterisk by HTTP/asterisk.iax.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"}'
                  name: 'IAX trunk "{#OBJECTNAME}": Number of the IAX trunk "{#OBJECTNAME}" active channels is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} for 10m)'
                  priority: WARNING
                  description: 'The IAX trunk may not be able to process new calls.'
            -
              uuid: bbde7e898b4b4d34b27308d6ddaf86fc
              name: 'IAX trunk "{#OBJECTNAME}": Status'
              type: DEPENDENT
              key: 'asterisk.iax.trunk.status[{#OBJECTNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: |
                IAX trunk status. Here are the possible states that a device state may have:
                Unmonitored
                UNKNOWN
                UNREACHABLE
                OK
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.iax.trunks[?(@.ObjectName==''{#OBJECTNAME}'')].Status.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: asterisk.get_stats
              tags:
                -
                  tag: Application
                  value: 'Asterisk IAX trunks'
              trigger_prototypes:
                -
                  uuid: db595245acef4ec9b771c266c14100d2
                  expression: 'last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.iax.trunk.status[{#OBJECTNAME}])="UNREACHABLE"'
                  name: 'IAX trunk "{#OBJECTNAME}": IAX trunk {#OBJECTNAME} has a state {ITEM.VALUE}'
                  priority: AVERAGE
                  description: 'The IAX trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.'
          master_item:
            key: asterisk.get_stats
          lld_macro_paths:
            -
              lld_macro: '{#OBJECTNAME}'
              path: $.ObjectName
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.iax.trunks
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        -
          uuid: 1a123ca04c7544bfa823a39b8a9fe84c
          name: 'PJSIP endpoints discovery'
          type: DEPENDENT
          key: asterisk.pjsip_endpoints.discovery
          delay: '0'
          item_prototypes:
            -
              uuid: ec8220a1aa814112908337a009f6fcac
              name: 'PJSIP trunk "{#OBJECTNAME}": Active channels'
              type: DEPENDENT
              key: 'asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}]'
              delay: '0'
              history: 7d
              description: 'The total number of active PJSIP trunk channels.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.pjsip.trunks[?(@.ObjectName==''{#OBJECTNAME}'')].active_channels.first()'
              master_item:
                key: asterisk.get_stats
              tags:
                -
                  tag: Application
                  value: 'Asterisk PJSIP trunks'
              trigger_prototypes:
                -
                  uuid: f192d555011c42c28c6a8f52c0388fe1
                  expression: 'min(/Asterisk by HTTP/asterisk.pjsip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"}'
                  name: 'PJSIP trunk "{#OBJECTNAME}": Number of the PJSIP trunk "{#OBJECTNAME}" active channels is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} for 10m)'
                  priority: WARNING
                  description: 'The PJSIP trunk may not be able to process new calls.'
            -
              uuid: c364b2ac50344372b155cbb98d9a7afe
              name: 'PJSIP trunk "{#OBJECTNAME}": Device state'
              type: DEPENDENT
              key: 'asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: |
                PJSIP trunk status. Here are the possible states that a device state may have:
                Unavailable
                Not in use
                In use
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.pjsip.trunks[?(@.ObjectName==''{#OBJECTNAME}'')].DeviceState.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: asterisk.get_stats
              tags:
                -
                  tag: Application
                  value: 'Asterisk PJSIP trunks'
              trigger_prototypes:
                -
                  uuid: 6f31d886d6954b82874d38646b233689
                  expression: 'last(/Asterisk by HTTP/asterisk.pjsip.trunk.devicestate[{#OBJECTNAME}])="Unavailable"'
                  name: 'PJSIP trunk "{#OBJECTNAME}": PJSIP trunk {#OBJECTNAME} has a state Unavailable'
                  priority: AVERAGE
                  description: 'The PJSIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.'
          master_item:
            key: asterisk.get_stats
          lld_macro_paths:
            -
              lld_macro: '{#OBJECTNAME}'
              path: $.ObjectName
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.pjsip.trunks
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        -
          uuid: 5a936a95d62f4b50a4f3db112a3e041f
          name: 'Queues discovery'
          type: DEPENDENT
          key: asterisk.queues.discovery
          delay: '0'
          item_prototypes:
            -
              uuid: c16d9df72ba749369726d4cfcc8b4f40
              name: '"{#QUEUE}": Available'
              type: DEPENDENT
              key: 'asterisk.queue.available[{#QUEUE}]'
              delay: '0'
              history: 7d
              description: 'The number of available queue members.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.queue.queues[?(@.Queue==''{#QUEUE}'')].Available.first()'
              master_item:
                key: asterisk.get_stats
              tags:
                -
                  tag: Application
                  value: 'Asterisk queue "{#QUEUE}"'
            -
              uuid: c271c7d76b2e49dea386bb08d60307d0
              name: '"{#QUEUE}": Callers'
              type: DEPENDENT
              key: 'asterisk.queue.callers[{#QUEUE}]'
              delay: '0'
              history: 7d
              description: 'The number incoming calls in queue.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.queue.queues[?(@.Queue==''{#QUEUE}'')].Callers.first()'
              master_item:
                key: asterisk.get_stats
              tags:
                -
                  tag: Application
                  value: 'Asterisk queue "{#QUEUE}"'
              trigger_prototypes:
                -
                  uuid: 4f72c6a755be465287f36b8b12d3175b
                  expression: 'min(/Asterisk by HTTP/asterisk.queue.callers[{#QUEUE}],10m)>{$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"}'
                  name: '"{#QUEUE}": Number of callers in the queue "{#QUEUE}" is too high (over {$AMI.QUEUE_CALLERS.MAX.WARN:"{#QUEUE}"} for 10m)'
                  priority: WARNING
                  description: 'There is a large number of calls in the queue.'
            -
              uuid: 8319ec55cf6f4e8590f180f1a81f37ed
              name: '"{#QUEUE}": Logged in'
              type: DEPENDENT
              key: 'asterisk.queue.loggedin[{#QUEUE}]'
              delay: '0'
              history: 7d
              description: 'The number of queue members.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.queue.queues[?(@.Queue==''{#QUEUE}'')].LoggedIn.first()'
              master_item:
                key: asterisk.get_stats
              tags:
                -
                  tag: Application
                  value: 'Asterisk queue "{#QUEUE}"'
          master_item:
            key: asterisk.get_stats
          lld_macro_paths:
            -
              lld_macro: '{#QUEUE}'
              path: $.Queue
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.queue.queues
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        -
          uuid: 675fc5b11cb1482db0c539dfb9100e75
          name: 'SIP peers discovery'
          type: DEPENDENT
          key: asterisk.sip_peers.discovery
          delay: '0'
          item_prototypes:
            -
              uuid: 9043578864494b13b249ee7bdf13820d
              name: 'SIP trunk "{#OBJECTNAME}": Active channels'
              type: DEPENDENT
              key: 'asterisk.sip.trunk.active_channels[{#OBJECTNAME}]'
              delay: '0'
              history: 7d
              description: 'The total number of active SIP trunk channels.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.sip.trunks[?(@.ObjectName==''{#OBJECTNAME}'')].active_channels.first()'
              master_item:
                key: asterisk.get_stats
              tags:
                -
                  tag: Application
                  value: 'Asterisk SIP trunks'
              trigger_prototypes:
                -
                  uuid: 51820b1326f84f51ba0e561946275133
                  expression: 'min(/Asterisk by HTTP/asterisk.sip.trunk.active_channels[{#OBJECTNAME}],10m)>={$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"}'
                  name: 'SIP trunk "{#OBJECTNAME}": Number of the SIP trunk "{#OBJECTNAME}" active channels is too high (over {$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN:"{#OBJECTNAME}"} for 10m)'
                  priority: WARNING
                  description: 'The SIP trunk may not be able to process new calls.'
            -
              uuid: df33da749e874f55be5f0c33cd201f62
              name: 'SIP trunk "{#OBJECTNAME}": Status'
              type: DEPENDENT
              key: 'asterisk.sip.trunk.status[{#OBJECTNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: |
                SIP trunk status. Here are the possible states that a device state may have:
                Unmonitored
                UNKNOWN
                UNREACHABLE
                OK
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.sip.trunks[?(@.ObjectName==''{#OBJECTNAME}'')].Status.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: asterisk.get_stats
              tags:
                -
                  tag: Application
                  value: 'Asterisk SIP trunks'
              trigger_prototypes:
                -
                  uuid: 39cac88e9263470da6e4b1a08f806c58
                  expression: 'last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNKNOWN" or last(/Asterisk by HTTP/asterisk.sip.trunk.status[{#OBJECTNAME}])="UNREACHABLE"'
                  name: 'SIP trunk "{#OBJECTNAME}": SIP trunk {#OBJECTNAME} has a state {ITEM.VALUE}'
                  priority: AVERAGE
                  description: 'The SIP trunk is unable to establish a connection with a neighbor due to network issues or incorrect configuration.'
          master_item:
            key: asterisk.get_stats
          lld_macro_paths:
            -
              lld_macro: '{#OBJECTNAME}'
              path: $.ObjectName
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.sip.trunks
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      macros:
        -
          macro: '{$AMI.PORT}'
          value: '5038'
          description: 'AMI port number for checking service availability.'
        -
          macro: '{$AMI.QUEUE_CALLERS.MAX.WARN}'
          value: '10'
          description: 'The maximum number of callers in a queue for trigger expression.'
        -
          macro: '{$AMI.RESPONSE_TIME.MAX.WARN}'
          value: 10s
          description: 'The Asterisk Manager API page maximum response time in seconds for trigger expression.'
        -
          macro: '{$AMI.SECRET}'
          value: zabbix
          description: 'The Asterisk Manager secret.'
        -
          macro: '{$AMI.TRUNK_ACTIVE_CHANNELS.MAX.WARN}'
          value: '28'
          description: 'The maximum number of busy channels of a trunk for trigger expression.'
        -
          macro: '{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"IAX"}'
          value: '28'
          description: 'The total maximum number of busy channels of IAX trunks for trigger expression.'
        -
          macro: '{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"PJSIP"}'
          value: '28'
          description: 'The total maximum number of busy channels of PJSIP trunks for trigger expression.'
        -
          macro: '{$AMI.TRUNK_ACTIVE_CHANNELS_TOTAL.MAX.WARN:"SIP"}'
          value: '28'
          description: 'The total maximum number of busy channels of SIP trunks for trigger expression.'
        -
          macro: '{$AMI.TRUNK_REGEXP}'
          value: trunk
          description: 'The regexp for the identification of trunk peers.'
        -
          macro: '{$AMI.URL}'
          value: 'http://asterisk:8088/asterisk/rawman'
          description: 'The Asterisk Manager API URL in the format `<scheme>://<host>:<port>/<prefix>/rawman`.'
        -
          macro: '{$AMI.USERNAME}'
          value: zabbix
          description: 'The Asterisk Manager name.'
      valuemaps:
        -
          uuid: d6e38832f2d44ec0bf6761e36fd7668f
          name: 'Service state'
          mappings:
            -
              value: '0'
              newvalue: Down
            -
              value: '1'
              newvalue: Up
  graphs:
    -
      uuid: 92b561a0aee24da9a7d9875f2293316d
      name: 'Asterisk: Calls stats'
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.active_channels
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.active_calls
        -
          sortorder: '2'
          color: F63100
          yaxisside: RIGHT
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.calls_processed.rate
    -
      uuid: 0e5d56155a1240108a4ffc2f3dc041be
      name: 'Asterisk: IAX peers'
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.iax.active_channels
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.iax.online
        -
          sortorder: '2'
          color: F63100
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.iax.offline
        -
          sortorder: '3'
          color: A54F10
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.iax.unmonitored
    -
      uuid: fd5b051daaf64df89856bec400bbc3a0
      name: 'Asterisk: PJSIP peers'
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.pjsip.active_channels
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.pjsip.available
        -
          sortorder: '2'
          color: F63100
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.pjsip.unavailable
    -
      uuid: 2781590218fe4cc9ade68446e5d11aa2
      name: 'Asterisk: SIP peers'
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.sip.active_channels
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.sip.monitored_online
        -
          sortorder: '2'
          color: F63100
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.sip.monitored_offline
        -
          sortorder: '3'
          color: A54F10
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.sip.unmonitored_online
        -
          sortorder: '4'
          color: FC6EA3
          item:
            host: 'Asterisk by HTTP'
            key: asterisk.sip.unmonitored_offline