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

template_cctv_hikvision_camera.yaml « hikvision « cctv « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 190afeb7ec924021418e9c208d9ea7783c04549c (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
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
zabbix_export:
  version: '6.0'
  date: '2021-08-24T06:09:11Z'
  groups:
    -
      uuid: d37f71c7e3f7469bab645852a69a2018
      name: 'Templates/Video surveillance'
  templates:
    -
      uuid: 3fb4020df2984b0ab64dfd8355ff5c65
      template: 'Hikvision camera by HTTP'
      name: 'Hikvision camera by HTTP'
      description: 'Template tooling version used: 0.38'
      groups:
        -
          name: 'Templates/Video surveillance'
      items:
        -
          uuid: e889b3a7e6044f0284081f9d6427b416
          name: 'Hikvision camera: Boot loader released date'
          type: DEPENDENT
          key: hikvision_cam.boot_released_date
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.bootReleasedDate
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 61c6f0073e604a449d8f724d762cfb7f
          name: 'Hikvision camera: Boot loader version'
          type: DEPENDENT
          key: hikvision_cam.boot_version
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: SOFTWARE_APP_E
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.bootVersion
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 247a70ed0cc543d69183a6a793cd9978
          name: 'Hikvision camera: CPU utilization'
          type: DEPENDENT
          key: hikvision_cam.cpu.util
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: '%'
          description: 'CPU utilization in %'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceStatus.CPUList.CPU.cpuUtilization
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hikvision_cam.get_status
          tags:
            -
              tag: Application
              value: CPU
          triggers:
            -
              uuid: 0ae4dbcc05544fb7b67183fcf3b9654b
              expression: 'min(/Hikvision camera by HTTP/hikvision_cam.cpu.util,5m)>{$CPU.UTIL.CRIT}'
              name: 'Hikvision camera: High CPU utilization (over {$CPU.UTIL.CRIT}% for 5m)'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'CPU utilization is too high. The system might be slow to respond.'
        -
          uuid: 7e65f407b515429caf415820dd633b0e
          name: 'Hikvision camera: Current device time'
          type: DEPENDENT
          key: hikvision_cam.current_device_time
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceStatus.currentDeviceTime
              error_handler: DISCARD_VALUE
          master_item:
            key: hikvision_cam.get_status
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 42b0f3ae08cf4730a52ea2ddda6f5bae
          name: 'Hikvision camera: Device description'
          type: DEPENDENT
          key: hikvision_cam.device_description
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: NOTES
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.deviceDescription
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 4abc7dcef6ec4b97bd1350d2e93f58d4
          name: 'Hikvision camera: Device ID'
          type: DEPENDENT
          key: hikvision_cam.device_id
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.deviceID
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: f4e6f9d05fea4489a9eaa47effe66ceb
          name: 'Hikvision camera: Device location'
          type: DEPENDENT
          key: hikvision_cam.device_location
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: LOCATION
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.deviceLocation
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 278a04c86c22419886aa64fad8e05c9e
          name: 'Hikvision camera: Device name'
          type: DEPENDENT
          key: hikvision_cam.device_name
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: NAME
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.deviceName
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 84d86e688a31402a82798f9e2ff04ab8
          name: 'Hikvision camera: Device type'
          type: DEPENDENT
          key: hikvision_cam.device_type
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: TYPE
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.deviceType
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 66ee550f4838455e9500561d790a76d1
          name: 'Hikvision camera: Encoder released date'
          type: DEPENDENT
          key: hikvision_cam.encoder_released_date
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: SOFTWARE_APP_D
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.encoderReleasedDate
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 4798d54b70ee445293c12b3a8038b8c8
          name: 'Hikvision camera: Encoder version'
          type: DEPENDENT
          key: hikvision_cam.encoder_version
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: SOFTWARE_APP_C
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.encoderVersion
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: ac6ee4d15c584709a7bdf2b89048aacc
          name: 'Hikvision camera: Firmware released date'
          type: DEPENDENT
          key: hikvision_cam.firmware_released_date
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: SOFTWARE_APP_B
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.firmwareReleasedDate
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: eafe1a75a24c479cb5bf116be2272375
          name: 'Hikvision camera: Firmware version'
          type: DEPENDENT
          key: hikvision_cam.firmware_version
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: SOFTWARE_APP_A
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.firmwareVersion
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
          triggers:
            -
              uuid: 3c0b5a0046894a54803cd984cda13fa2
              expression: 'last(/Hikvision camera by HTTP/hikvision_cam.firmware_version,#1)<>last(/Hikvision camera by HTTP/hikvision_cam.firmware_version,#2) and length(last(/Hikvision camera by HTTP/hikvision_cam.firmware_version))>0'
              name: 'Hikvision camera: Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'Hikvision camera version has changed. Ack to close.'
              manual_close: 'YES'
        -
          uuid: 0ddd3af82fb64b75821dc1fab96c16ab
          name: 'Hikvision camera: Get device info'
          type: HTTP_AGENT
          key: hikvision_cam.get_info
          history: '0'
          trends: '0'
          value_type: TEXT
          authtype: DIGEST
          username: '{$USER}'
          password: '{$PASSWORD}'
          description: 'Used to get the device information'
          preprocessing:
            -
              type: CHECK_NOT_SUPPORTED
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
              error_handler_params: '{"html":{"head":{"title":"Connection error"}}}'
            -
              type: XML_TO_JSON
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
              error_handler_params: '{"html":{"head":{"title":"Connection error"}}}'
          url: 'http://{HOST.CONN}:{$HIKVISION_ISAPI_PORT}/ISAPI/System/deviceInfo'
          status_codes: '200,401'
          tags:
            -
              tag: Application
              value: 'Zabbix raw items'
        -
          uuid: d0fc2ebf4ae140b68546e2425321f797
          name: 'Hikvision camera: Get device info: Login status'
          type: DEPENDENT
          key: hikvision_cam.get_info.login_status
          delay: '0'
          history: 7d
          valuemap:
            name: 'Login status'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var data = JSON.parse(value);
                  
                  if ("html" in data){
                      if (data.html.head.title === "Document Error: Unauthorized")
                         {return 1}
                      else if (data.html.head.title === "Connection error")
                         {return 2}
                  }
                  return 0;
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: Status
        -
          uuid: 1ad3e3c9f60043a58f63addc8768c887
          name: 'Hikvision camera: Get system status'
          type: HTTP_AGENT
          key: hikvision_cam.get_status
          history: '0'
          trends: '0'
          value_type: TEXT
          authtype: DIGEST
          username: '{$USER}'
          password: '{$PASSWORD}'
          description: 'It is used to get the status information of the device'
          preprocessing:
            -
              type: CHECK_NOT_SUPPORTED
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
              error_handler_params: '{"html":{"head":{"title":"Connection error"}}}'
            -
              type: XML_TO_JSON
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
              error_handler_params: '{"html":{"head":{"title":"Connection error"}}}'
          url: 'http://{HOST.CONN}:{$HIKVISION_ISAPI_PORT}/ISAPI/System/status'
          status_codes: '200,401'
          tags:
            -
              tag: Application
              value: 'Zabbix raw items'
        -
          uuid: ebca4ac32e2e4bfd8bf3cdae155a4ee6
          name: 'Hikvision camera: Get system status: Login status'
          type: DEPENDENT
          key: hikvision_cam.get_status.login_status
          delay: '0'
          history: 7d
          valuemap:
            name: 'Login status'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var data = JSON.parse(value);
                  
                  if ("html" in data){
                      if (data.html.head.title === "Document Error: Unauthorized")
                         {return 1}
                      else if (data.html.head.title === "Connection error")
                         {return 2}
                  }
                  return 0;
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hikvision_cam.get_status
          tags:
            -
              tag: Application
              value: Status
        -
          uuid: 65f89830d9f041f9a1558936dfcffc5f
          name: 'Hikvision camera: Get streaming channels'
          type: HTTP_AGENT
          key: hikvision_cam.get_streaming
          history: '0'
          trends: '0'
          value_type: TEXT
          authtype: DIGEST
          username: '{$USER}'
          password: '{$PASSWORD}'
          description: 'Used to get the properties of streaming channels for the device'
          preprocessing:
            -
              type: CHECK_NOT_SUPPORTED
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
              error_handler_params: '{"html":{"head":{"title":"Connection error"}}}'
            -
              type: XML_TO_JSON
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
              error_handler_params: '{"html":{"head":{"title":"Connection error"}}}'
          url: 'http://{HOST.CONN}:{$HIKVISION_ISAPI_PORT}/ISAPI/Streaming/channels'
          status_codes: '200,401'
          tags:
            -
              tag: Application
              value: 'Zabbix raw items'
        -
          uuid: c90527e1a2a948b5a5f678ec0d981954
          name: 'Hikvision camera: Get streaming channels: Login status'
          type: DEPENDENT
          key: hikvision_cam.get_streaming.login_status
          delay: '0'
          history: 7d
          valuemap:
            name: 'Login status'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var data = JSON.parse(value);
                  
                  if ("html" in data){
                      if (data.html.head.title === "Document Error: Unauthorized")
                         {return 1}
                      else if (data.html.head.title === "Connection error")
                         {return 2}
                  }
                  return 0;
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hikvision_cam.get_streaming
          tags:
            -
              tag: Application
              value: Status
        -
          uuid: 03aecf4021c2402bb415798ef339b914
          name: 'Hikvision camera: Hardware version'
          type: DEPENDENT
          key: hikvision_cam.hardware_version
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.hardwareVersion
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: da9ec53ecc6b4c25b6539666eb9f6544
          name: 'Hikvision camera: MACaddress'
          type: DEPENDENT
          key: hikvision_cam.mac_address
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: MACADDRESS_A
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.macAddress
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: d1d026c6240c493387374b756b04452f
          name: 'Hikvision camera: Memory utilization'
          type: DEPENDENT
          key: hikvision_cam.memory.usage
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: '%'
          description: 'Memory utilization in %'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceStatus.MemoryList.Memory.memoryUsage
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hikvision_cam.get_status
          tags:
            -
              tag: Application
              value: Memory
          triggers:
            -
              uuid: 62cfa0b87f234f1cb67b9b5b6b2fa8f2
              expression: 'min(/Hikvision camera by HTTP/hikvision_cam.memory.usage,5m)>{$MEMORY.UTIL.MAX}'
              name: 'Hikvision camera: High memory utilization (>{$MEMORY.UTIL.MAX}% for 5m)'
              priority: AVERAGE
              description: 'The system is running out of free memory.'
        -
          uuid: b295689d34934401b0eda407edaee426
          name: 'Hikvision camera: Model'
          type: DEPENDENT
          key: hikvision_cam.model
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: MODEL
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.model
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: b6715593c52a4255ae6a4f68c3de6b6d
          name: 'Hikvision camera: Serial number'
          type: DEPENDENT
          key: hikvision_cam.serial_number
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: SERIALNO_A
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.serialNumber
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
          triggers:
            -
              uuid: 281999cbd6324aacbbb86b4945000c60
              expression: 'last(/Hikvision camera by HTTP/hikvision_cam.serial_number,#1)<>last(/Hikvision camera by HTTP/hikvision_cam.serial_number,#2) and length(last(/Hikvision camera by HTTP/hikvision_cam.serial_number))>0'
              name: 'Hikvision camera: Camera has been replaced (new serial number received)'
              priority: INFO
              description: 'Camera serial number has changed. Ack to close'
              manual_close: 'YES'
        -
          uuid: 72ffbe3d976b437ab5df06b32a5c4b12
          name: 'Hikvision camera: Supported beep'
          type: DEPENDENT
          key: hikvision_cam.support_beep
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.supportBeep
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 03d220eb782346269de6b0867ed3acd3
          name: 'Hikvision camera: Supported video loss'
          type: DEPENDENT
          key: hikvision_cam.support_video_loss
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.supportVideoLoss
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: d29814c630f94d5cabdc350d8b161b5b
          name: 'Hikvision camera: System contact'
          type: DEPENDENT
          key: hikvision_cam.system_contact
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          inventory_link: CONTACT
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.systemContact
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 8678cee9999b45f1975f9639c8c197af
          name: 'Hikvision camera: Telecontrol ID'
          type: DEPENDENT
          key: hikvision_cam.telecontrol_id
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceInfo.telecontrolID
              error_handler: DISCARD_VALUE
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 24h
          master_item:
            key: hikvision_cam.get_info
          tags:
            -
              tag: Application
              value: 'Hikvision camera'
        -
          uuid: 4e680a5e347948fe8118b58c2c62d55f
          name: 'Hikvision camera: Uptime'
          type: DEPENDENT
          key: hikvision_cam.uptime
          delay: '0'
          history: 7d
          trends: '0'
          units: uptime
          description: 'System uptime in ''N days, hh:mm:ss'' format.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.DeviceStatus.deviceUpTime
              error_handler: DISCARD_VALUE
          master_item:
            key: hikvision_cam.get_status
          tags:
            -
              tag: Application
              value: Status
          triggers:
            -
              uuid: f46b43fe9b354990929e7fdb80b792ec
              expression: 'last(/Hikvision camera by HTTP/hikvision_cam.uptime)<10m'
              name: 'Hikvision camera: has been restarted (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes'
              manual_close: 'YES'
      discovery_rules:
        -
          uuid: 00647c38d30d44378bdcf573178063ec
          name: 'PTZ discovery'
          type: HTTP_AGENT
          key: hikvision_cam.ptz.discovery
          delay: 1d
          authtype: DIGEST
          username: '{$USER}'
          password: '{$PASSWORD}'
          item_prototypes:
            -
              uuid: bb3be316a5fc4b25bd15c903909b7746
              name: 'Hikvision camera: Get PTZ info: Channel "{#PTZ_CHANNEL_ID}": Login status'
              type: DEPENDENT
              key: 'hikvision_cam.get_ptz.login_status[{#PTZ_CHANNEL_ID}]'
              delay: '0'
              history: 7d
              valuemap:
                name: 'Login status'
              preprocessing:
                -
                  type: JAVASCRIPT
                  parameters:
                    - |
                      var data = JSON.parse(value);
                      
                      if ("html" in data){
                          if (data.html.head.title === "Document Error: Unauthorized")
                             {return 1}
                          else if (data.html.head.title === "Connection error")
                             {return 2}
                      }
                      return 0;
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'hikvision_cam.get_ptz[{#PTZ_CHANNEL_ID}]'
              tags:
                -
                  tag: Application
                  value: 'Zabbix raw items'
              trigger_prototypes:
                -
                  uuid: 7ce39ff8b5f14fcbb7b575f9c44a9efd
                  expression: 'last(/Hikvision camera by HTTP/hikvision_cam.get_ptz.login_status[{#PTZ_CHANNEL_ID}])=1'
                  name: 'Hikvision camera:Authorisation error on get PTZ channels'
                  priority: WARNING
                  description: 'Check the correctness of the authorization data'
                  manual_close: 'YES'
                  dependencies:
                    -
                      name: 'Hikvision camera: Authorisation error'
                      expression: |
                        last(/Hikvision camera by HTTP/hikvision_cam.get_info.login_status)=1 or
                        last(/Hikvision camera by HTTP/hikvision_cam.get_streaming.login_status)=1 or
                        last(/Hikvision camera by HTTP/hikvision_cam.get_status.login_status)=1
                -
                  uuid: c702b7321b664f5d950b0d879bbd7371
                  expression: 'last(/Hikvision camera by HTTP/hikvision_cam.get_ptz.login_status[{#PTZ_CHANNEL_ID}])=2'
                  name: 'Hikvision camera: Error receiving data on PTZ channels'
                  priority: WARNING
                  description: 'Check the availability of the HTTP port'
                  manual_close: 'YES'
                  dependencies:
                    -
                      name: 'Hikvision camera: Error receiving data'
                      expression: |
                        last(/Hikvision camera by HTTP/hikvision_cam.get_info.login_status)=2 or
                        last(/Hikvision camera by HTTP/hikvision_cam.get_streaming.login_status)=2 or
                        last(/Hikvision camera by HTTP/hikvision_cam.get_status.login_status)=2
            -
              uuid: 6799d99ad02743a1b294b80bbed52280
              name: 'Hikvision camera: Get PTZ info'
              type: HTTP_AGENT
              key: 'hikvision_cam.get_ptz[{#PTZ_CHANNEL_ID}]'
              history: '0'
              trends: '0'
              value_type: TEXT
              authtype: DIGEST
              username: '{$USER}'
              password: '{$PASSWORD}'
              description: 'High precision positioning which is accurate to a bit after the decimal point'
              preprocessing:
                -
                  type: CHECK_NOT_SUPPORTED
                  parameters:
                    - ''
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '{"html":{"head":{"title":"Connection error"}}}'
                -
                  type: XML_TO_JSON
                  parameters:
                    - ''
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '{"html":{"head":{"title":"Connection error"}}}'
              url: 'http://{HOST.CONN}:{$HIKVISION_ISAPI_PORT}/ISAPI/PTZCtrl/channels/{#PTZ_CHANNEL_ID}/status'
              status_codes: '200,401'
              tags:
                -
                  tag: Application
                  value: 'Zabbix raw items'
            -
              uuid: 16225fb78f414308829d035cd32f8468
              name: 'Channel "{#PTZ_CHANNEL_ID}": Absolute zoom'
              type: DEPENDENT
              key: 'hikvision_cam.ptz.absolute_zoom[{#PTZ_CHANNEL_ID}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: '!x'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.PTZStatus.AbsoluteHigh.absoluteZoom
                  error_handler: DISCARD_VALUE
                -
                  type: MULTIPLIER
                  parameters:
                    - '0.1'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'hikvision_cam.get_ptz[{#PTZ_CHANNEL_ID}]'
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: PTZ channel "{#PTZ_CHANNEL_ID}"'
            -
              uuid: 6282376b25a9462e84b748d011f2fbf6
              name: 'Channel "{#PTZ_CHANNEL_ID}": Azimuth'
              type: DEPENDENT
              key: 'hikvision_cam.ptz.azimuth[{#PTZ_CHANNEL_ID}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: '!°'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.PTZStatus.AbsoluteHigh.azimuth
                  error_handler: DISCARD_VALUE
                -
                  type: MULTIPLIER
                  parameters:
                    - '0.1'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'hikvision_cam.get_ptz[{#PTZ_CHANNEL_ID}]'
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: PTZ channel "{#PTZ_CHANNEL_ID}"'
            -
              uuid: da148a9826724869a58d286a07edc036
              name: 'Channel "{#PTZ_CHANNEL_ID}": Elevation'
              type: DEPENDENT
              key: 'hikvision_cam.ptz.elevation[{#PTZ_CHANNEL_ID}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: '!°'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.PTZStatus.AbsoluteHigh.elevation
                  error_handler: DISCARD_VALUE
                -
                  type: MULTIPLIER
                  parameters:
                    - '0.1'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'hikvision_cam.get_ptz[{#PTZ_CHANNEL_ID}]'
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: PTZ channel "{#PTZ_CHANNEL_ID}"'
          trigger_prototypes:
            -
              uuid: dbf391b5e18b4e018d889e460b7acc74
              expression: |
                last(/Hikvision camera by HTTP/hikvision_cam.ptz.absolute_zoom[{#PTZ_CHANNEL_ID}],#1)<>last(/Hikvision camera by HTTP/hikvision_cam.ptz.absolute_zoom[{#PTZ_CHANNEL_ID}],#2) or 
                last(/Hikvision camera by HTTP/hikvision_cam.ptz.azimuth[{#PTZ_CHANNEL_ID}],#1)<>last(/Hikvision camera by HTTP/hikvision_cam.ptz.azimuth[{#PTZ_CHANNEL_ID}],#2) or 
                last(/Hikvision camera by HTTP/hikvision_cam.ptz.elevation[{#PTZ_CHANNEL_ID}],#1)<>last(/Hikvision camera by HTTP/hikvision_cam.ptz.elevation[{#PTZ_CHANNEL_ID}],#2)
              name: 'Channel "{#PTZ_CHANNEL_ID}": PTZ position changed'
              priority: INFO
              description: 'The direction of the camera has changed'
              manual_close: 'YES'
          url: 'http://{HOST.CONN}:{$HIKVISION_ISAPI_PORT}/ISAPI/PTZCtrl/channels'
          status_codes: '200,401'
          preprocessing:
            -
              type: XML_TO_JSON
              parameters:
                - ''
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var data = JSON.parse(value);
                  var out = [];
                  
                  if ("PTZChannel" in data.PTZChannelList) {
                      out.push({
                          "{#PTZ_CHANNEL_ID}": data.PTZChannelList.PTZChannel.id
                      })
                  }
                  
                  return JSON.stringify(out);
        -
          uuid: 0bf00b49acd448ddbd1f4fac7630c40e
          name: 'Streaming channels discovery'
          type: HTTP_AGENT
          key: hikvision_cam.streaming.discovery
          delay: 1d
          authtype: DIGEST
          username: '{$USER}'
          password: '{$PASSWORD}'
          filter:
            evaltype: AND
            conditions:
              -
                macro: '{#CHANNEL_ENABLED}'
                value: 'true'
                formulaid: A
          item_prototypes:
            -
              uuid: 90ef1dd6e3d04ce8ab84731377c07ea6
              name: 'Channel "{#CHANNEL_ID}": Constant bitRate'
              type: DEPENDENT
              key: 'hikvision_cam.constant_bit_rate[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              units: '!kbit/s'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.constantBitRate'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$.[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: b992569a9db346ac85886fe7a5e55074
              name: 'Channel "{#CHANNEL_ID}": Fixed quality'
              type: DEPENDENT
              key: 'hikvision_cam.fixed_quality[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              units: '%'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.fixedQuality'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 7343f2206cfd4942976b5dca214a7558
              name: 'Channel "{#CHANNEL_ID}": GovLength'
              type: DEPENDENT
              key: 'hikvision_cam.gov_length[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.GovLength'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: ef1df8955ab84efab5ae9be340715431
              name: 'Channel "{#CHANNEL_ID}": H264Profile'
              type: DEPENDENT
              key: 'hikvision_cam.h264Profile[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.H264Profile'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: ce45290377cc402bacda95ea8a136946
              name: 'Channel "{#CHANNEL_ID}": Key frame interval'
              type: DEPENDENT
              key: 'hikvision_cam.key_frame_interval[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.keyFrameInterval'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: MULTIPLIER
                  parameters:
                    - '0.01'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 4d621b75e2ef432a9cab88b61718125d
              name: 'Channel "{#CHANNEL_ID}": Frame rate (max)'
              type: DEPENDENT
              key: 'hikvision_cam.max_frame_rate[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              units: '!fps'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.maxFrameRate'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: MULTIPLIER
                  parameters:
                    - '0.01'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 12f1fadb9d364e6b96ab01b468c94891
              name: 'Channel "{#CHANNEL_ID}": Smoothing'
              type: DEPENDENT
              key: 'hikvision_cam.smoothing[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.smoothing'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 1854ab4fd6f14adf90c0ddb42712a4ef
              name: 'Channel "{#CHANNEL_ID}": Snapshot image type'
              type: DEPENDENT
              key: 'hikvision_cam.snap_shot_image_type[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.snapShotImageType'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: d1523faa362842ef9313ffc15a6d5e8c
              name: 'Channel "{#CHANNEL_ID}": VBR lower'
              type: DEPENDENT
              key: 'hikvision_cam.vbr_lower_cap[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              units: '!kbit/s'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.vbrLowerCap'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 725669dc6bfd4871a3133ab7fcd4c571
              name: 'Channel "{#CHANNEL_ID}": VBR upper'
              type: DEPENDENT
              key: 'hikvision_cam.vbr_upper_cap[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              units: '!kbit/s'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.vbrUpperCap'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 96ef96886e9244f08cf245f4253839b2
              name: 'Channel "{#CHANNEL_ID}": Video codec type'
              type: DEPENDENT
              key: 'hikvision_cam.video_codec_type[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.videoCodecType'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 59e8f0440ec04306a0c79cc8c9a5c91f
              name: 'Channel "{#CHANNEL_ID}": Video quality control type'
              type: DEPENDENT
              key: 'hikvision_cam.video_quality_control_type[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.videoQualityControlType'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 18f5eed445154a42828cea423db9ebec
              name: 'Channel "{#CHANNEL_ID}": Resolution height'
              type: DEPENDENT
              key: 'hikvision_cam.video_resolution_height[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              units: '!px'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.videoResolutionHeight'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 13f343a9c3804846a31867e942602199
              name: 'Channel "{#CHANNEL_ID}": Resolution width'
              type: DEPENDENT
              key: 'hikvision_cam.video_resolution_width[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              units: '!px'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.videoResolutionWidth'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
            -
              uuid: 2ccd4b38faf046b88a0983249ca0c4f6
              name: 'Channel "{#CHANNEL_ID}": Video scan type'
              type: DEPENDENT
              key: 'hikvision_cam.video_scan_type[{#CHANNEL_ID}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.StreamingChannelList.StreamingChannel[?(@.id=={#CHANNEL_ID})].Video.videoScanType'
                  error_handler: DISCARD_VALUE
                -
                  type: JSONPATH
                  parameters:
                    - '$[0]'
                  error_handler: DISCARD_VALUE
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: hikvision_cam.get_streaming
              tags:
                -
                  tag: Application
                  value: 'Hikvision camera: Streaming channel "{#CHANNEL_ID}"'
          trigger_prototypes:
            -
              uuid: 16cf4d23b3c8410586703efca81ebe52
              expression: |
                last(/Hikvision camera by HTTP/hikvision_cam.video_resolution_height[{#CHANNEL_ID}])<>{$HIKVISION_STREAM_HEIGHT} or
                last(/Hikvision camera by HTTP/hikvision_cam.video_resolution_width[{#CHANNEL_ID}])<>{$HIKVISION_STREAM_WIDTH}
              name: 'Channel "{#CHANNEL_ID}": Invalid video stream resolution parameters'
              priority: WARNING
              description: |
                expected: {$HIKVISION_STREAM_WIDTH} px x {$HIKVISION_STREAM_HEIGHT} px
                received: {ITEM.LASTVALUE2} x {ITEM.LASTVALUE1}
              manual_close: 'YES'
            -
              uuid: 4f2a512d8f95414495dec5670e5e9680
              expression: |
                last(/Hikvision camera by HTTP/hikvision_cam.fixed_quality[{#CHANNEL_ID}],#1)<>last(/Hikvision camera by HTTP/hikvision_cam.fixed_quality[{#CHANNEL_ID}],#2) or
                last(/Hikvision camera by HTTP/hikvision_cam.constant_bit_rate[{#CHANNEL_ID}],#1)<>last(/Hikvision camera by HTTP/hikvision_cam.constant_bit_rate[{#CHANNEL_ID}],#2) or
                last(/Hikvision camera by HTTP/hikvision_cam.video_quality_control_type[{#CHANNEL_ID}],#1)<>last(/Hikvision camera by HTTP/hikvision_cam.video_quality_control_type[{#CHANNEL_ID}],#2) or
                last(/Hikvision camera by HTTP/hikvision_cam.video_resolution_width[{#CHANNEL_ID}],#1)<>last(/Hikvision camera by HTTP/hikvision_cam.video_resolution_width[{#CHANNEL_ID}],#2) or
                last(/Hikvision camera by HTTP/hikvision_cam.video_resolution_height[{#CHANNEL_ID}],#1)<>last(/Hikvision camera by HTTP/hikvision_cam.video_resolution_height[{#CHANNEL_ID}],#2)
              name: 'Channel "{#CHANNEL_ID}": Parameters of video stream are changed'
              priority: INFO
              manual_close: 'YES'
          url: 'http://{HOST.CONN}:{$HIKVISION_ISAPI_PORT}/ISAPI/Streaming/channels'
          status_codes: '200,401'
          preprocessing:
            -
              type: XML_TO_JSON
              parameters:
                - ''
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var data = JSON.parse(value);
                  var out = [];
                  
                  data.StreamingChannelList.StreamingChannel.forEach(function (field) {
                      out.push({
                          "{#CHANNEL_ID}": field.id,
                          "{#CHANNEL_NAME}": field.channelName,
                          "{#CHANNEL_ENABLED}": field.enabled
                      });
                  })
                  
                  return JSON.stringify(out);
          overrides:
            -
              name: 'trigger disabled non main channels'
              step: '1'
              filter:
                conditions:
                  -
                    macro: '{#CHANNEL_ID}'
                    value: '{$HIKVISION_MAIN_CHANNEL_ID}'
                    operator: NOT_MATCHES_REGEX
                    formulaid: A
              operations:
                -
                  operationobject: TRIGGER_PROTOTYPE
                  operator: LIKE
                  value: 'Invalid video stream resolution parameters'
                  status: ENABLED
                  discover: NO_DISCOVER
      macros:
        -
          macro: '{$CPU.UTIL.CRIT}'
          value: '90'
        -
          macro: '{$HIKVISION_ISAPI_PORT}'
          value: '80'
          description: 'ISAPI port on device'
        -
          macro: '{$HIKVISION_MAIN_CHANNEL_ID}'
          value: '101'
          description: 'Main video stream ID'
        -
          macro: '{$HIKVISION_STREAM_HEIGHT}'
          value: '1080'
          description: 'Main video stream image height'
        -
          macro: '{$HIKVISION_STREAM_WIDTH}'
          value: '1920'
          description: 'Main video stream image width'
        -
          macro: '{$MEMORY.UTIL.MAX}'
          value: '95'
        -
          macro: '{$PASSWORD}'
          type: SECRET_TEXT
        -
          macro: '{$USER}'
          value: admin
      valuemaps:
        -
          uuid: 4c14241141504a9d852d83965c309f31
          name: 'Login status'
          mappings:
            -
              value: '0'
              newvalue: OK
            -
              value: '1'
              newvalue: Unauthorized
            -
              value: '2'
              newvalue: 'Connection error'
  triggers:
    -
      uuid: 2bd6d99edd0f4b2d8045e43e4586b637
      expression: |
        last(/Hikvision camera by HTTP/hikvision_cam.get_info.login_status)=1 or
        last(/Hikvision camera by HTTP/hikvision_cam.get_streaming.login_status)=1 or
        last(/Hikvision camera by HTTP/hikvision_cam.get_status.login_status)=1
      name: 'Hikvision camera: Authorisation error'
      priority: WARNING
      description: 'Check the correctness of the authorization data'
      manual_close: 'YES'
    -
      uuid: 58b5d210fe24434b9aaa365fba764742
      expression: |
        last(/Hikvision camera by HTTP/hikvision_cam.get_info.login_status)=2 or
        last(/Hikvision camera by HTTP/hikvision_cam.get_streaming.login_status)=2 or
        last(/Hikvision camera by HTTP/hikvision_cam.get_status.login_status)=2
      name: 'Hikvision camera: Error receiving data'
      priority: WARNING
      description: 'Check the availability of the HTTP port'
      manual_close: 'YES'
  graphs:
    -
      uuid: 30cfa75b2afb490f8448a63366577144
      name: 'Hikvision camera: CPU utilization'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        -
          drawtype: GRADIENT_LINE
          color: 1A7C11
          item:
            host: 'Hikvision camera by HTTP'
            key: hikvision_cam.cpu.util
    -
      uuid: 0cd19b0f8f57435e8b3e1284574e4b79
      name: 'Hikvision camera: Memory'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Hikvision camera by HTTP'
            key: hikvision_cam.memory.usage