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

template_server_dell_r720_http.yaml « dell_r720_http « dell « server « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fea9d216d1bf140f36df245598cfa77699479a06 (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
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
zabbix_export:
  version: '6.2'
  date: '2022-04-06T19:54:15Z'
  groups:
    -
      uuid: e960332b3f6c46a1956486d4f3f99fce
      name: 'Templates/Server hardware'
  templates:
    -
      uuid: 9643f22821104f809e2486be83e1816e
      template: 'DELL PowerEdge R720 by HTTP'
      name: 'DELL PowerEdge R720 by HTTP'
      description: |
        Template for DELL PowerEdge R720 servers with iDRAC 8/9 firmware 4.32 and later and Redfish API enabled.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/426752-discussion-thread-for-official-zabbix-dell-templates
        
        Template tooling version used: 0.41
      groups:
        -
          name: 'Templates/Server hardware'
      items:
        -
          uuid: 55124354a9944934acb01c8d2f8d43a6
          name: 'Dell R720: Firmware version'
          type: DEPENDENT
          key: dell.server.hw.firmware
          delay: '0'
          history: 2w
          trends: '0'
          value_type: CHAR
          description: 'This attribute defines the firmware version of a remote access card.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.firmware
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          master_item:
            key: dell.server.system.get
          tags:
            -
              tag: component
              value: system
          triggers:
            -
              uuid: c7c3d5301c8843528929123e1473af5f
              expression: 'last(/DELL PowerEdge R720 by HTTP/dell.server.hw.firmware,#1)<>last(/DELL PowerEdge R720 by HTTP/dell.server.hw.firmware,#2) and length(last(/DELL PowerEdge R720 by HTTP/dell.server.hw.firmware))>0'
              name: 'Dell R720: Firmware has changed'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: INFO
              description: 'Firmware version has changed. Ack to close.'
              manual_close: 'YES'
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: 6ef767b8b0a94ebc822c81abd9ee5a8b
          name: 'Dell R720: Hardware model name'
          type: DEPENDENT
          key: dell.server.hw.model
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          description: 'This attribute defines the model name of the system.'
          inventory_link: MODEL
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.model
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          master_item:
            key: dell.server.system.get
          tags:
            -
              tag: component
              value: system
        -
          uuid: 114dd17f872c491eb739f708ae86b340
          name: 'Dell R720: Hardware serial number'
          type: DEPENDENT
          key: dell.server.hw.serialnumber
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          description: 'This attribute defines the service tag of the system.'
          inventory_link: SERIALNO_A
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.serialnumber
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          master_item:
            key: dell.server.system.get
          tags:
            -
              tag: component
              value: system
          triggers:
            -
              uuid: 53caaec2a0664e879f85c263a43715c3
              expression: 'last(/DELL PowerEdge R720 by HTTP/dell.server.hw.serialnumber,#1)<>last(/DELL PowerEdge R720 by HTTP/dell.server.hw.serialnumber,#2) and length(last(/DELL PowerEdge R720 by HTTP/dell.server.hw.serialnumber))>0'
              name: 'Dell R720: Device has been replaced'
              event_name: 'Dell R720: Device has been replaced (new serial number received)'
              priority: INFO
              description: 'Device serial number has changed. Ack to close'
              manual_close: 'YES'
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: 3cce4b6aff674b29a80aa5369268d99d
          name: 'Dell R720: Overall system health status'
          type: DEPENDENT
          key: dell.server.status
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          description: 'This attribute defines the overall rollup status of all components in the system being monitored by the remote access card. Includes system, storage, IO devices, iDRAC, CPU, memory, etc.'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.status
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          master_item:
            key: dell.server.system.get
          tags:
            -
              tag: component
              value: system
          triggers:
            -
              uuid: da2b7ee5a60948d582327e8a5a9169b9
              expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.status,,"like","Critical")=1'
              name: 'Dell R720: Server is in a critical state'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'Please check the device for faults.'
              tags:
                -
                  tag: scope
                  value: availability
            -
              uuid: b8294b60044c4549baa7c930ce8acc48
              expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.status,,"like","Warning")=1'
              name: 'Dell R720: Server is in warning state'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'Please check the device for warnings.'
              dependencies:
                -
                  name: 'Dell R720: Server is in a critical state'
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.status,,"like","Critical")=1'
              tags:
                -
                  tag: scope
                  value: availability
        -
          uuid: 05403c3757624072be7919dbd8864871
          name: 'Dell R720: Get system'
          type: HTTP_AGENT
          key: dell.server.system.get
          history: '0'
          trends: '0'
          value_type: TEXT
          authtype: BASIC
          username: '{$API.USER}'
          password: '{$API.PASSWORD}'
          description: 'Returns the metrics of a system.'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  function request(url) {
                      api_request = new HttpRequest();
                      api_request.addHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
                      Zabbix.log(4, '[ DELL ] Sending request: ' + url);
                  
                      try {
                          response = api_request.get(url);
                      } catch (error) {
                          Zabbix.log(4, '[ DELL ] Get request returned error ' + error);
                          throw 'Get request returned error ' + error + '. Check debug log for more information.';
                      }
                  
                      Zabbix.log(4, '[ DELL ] Received response with status code ' +
                          api_request.getStatus() + '\n' + response);
                  
                      if (api_request.getStatus() !== 200) {
                          var message = 'Request failed with status code ' + api_request.getStatus();
                          if (response !== null) {
                              if (typeof response.message === 'string') {
                                  message += ': ' + response.message;
                              }
                          }
                  
                          throw message + ' Check debug log for more information.';
                      }
                  
                      if (response !== null) {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              Zabbix.log(4, '[ DELL ] Failed to parse response.');
                              response = null;
                          }
                      }
                  
                      return {
                          status: api_request.getStatus(),
                          body: response
                      };
                  }
                  
                  function getField(object, field, def) {
                      var names = field.split('.');
                      var name = names.shift();
                  
                      while (typeof name !== 'undefined') {
                          if (typeof object === undefined || typeof object[name] === 'undefined') {
                              return def;
                          }
                  
                          object = object[name];
                          name = names.shift();
                      }
                  
                      return object;
                  }
                  
                  try {
                      system = JSON.parse(value);
                  }
                  catch (error) {
                      Zabbix.log(4, '[ DELL ] Failed to parse response.');
                      system = null;
                  }
                  
                  var params = {
                      url: '{$API.URL}',
                      user: '{$API.USER}',
                      password: '{$API.PASSWORD}'
                  };
                  var result = {
                      model: '',
                      serialnumber: '',
                      status: '',
                      firmware: ''
                  };
                  
                  var index = params.url.indexOf('://');
                  index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
                  if (index !== -1) {
                      params.url = params.url.substring(0, index);
                  }
                  
                  result.model = getField(system, 'Model', '');
                  result.serialnumber = getField(system, 'Oem.Dell.DellSystem.ChassisServiceTag', '');
                  result.status = getField(system, 'Status.Health', '');
                  
                  response = request(params.url + '/redfish/v1/Managers/iDRAC.Embedded.1');
                  result.firmware = getField(response.body, 'FirmwareVersion', '');
                  
                  return JSON.stringify(result);
          url: '{$API.URL}/redfish/v1/Systems/System.Embedded.1'
          tags:
            -
              tag: component
              value: system
        -
          uuid: f71cb6b0b93945ccbb20dc660c73e15c
          name: 'Dell R720: Redfish API'
          type: SIMPLE
          key: 'net.tcp.service[https]'
          history: 7d
          description: |
            The availability of Redfish API on the server.
            Possible values:
              0 unavailable
              1 available
          valuemap:
            name: zabbix.host.available
          tags:
            -
              tag: component
              value: health
            -
              tag: component
              value: system
          triggers:
            -
              uuid: 24004d9971ea4686b2941ecf8135b421
              expression: 'last(/DELL PowerEdge R720 by HTTP/net.tcp.service[https])=0'
              name: 'Dell R720: Redfish API service is unavailable'
              priority: HIGH
              description: 'The service is unavailable or does not accept TCP connections.'
              tags:
                -
                  tag: scope
                  value: availability
      discovery_rules:
        -
          uuid: acf63330ee40478aa81fa73c156ee6c8
          name: 'Array controller cache discovery'
          type: HTTP_AGENT
          key: array.cache.discovery
          delay: 1h
          authtype: BASIC
          username: '{$API.USER}'
          password: '{$API.PASSWORD}'
          description: 'Discovery of a cache of disk array controllers.'
          item_prototypes:
            -
              uuid: a13e5b801b034e0eab55bee72afe2c06
              name: 'Dell R720: {#BATTERY_NAME} Status'
              type: HTTP_AGENT
              key: 'dell.server.hw.diskarray.cache.battery.status[{#BATTERY_NAME}]'
              history: 7d
              trends: '0'
              value_type: CHAR
              authtype: BASIC
              username: '{$API.USER}'
              password: '{$API.PASSWORD}'
              description: 'The status of the job. Possible values: OK, Warning, Critical.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Oem.Dell.DellControllerBattery.PrimaryStatus
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              url: '{$API.URL}{#ODATA}'
              tags:
                -
                  tag: component
                  value: battery
                -
                  tag: component
                  value: diskarray
              trigger_prototypes:
                -
                  uuid: e4549547cb7747318895e6f237fc52b8
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.diskarray.cache.battery.status[{#BATTERY_NAME}],,"like","Critical")=1'
                  name: 'Dell R720: {#BATTERY_NAME} is in a critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Please check the device for faults.'
                  tags:
                    -
                      tag: scope
                      value: availability
                -
                  uuid: 3788759c5f91471da7cac5560593be2b
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.diskarray.cache.battery.status[{#BATTERY_NAME}],,"like","Warning")=1'
                  name: 'Dell R720: {#BATTERY_NAME} is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the device for warnings.'
                  dependencies:
                    -
                      name: 'Dell R720: {#BATTERY_NAME} is in a critical state'
                      expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.diskarray.cache.battery.status[{#BATTERY_NAME}],,"like","Critical")=1'
                  tags:
                    -
                      tag: scope
                      value: availability
          url: '{$API.URL}/redfish/v1/Systems/System.Embedded.1/Storage'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  function request(url) {
                      api_request = new HttpRequest();
                      api_request.addHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
                      Zabbix.log(4, '[ DELL ] Sending request: ' + url);
                  
                      try {
                          response = api_request.get(url);
                      } catch (error) {
                          Zabbix.log(4, '[ DELL ] Get request returned error ' + error);
                          throw 'Get request returned error ' + error + '. Check debug log for more information.';
                      }
                  
                      Zabbix.log(4, '[ DELL ] Received response with status code ' +
                          api_request.getStatus() + '\n' + response);
                  
                      if (api_request.getStatus() !== 200) {
                          var message = 'Request failed with status code ' + api_request.getStatus();
                          if (response !== null) {
                              if (typeof response.message === 'string') {
                                  message += ': ' + response.message;
                              }
                          }
                  
                          throw message + ' Check debug log for more information.';
                      }
                  
                      if (response !== null) {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              Zabbix.log(4, '[ DELL ] Failed to parse response.');
                              response = null;
                          }
                      }
                  
                      return {
                          status: api_request.getStatus(),
                          body: response
                      };
                  }
                  
                  function getField(object, field, def) {
                      var names = field.split('.');
                      var name = names.shift();
                  
                      while (typeof name !== 'undefined') {
                          if (typeof object === undefined || typeof object[name] === 'undefined') {
                              return def;
                          }
                  
                          object = object[name];
                          name = names.shift();
                      }
                  
                      return object;
                  }
                  
                  try {
                      storages = JSON.parse(value);
                  }
                  catch (error) {
                      Zabbix.log(4, '[ DELL ] Failed to parse response.');
                      storages = null;
                  }
                  
                  var params = {
                      url: '{$API.URL}',
                      user: '{$API.USER}',
                      password: '{$API.PASSWORD}'
                  };
                  var result = [];
                  
                  var index = params.url.indexOf('://');
                  index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
                  if (index !== -1) {
                      params.url = params.url.substring(0, index);
                  }
                  
                  if (storages.Members instanceof Array) {
                      storages.Members.forEach(function (storage) {
                          if (typeof storage["@odata.id"] === 'string') {
                              response = request(params.url + storage["@odata.id"]);
                              controller = response.body;
                              if (getField(controller, 'Id', '').search('RAID') > -1) {
                                  result.push({
                                      '{#BATTERY_NAME}': getField(response.body, 'Oem.Dell.DellControllerBattery.Name', ''),
                                      '{#ODATA}': controller["@odata.id"]
                                  });
                              }
                          }
                      });
                  }
                  
                  return JSON.stringify(result);
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        -
          uuid: 3ef57728fdca4c2791f57a993474cd98
          name: 'Array controller discovery'
          type: HTTP_AGENT
          key: array.discovery
          delay: 1h
          authtype: BASIC
          username: '{$API.USER}'
          password: '{$API.PASSWORD}'
          description: 'Discovery of disk array controllers.'
          item_prototypes:
            -
              uuid: 3d61cc1d4b044428b17ad9af11f90652
              name: 'Dell R720: {#CNTLR_NAME} in slot {#SLOT} Status'
              type: HTTP_AGENT
              key: 'dell.server.hw.diskarray.status[{#CNTLR_NAME}{#SLOT}]'
              history: 7d
              trends: '0'
              value_type: CHAR
              authtype: BASIC
              username: '{$API.USER}'
              password: '{$API.PASSWORD}'
              description: 'The status of the job. Possible values: OK, Warning, Critical.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Status.Health
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              url: '{$API.URL}{#ODATA}'
              tags:
                -
                  tag: component
                  value: diskarray
                -
                  tag: component
                  value: storage
              trigger_prototypes:
                -
                  uuid: d8139731126649a8825550863b9ea832
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.diskarray.status[{#CNTLR_NAME}{#SLOT}],,"like","Critical")=1'
                  name: 'Dell R720: {#CNTLR_NAME} in slot {#SLOT} is in a critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Please check the device for faults.'
                  tags:
                    -
                      tag: scope
                      value: availability
                -
                  uuid: 6764e247bd64411692e09fe6618c5411
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.diskarray.status[{#CNTLR_NAME}{#SLOT}],,"like","Warning")=1'
                  name: 'Dell R720: {#CNTLR_NAME} in slot {#SLOT} is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the device for warnings.'
                  dependencies:
                    -
                      name: 'Dell R720: {#CNTLR_NAME} in slot {#SLOT} is in a critical state'
                      expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.diskarray.status[{#CNTLR_NAME}{#SLOT}],,"like","Critical")=1'
                  tags:
                    -
                      tag: scope
                      value: availability
          url: '{$API.URL}/redfish/v1/Systems/System.Embedded.1/Storage'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  function request(url) {
                      api_request = new HttpRequest();
                      api_request.addHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
                      Zabbix.log(4, '[ DELL ] Sending request: ' + url);
                  
                      try {
                          response = api_request.get(url);
                      } catch (error) {
                          Zabbix.log(4, '[ DELL ] Get request returned error ' + error);
                          throw 'Get request returned error ' + error + '. Check debug log for more information.';
                      }
                  
                      Zabbix.log(4, '[ DELL ] Received response with status code ' +
                          api_request.getStatus() + '\n' + response);
                  
                      if (api_request.getStatus() !== 200) {
                          var message = 'Request failed with status code ' + api_request.getStatus();
                          if (response !== null) {
                              if (typeof response.message === 'string') {
                                  message += ': ' + response.message;
                              }
                          }
                  
                          throw message + ' Check debug log for more information.';
                      }
                  
                      if (response !== null) {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              Zabbix.log(4, '[ DELL ] Failed to parse response.');
                              response = null;
                          }
                      }
                  
                      return {
                          status: api_request.getStatus(),
                          body: response
                      };
                  }
                  
                  function getField(object, field, def) {
                      var names = field.split('.');
                      var name = names.shift();
                  
                      while (typeof name !== 'undefined') {
                          if (typeof object === undefined || typeof object[name] === 'undefined') {
                              return def;
                          }
                  
                          object = object[name];
                          name = names.shift();
                      }
                  
                      return object;
                  }
                  
                  try {
                      storages = JSON.parse(value);
                  }
                  catch (error) {
                      Zabbix.log(4, '[ DELL ] Failed to parse response.');
                      storages = null;
                  }
                  
                  var params = {
                      url: '{$API.URL}',
                      user: '{$API.USER}',
                      password: '{$API.PASSWORD}'
                  };
                  var result = [];
                  
                  var index = params.url.indexOf('://');
                  index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
                  if (index !== -1) {
                      params.url = params.url.substring(0, index);
                  }
                  
                  if (storages.Members instanceof Array) {
                      storages.Members.forEach(function (storage) {
                          if (typeof storage["@odata.id"] === 'string') {
                              response = request(params.url + storage["@odata.id"]);
                              controller = response.body;
                              if (getField(controller, 'Id', '').search('RAID') > -1) {
                                  result.push({
                                      '{#CNTLR_NAME}': getField(response.body, 'Name', ''),
                                      '{#SLOT}': getField(response.body, 'Oem.Dell.DellController.PCISlot', ''),
                                      '{#ODATA}': controller["@odata.id"]
                                  });
                              }
                          }
                      });
                  }
                  
                  return JSON.stringify(result);
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        -
          uuid: 38908736806c44bdbd519f770e6dc91e
          name: 'FAN discovery'
          type: HTTP_AGENT
          key: fan.discovery
          delay: 1h
          authtype: BASIC
          username: '{$API.USER}'
          password: '{$API.PASSWORD}'
          description: 'Discovery of FAN sensors.'
          item_prototypes:
            -
              uuid: 2112e99b197044258693bd7c23376a08
              name: 'Dell R720: {#SENSOR_NAME} Get sensor'
              type: HTTP_AGENT
              key: 'dell.server.sensor.fan.get[{#SENSOR_NAME}]'
              history: '0'
              trends: '0'
              value_type: TEXT
              authtype: BASIC
              username: '{$API.USER}'
              password: '{$API.PASSWORD}'
              description: 'Returns the metrics of a sensor.'
              url: '{$API.URL}{#ODATA}'
              tags:
                -
                  tag: component
                  value: fan
                -
                  tag: component
                  value: raw
            -
              uuid: 32c00337c3a24ce1bd76622b8203141f
              name: 'Dell R720: {#SENSOR_NAME} Speed'
              type: DEPENDENT
              key: 'dell.server.sensor.fan.speed[{#SENSOR_NAME}]'
              delay: '0'
              history: 7d
              units: rpm
              description: 'The sensor value.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Reading
              master_item:
                key: 'dell.server.sensor.fan.get[{#SENSOR_NAME}]'
              tags:
                -
                  tag: component
                  value: fan
            -
              uuid: b9167957cb1a42749afcecbfd1062f7c
              name: 'Dell R720: {#SENSOR_NAME} Status'
              type: DEPENDENT
              key: 'dell.server.sensor.fan.status[{#SENSOR_NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The status of the job. Possible values: OK, Warning, Critical.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Status.Health
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.sensor.fan.get[{#SENSOR_NAME}]'
              tags:
                -
                  tag: component
                  value: fan
              trigger_prototypes:
                -
                  uuid: c856499a11124210811fec617dbdd8a8
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.sensor.fan.status[{#SENSOR_NAME}],,"like","Critical")=1'
                  name: 'Dell R720: {#SENSOR_NAME} is in a critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Please check the device for faults.'
                  tags:
                    -
                      tag: scope
                      value: availability
                -
                  uuid: d97e44aad2e743759dcf486e73b6e141
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.sensor.fan.status[{#SENSOR_NAME}],,"like","Warning")=1'
                  name: 'Dell R720: {#SENSOR_NAME} is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the device for warnings.'
                  dependencies:
                    -
                      name: 'Dell R720: {#SENSOR_NAME} is in a critical state'
                      expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.sensor.fan.status[{#SENSOR_NAME}],,"like","Critical")=1'
                  tags:
                    -
                      tag: scope
                      value: availability
          url: '{$API.URL}/redfish/v1/Chassis/System.Embedded.1/Sensors'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  function request(url) {
                      api_request = new HttpRequest();
                      api_request.addHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
                      Zabbix.log(4, '[ DELL ] Sending request: ' + url);
                  
                      try {
                          response = api_request.get(url);
                      } catch (error) {
                          Zabbix.log(4, '[ DELL ] Get request returned error ' + error);
                          throw 'Get request returned error ' + error + '. Check debug log for more information.';
                      }
                  
                      Zabbix.log(4, '[ DELL ] Received response with status code ' +
                          api_request.getStatus() + '\n' + response);
                  
                      if (api_request.getStatus() !== 200) {
                          var message = 'Request failed with status code ' + api_request.getStatus();
                          if (response !== null) {
                              if (typeof response.message === 'string') {
                                  message += ': ' + response.message;
                              }
                          }
                  
                          throw message + ' Check debug log for more information.';
                      }
                  
                      if (response !== null) {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              Zabbix.log(4, '[ DELL ] Failed to parse response.');
                              response = null;
                          }
                      }
                  
                      return {
                          status: api_request.getStatus(),
                          body: response
                      };
                  }
                  
                  try {
                      sensors = JSON.parse(value);
                  }
                  catch (error) {
                      Zabbix.log(4, '[ DELL ] Failed to parse response.');
                      sensors = null;
                  }
                  
                  var params = {
                      url: '{$API.URL}',
                      user: '{$API.USER}',
                      password: '{$API.PASSWORD}'
                  };
                  var result = [];
                  
                  var index = params.url.indexOf('://');
                  index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
                  if (index !== -1) {
                      params.url = params.url.substring(0, index);
                  }
                  
                  if (sensors.Members instanceof Array) {
                      sensors.Members.forEach(function (sensor) {
                          if (typeof sensor["@odata.id"] === 'string') {
                              response = request(params.url + sensor["@odata.id"]);
                              if (response.body.ReadingType === 'Rotational') {
                                  if (typeof response.body.Name === 'string') {
                                      result.push({ '{#SENSOR_NAME}': response.body.Name, '{#ODATA}': sensor["@odata.id"] });
                                  }
                              }
                          }
                      });
                  }
                  
                  return JSON.stringify(result);
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        -
          uuid: 677239d906704f1ca4be041b209e7aa3
          name: 'Network interface discovery'
          type: HTTP_AGENT
          key: net.if.discovery
          delay: 1h
          authtype: BASIC
          username: '{$API.USER}'
          password: '{$API.PASSWORD}'
          description: 'The NetworkInterface schema describes links to the NetworkAdapter and represents the functionality available to the containing system.'
          item_prototypes:
            -
              uuid: 13f09a8a9ffd4724b783f6f6ffca4237
              name: 'Dell R720: {#IFNAME} Get interface'
              type: HTTP_AGENT
              key: 'dell.server.net.if.get[{#IFNAME}]'
              history: '0'
              trends: '0'
              value_type: TEXT
              authtype: BASIC
              username: '{$API.USER}'
              password: '{$API.PASSWORD}'
              description: 'Returns the metrics of a network interface.'
              url: '{$API.URL}{#ODATA}'
              tags:
                -
                  tag: component
                  value: network
                -
                  tag: component
                  value: raw
            -
              uuid: 5a29abc9a33c498498ede924953e506e
              name: 'Dell R720: {#IFNAME} Status'
              type: DEPENDENT
              key: 'dell.server.net.if.health[{#IFNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The status of the job. Possible values: OK, Warning, Critical.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Status.Health
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.net.if.get[{#IFNAME}]'
              tags:
                -
                  tag: component
                  value: network
              trigger_prototypes:
                -
                  uuid: c83b9b49f9bd4ddd9fb19033b5ad581c
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.net.if.health[{#IFNAME}],,"like","Critical")=1'
                  name: 'Dell R720: {#IFNAME} is in a critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Please check the device for faults.'
                  tags:
                    -
                      tag: scope
                      value: availability
                -
                  uuid: db482b43f586470c9cf46e711954f148
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.net.if.health[{#IFNAME}],,"like","Warning")=1'
                  name: 'Dell R720: {#IFNAME} is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the device for warnings.'
                  dependencies:
                    -
                      name: 'Dell R720: {#IFNAME} is in a critical state'
                      expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.net.if.health[{#IFNAME}],,"like","Critical")=1'
                  tags:
                    -
                      tag: scope
                      value: availability
            -
              uuid: 03a1c99b946b470393bf59a1025dfad4
              name: 'Dell R720: {#IFNAME} Speed'
              type: DEPENDENT
              key: 'dell.server.net.if.speed[{#IFNAME}]'
              delay: '0'
              history: 7d
              units: '!Mbps'
              description: 'Network port current link speed.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.CurrentLinkSpeedMbps
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.net.if.get[{#IFNAME}]'
              tags:
                -
                  tag: component
                  value: network
            -
              uuid: bbfc1c324a92402381adf94fee5c4ca0
              name: 'Dell R720: {#IFNAME} State'
              type: DEPENDENT
              key: 'dell.server.net.if.state[{#IFNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The known state of the Resource, for example, enabled. Possible values: Enabled, Disabled, StandbyOffline, StandbySpare, InTest, Starting, Absent, UnavailableOffline, Deferring, Quiesced, Updating, Qualified.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Status.State
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.net.if.get[{#IFNAME}]'
              tags:
                -
                  tag: component
                  value: network
            -
              uuid: a68c98640efc4c5eb146409339261f51
              name: 'Dell R720: {#IFNAME} Link status'
              type: DEPENDENT
              key: 'dell.server.net.if.status[{#IFNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The status of the link between this port and its link partner. Possible values: Down, Up, null.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.LinkStatus
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.net.if.get[{#IFNAME}]'
              tags:
                -
                  tag: component
                  value: network
              trigger_prototypes:
                -
                  uuid: bf30aa7ff82e4d08b3b48ded248c4d46
                  expression: '{$IFCONTROL:"{#IFNAME}"}=1 and (find(/DELL PowerEdge R720 by HTTP/dell.server.net.if.status[{#IFNAME}],,"like")="Down" and last(/DELL PowerEdge R720 by HTTP/dell.server.net.if.status[{#IFNAME}],#1)<>last(/DELL PowerEdge R720 by HTTP/dell.server.net.if.status[{#IFNAME}],#2))'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.net.if.status[{#IFNAME}],,"like")<>"Down" or {$IFCONTROL:"{#IFNAME}"}=0'
                  name: 'Dell R720: {#IFNAME} Link down'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: |
                    This trigger expression works as follows:
                    1. Can be triggered if operations status is down.
                    2. {$IFCONTROL:"{#IFNAME}"}=1 - user can redefine Context macro to value - 0. That marks this interface as not important. No new trigger will be fired if this interface is down.
                    3. Condition of difference between last and previous value - trigger fires only if operational status was up(1) sometime before. (So, do not fire 'ethernal off' interfaces.)
                    
                    WARNING: if closed manually - won't fire again on next poll, because of .diff.
                  manual_close: 'YES'
                  tags:
                    -
                      tag: scope
                      value: availability
          url: '{$API.URL}/redfish/v1/Chassis/System.Embedded.1/NetworkAdapters'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  function request(url) {
                      api_request = new HttpRequest();
                      api_request.addHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
                      Zabbix.log(4, '[ DELL ] Sending request: ' + url);
                  
                      try {
                          response = api_request.get(url);
                      } catch (error) {
                          Zabbix.log(4, '[ DELL ] Get request returned error ' + error);
                          throw 'Get request returned error ' + error + '. Check debug log for more information.';
                      }
                  
                      Zabbix.log(4, '[ DELL ] Received response with status code ' +
                          api_request.getStatus() + '\n' + response);
                  
                      if (api_request.getStatus() !== 200) {
                          var message = 'Request failed with status code ' + api_request.getStatus();
                          if (response !== null) {
                              if (typeof response.message === 'string') {
                                  message += ': ' + response.message;
                              }
                          }
                  
                          throw message + ' Check debug log for more information.';
                      }
                  
                      if (response !== null) {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              Zabbix.log(4, '[ DELL ] Failed to parse response.');
                              response = null;
                          }
                      }
                  
                      return {
                          status: api_request.getStatus(),
                          body: response
                      };
                  }
                  
                  function getField(object, field, def) {
                      var names = field.split('.');
                      var name = names.shift();
                  
                      while (typeof name !== 'undefined') {
                          if (typeof object === undefined || typeof object[name] === 'undefined') {
                              return def;
                          }
                  
                          object = object[name];
                          name = names.shift();
                      }
                  
                      return object;
                  }
                  
                  try {
                      adapters = JSON.parse(value);
                  }
                  catch (error) {
                      Zabbix.log(4, '[ DELL ] Failed to parse response.');
                      adapters = null;
                  }
                  
                  var params = {
                      url: '{$API.URL}',
                      user: '{$API.USER}',
                      password: '{$API.PASSWORD}'
                  };
                  var result = [];
                  
                  var index = params.url.indexOf('://');
                  index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
                  if (index !== -1) {
                      params.url = params.url.substring(0, index);
                  }
                  
                  if (adapters.Members instanceof Array) {
                      adapters.Members.forEach(function (adapter) {
                          if (typeof adapter["@odata.id"] === 'string') {
                              response = request(params.url + adapter["@odata.id"] + "/NetworkPorts");
                              ports = response.body;
                              if (ports.Members instanceof Array) {
                                  ports.Members.forEach(function (port) {
                                      if (typeof port["@odata.id"] === 'string') {
                                          response = request(params.url + port["@odata.id"]);
                                          result.push({ '{#IFNAME}': getField(response.body, 'Id', ''), '{#ODATA}': port["@odata.id"] });
                                      }
                                  });
                              }
                          }
                      });
                  }
                  
                  return JSON.stringify(result);
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        -
          uuid: f40fb375a0ba441ea9942822471be1cf
          name: 'Physical disk discovery'
          type: HTTP_AGENT
          key: physicaldisk.discovery
          delay: 1h
          authtype: BASIC
          username: '{$API.USER}'
          password: '{$API.PASSWORD}'
          description: 'Discovery of physical disks.'
          item_prototypes:
            -
              uuid: f4b115b9975e44e388b077eb884d92f4
              name: 'Dell R720: {#DISK_NAME} Get disk'
              type: HTTP_AGENT
              key: 'dell.server.hw.physicaldisk.get[{#DISK_NAME}]'
              history: '0'
              trends: '0'
              value_type: TEXT
              authtype: BASIC
              username: '{$API.USER}'
              password: '{$API.PASSWORD}'
              description: 'Returns the metrics of a physical disk.'
              url: '{$API.URL}{#ODATA}'
              tags:
                -
                  tag: component
                  value: physicaldisk
                -
                  tag: component
                  value: raw
                -
                  tag: component
                  value: storage
            -
              uuid: e3ae47c99fb44bcba8037c71852d7bf6
              name: 'Dell R720: {#DISK_NAME} Media type'
              type: DEPENDENT
              key: 'dell.server.hw.physicaldisk.media_type[{#DISK_NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The type of media contained in this drive. Possible values: HDD, SSD, SMR, null.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.MediaType
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.physicaldisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: physicaldisk
                -
                  tag: component
                  value: storage
            -
              uuid: 3aab8fb330dc49d885afb31d972299fc
              name: 'Dell R720: {#DISK_NAME} Model name'
              type: DEPENDENT
              key: 'dell.server.hw.physicaldisk.model[{#DISK_NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The model number of the drive.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Model
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.physicaldisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: physicaldisk
                -
                  tag: component
                  value: storage
            -
              uuid: cc0f3d4b18a24cd5a98ce6d85e69a374
              name: 'Dell R720: {#DISK_NAME} Serial number'
              type: DEPENDENT
              key: 'dell.server.hw.physicaldisk.serialnumber[{#DISK_NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The serial number of this drive.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.SerialNumber
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.physicaldisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: physicaldisk
                -
                  tag: component
                  value: storage
              trigger_prototypes:
                -
                  uuid: efaef650ead54921b101e0fe4bb4381a
                  expression: 'last(/DELL PowerEdge R720 by HTTP/dell.server.hw.physicaldisk.serialnumber[{#DISK_NAME}],#1)<>last(/DELL PowerEdge R720 by HTTP/dell.server.hw.physicaldisk.serialnumber[{#DISK_NAME}],#2) and length(last(/DELL PowerEdge R720 by HTTP/dell.server.hw.physicaldisk.serialnumber[{#DISK_NAME}]))>0'
                  name: 'Dell R720: {#DISK_NAME} has been replaced'
                  event_name: 'Dell R720: {#DISK_NAME} has been replaced (new serial number received)'
                  priority: INFO
                  description: '{#DISK_NAME} serial number has changed. Ack to close'
                  manual_close: 'YES'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: 9a72ed848c574f5aaaca432f0548272f
              name: 'Dell R720: {#DISK_NAME} Size'
              type: DEPENDENT
              key: 'dell.server.hw.physicaldisk.size[{#DISK_NAME}]'
              delay: '0'
              history: 7d
              trends: 0d
              units: B
              description: 'The size, in bytes, of this drive.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.CapacityBytes
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.physicaldisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: physicaldisk
                -
                  tag: component
                  value: storage
            -
              uuid: 0db3af82611c4f49899e54c09d600aef
              name: 'Dell R720: {#DISK_NAME} Status'
              type: DEPENDENT
              key: 'dell.server.hw.physicaldisk.status[{#DISK_NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The status of the job. Possible values: OK, Warning, Critical.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Status.Health
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.physicaldisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: physicaldisk
                -
                  tag: component
                  value: storage
              trigger_prototypes:
                -
                  uuid: 56757be1596c4b0189e5cd6fe0a8fa45
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.physicaldisk.status[{#DISK_NAME}],,"like","Critical")=1'
                  name: 'Dell R720: {#DISK_NAME} is in a critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Please check the device for faults.'
                  tags:
                    -
                      tag: scope
                      value: availability
                -
                  uuid: 0e68f903e424472dac82f3cbd72ef248
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.physicaldisk.status[{#DISK_NAME}],,"like","Warning")=1'
                  name: 'Dell R720: {#DISK_NAME} is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the device for warnings.'
                  dependencies:
                    -
                      name: 'Dell R720: {#DISK_NAME} is in a critical state'
                      expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.physicaldisk.status[{#DISK_NAME}],,"like","Critical")=1'
                  tags:
                    -
                      tag: scope
                      value: availability
          url: '{$API.URL}/redfish/v1/Systems/System.Embedded.1/Storage'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  function request(url) {
                      api_request = new HttpRequest();
                      api_request.addHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
                      Zabbix.log(4, '[ DELL ] Sending request: ' + url);
                  
                      try {
                          response = api_request.get(url);
                      } catch (error) {
                          Zabbix.log(4, '[ DELL ] Get request returned error ' + error);
                          throw 'Get request returned error ' + error + '. Check debug log for more information.';
                      }
                  
                      Zabbix.log(4, '[ DELL ] Received response with status code ' +
                          api_request.getStatus() + '\n' + response);
                  
                      if (api_request.getStatus() !== 200) {
                          var message = 'Request failed with status code ' + api_request.getStatus();
                          if (response !== null) {
                              if (typeof response.message === 'string') {
                                  message += ': ' + response.message;
                              }
                          }
                  
                          throw message + ' Check debug log for more information.';
                      }
                  
                      if (response !== null) {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              Zabbix.log(4, '[ DELL ] Failed to parse response.');
                              response = null;
                          }
                      }
                  
                      return {
                          status: api_request.getStatus(),
                          body: response
                      };
                  }
                  
                  function getField(object, field, def) {
                      var names = field.split('.');
                      var name = names.shift();
                  
                      while (typeof name !== 'undefined') {
                          if (typeof object === undefined || typeof object[name] === 'undefined') {
                              return def;
                          }
                  
                          object = object[name];
                          name = names.shift();
                      }
                  
                      return object;
                  }
                  
                  try {
                      storages = JSON.parse(value);
                  }
                  catch (error) {
                      Zabbix.log(4, '[ DELL ] Failed to parse response.');
                      storages = null;
                  }
                  
                  var params = {
                      url: '{$API.URL}',
                      user: '{$API.USER}',
                      password: '{$API.PASSWORD}'
                  };
                  var result = [];
                  
                  var index = params.url.indexOf('://');
                  index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
                  if (index !== -1) {
                      params.url = params.url.substring(0, index);
                  }
                  
                  if (storages.Members instanceof Array) {
                      storages.Members.forEach(function (storage) {
                          if (typeof storage["@odata.id"] === 'string') {
                              response = request(params.url + storage["@odata.id"]);
                              drives = response.body;
                              if (drives.Drives instanceof Array) {
                                  drives.Drives.forEach(function (drive) {
                                      if (typeof drive["@odata.id"] === 'string') {
                                          response = request(params.url + drive["@odata.id"]);
                                          result.push({ '{#DISK_NAME}': getField(response.body, 'Name', ''), '{#ODATA}': drive["@odata.id"] });
                                      }
                                  });
                              }
                          }
                      });
                  }
                  
                  return JSON.stringify(result);
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        -
          uuid: 1ae5712a1b75459e9f6fe7b3c9334ee9
          name: 'PSU discovery'
          type: HTTP_AGENT
          key: psu.discovery
          delay: 1h
          authtype: BASIC
          username: '{$API.USER}'
          password: '{$API.PASSWORD}'
          description: 'Discovery of PSU sensors.'
          item_prototypes:
            -
              uuid: ff702455da7748de995238ebe6bd7fbd
              name: 'Dell R720: {#SENSOR_NAME} Get sensor'
              type: HTTP_AGENT
              key: 'dell.server.sensor.psu.get[{#SENSOR_NAME}]'
              history: '0'
              trends: '0'
              value_type: TEXT
              authtype: BASIC
              username: '{$API.USER}'
              password: '{$API.PASSWORD}'
              description: 'Returns the metrics of a sensor.'
              url: '{$API.URL}{#ODATA}'
              tags:
                -
                  tag: component
                  value: psu
                -
                  tag: component
                  value: raw
            -
              uuid: 6c7f9247ea1f46c2938fcf1cd441dd6f
              name: 'Dell R720: {#SENSOR_NAME} Status'
              type: DEPENDENT
              key: 'dell.server.sensor.psu.status[{#SENSOR_NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The status of the job. Possible values: OK, Warning, Critical.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Status.Health
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.sensor.psu.get[{#SENSOR_NAME}]'
              tags:
                -
                  tag: component
                  value: psu
              trigger_prototypes:
                -
                  uuid: 1a9a063e006343c0bce9bf21ead9d93f
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.sensor.psu.status[{#SENSOR_NAME}],,"like","Critical")=1'
                  name: 'Dell R720: {#SENSOR_NAME} is in a critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Please check the device for faults.'
                  tags:
                    -
                      tag: scope
                      value: availability
                -
                  uuid: c9b528eac8844abea4de8a53c0ff8893
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.sensor.psu.status[{#SENSOR_NAME}],,"like","Warning")=1'
                  name: 'Dell R720: {#SENSOR_NAME} is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the device for warnings.'
                  dependencies:
                    -
                      name: 'Dell R720: {#SENSOR_NAME} is in a critical state'
                      expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.sensor.psu.status[{#SENSOR_NAME}],,"like","Critical")=1'
                  tags:
                    -
                      tag: scope
                      value: availability
          url: '{$API.URL}/redfish/v1/Chassis/System.Embedded.1/Sensors'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  function request(url) {
                      api_request = new HttpRequest();
                      api_request.addHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
                      Zabbix.log(4, '[ DELL ] Sending request: ' + url);
                  
                      try {
                          response = api_request.get(url);
                      } catch (error) {
                          Zabbix.log(4, '[ DELL ] Get request returned error ' + error);
                          throw 'Get request returned error ' + error + '. Check debug log for more information.';
                      }
                  
                      Zabbix.log(4, '[ DELL ] Received response with status code ' +
                          api_request.getStatus() + '\n' + response);
                  
                      if (api_request.getStatus() !== 200) {
                          var message = 'Request failed with status code ' + api_request.getStatus();
                          if (response !== null) {
                              if (typeof response.message === 'string') {
                                  message += ': ' + response.message;
                              }
                          }
                  
                          throw message + ' Check debug log for more information.';
                      }
                  
                      if (response !== null) {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              Zabbix.log(4, '[ DELL ] Failed to parse response.');
                              response = null;
                          }
                      }
                  
                      return {
                          status: api_request.getStatus(),
                          body: response
                      };
                  }
                  
                  function getField(object, field, def) {
                      var names = field.split('.');
                      var name = names.shift();
                  
                      while (typeof name !== 'undefined') {
                          if (typeof object === undefined || typeof object[name] === 'undefined') {
                              return def;
                          }
                  
                          object = object[name];
                          name = names.shift();
                      }
                  
                      return object;
                  }
                  
                  try {
                      sensors = JSON.parse(value);
                  }
                  catch (error) {
                      Zabbix.log(4, '[ DELL ] Failed to parse response.');
                      sensors = null;
                  }
                  
                  var params = {
                      url: '{$API.URL}',
                      user: '{$API.USER}',
                      password: '{$API.PASSWORD}'
                  };
                  var result = [];
                  
                  var index = params.url.indexOf('://');
                  index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
                  if (index !== -1) {
                      params.url = params.url.substring(0, index);
                  }
                  
                  if (sensors.Members instanceof Array) {
                      sensors.Members.forEach(function (sensor) {
                          if (typeof sensor["@odata.id"] === 'string') {
                              response = request(params.url + sensor["@odata.id"]);
                              if (getField(response.body, 'ReadingType', '') === 'Voltage') {
                                  result.push({ '{#SENSOR_NAME}': getField(response.body, 'Name', ''), '{#ODATA}': sensor["@odata.id"] });
                              }
                          }
                      });
                  }
                  
                  return JSON.stringify(result);
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        -
          uuid: 0c8eea294f9041ca9cb8b27fd32bea80
          name: 'Temperature discovery'
          type: HTTP_AGENT
          key: temp.discovery
          delay: 1h
          authtype: BASIC
          username: '{$API.USER}'
          password: '{$API.PASSWORD}'
          description: 'Discovery of temperature sensors.'
          item_prototypes:
            -
              uuid: 13eb046f17ae44e3b56a911fa29462b3
              name: 'Dell R720: {#SENSOR_NAME} Get sensor'
              type: HTTP_AGENT
              key: 'dell.server.sensor.temp.get[{#SENSOR_NAME}]'
              history: '0'
              trends: '0'
              value_type: TEXT
              authtype: BASIC
              username: '{$API.USER}'
              password: '{$API.PASSWORD}'
              description: 'Returns the metrics of a sensor.'
              url: '{$API.URL}{#ODATA}'
              tags:
                -
                  tag: component
                  value: raw
                -
                  tag: component
                  value: temperature
            -
              uuid: 7426672931d045349f7a1048a29fd404
              name: 'Dell R720: {#SENSOR_NAME} Status'
              type: DEPENDENT
              key: 'dell.server.sensor.temp.status[{#SENSOR_NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The status of the job. Possible values: OK, Warning, Critical.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Status.Health
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.sensor.temp.get[{#SENSOR_NAME}]'
              tags:
                -
                  tag: component
                  value: temperature
              trigger_prototypes:
                -
                  uuid: c909cc04251c4b53bf512128476dc9ba
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.sensor.temp.status[{#SENSOR_NAME}],,"like","Critical")=1'
                  name: 'Dell R720: {#SENSOR_NAME} is in a critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Please check the device for faults.'
                  tags:
                    -
                      tag: scope
                      value: availability
                -
                  uuid: 9d4bede243904a6aa92f96948d6f9ed7
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.sensor.temp.status[{#SENSOR_NAME}],,"like","Warning")=1'
                  name: 'Dell R720: {#SENSOR_NAME} is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the device for warnings.'
                  dependencies:
                    -
                      name: 'Dell R720: {#SENSOR_NAME} is in a critical state'
                      expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.sensor.temp.status[{#SENSOR_NAME}],,"like","Critical")=1'
                  tags:
                    -
                      tag: scope
                      value: availability
            -
              uuid: 0fb34178623b47609fd59674c01cbc70
              name: 'Dell R720: {#SENSOR_NAME} Value'
              type: DEPENDENT
              key: 'dell.server.sensor.temp.value[{#SENSOR_NAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: °C
              description: 'The sensor value.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Reading
              master_item:
                key: 'dell.server.sensor.temp.get[{#SENSOR_NAME}]'
              tags:
                -
                  tag: component
                  value: temperature
          url: '{$API.URL}/redfish/v1/Chassis/System.Embedded.1/Sensors'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  function request(url) {
                      api_request = new HttpRequest();
                      api_request.addHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
                      Zabbix.log(4, '[ DELL ] Sending request: ' + url);
                  
                      try {
                          response = api_request.get(url);
                      } catch (error) {
                          Zabbix.log(4, '[ DELL ] Get request returned error ' + error);
                          throw 'Get request returned error ' + error + '. Check debug log for more information.';
                      }
                  
                      Zabbix.log(4, '[ DELL ] Received response with status code ' +
                          api_request.getStatus() + '\n' + response);
                  
                      if (api_request.getStatus() !== 200) {
                          var message = 'Request failed with status code ' + api_request.getStatus();
                          if (response !== null) {
                              if (typeof response.message === 'string') {
                                  message += ': ' + response.message;
                              }
                          }
                  
                          throw message + ' Check debug log for more information.';
                      }
                  
                      if (response !== null) {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              Zabbix.log(4, '[ DELL ] Failed to parse response.');
                              response = null;
                          }
                      }
                  
                      return {
                          status: api_request.getStatus(),
                          body: response
                      };
                  }
                  
                  function getField(object, field, def) {
                      var names = field.split('.');
                      var name = names.shift();
                  
                      while (typeof name !== 'undefined') {
                          if (typeof object === undefined || typeof object[name] === 'undefined') {
                              return def;
                          }
                  
                          object = object[name];
                          name = names.shift();
                      }
                  
                      return object;
                  }
                  
                  try {
                      sensors = JSON.parse(value);
                  }
                  catch (error) {
                      Zabbix.log(4, '[ DELL ] Failed to parse response.');
                      sensors = null;
                  }
                  
                  var params = {
                      url: '{$API.URL}',
                      user: '{$API.USER}',
                      password: '{$API.PASSWORD}'
                  };
                  var result = [];
                  
                  var index = params.url.indexOf('://');
                  index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
                  if (index !== -1) {
                      params.url = params.url.substring(0, index);
                  }
                  
                  if (sensors.Members instanceof Array) {
                      sensors.Members.forEach(function (sensor) {
                          if (typeof sensor["@odata.id"] === 'string') {
                              response = request(params.url + sensor["@odata.id"]);
                              if (getField(response.body, 'ReadingType', '') === 'Temperature') {
                                  result.push({ '{#SENSOR_NAME}': getField(response.body, 'Name', ''), '{#ODATA}': sensor["@odata.id"] });
                              }
                          }
                      });
                  }
                  
                  return JSON.stringify(result);
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        -
          uuid: 0b5735d173a04cf69422118ac8990ff4
          name: 'Virtual disk discovery'
          type: HTTP_AGENT
          key: virtualdisk.discovery
          delay: 1h
          authtype: BASIC
          username: '{$API.USER}'
          password: '{$API.PASSWORD}'
          description: 'Discovery of virtual disks.'
          item_prototypes:
            -
              uuid: a5a3da9fd1824fa89d41514deac80619
              name: 'Dell R720: {#DISK_NAME} Get disk'
              type: HTTP_AGENT
              key: 'dell.server.hw.virtualdisk.get[{#DISK_NAME}]'
              history: '0'
              trends: '0'
              value_type: TEXT
              authtype: BASIC
              username: '{$API.USER}'
              password: '{$API.PASSWORD}'
              description: 'Returns the metrics of a virtual disk.'
              url: '{$API.URL}{#ODATA}'
              tags:
                -
                  tag: component
                  value: raw
                -
                  tag: component
                  value: virtualdisk
            -
              uuid: a6e3cb66270744598ef9d5ad5b99b4a7
              name: 'Dell R720: {#DISK_NAME} RAID status'
              type: DEPENDENT
              key: 'dell.server.hw.virtualdisk.raidstatus[{#DISK_NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'This property represents the RAID specific status. Possible values: Blocked, Degraded, Failed, Foreign, Offline, Online, Ready, Unknown, null.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Oem.Dell.DellVirtualDisk.RaidStatus
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.virtualdisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: component
                  value: virtualdisk
            -
              uuid: 1f11df437d8544e6b8824f9ab4b36fd1
              name: 'Dell R720: {#DISK_NAME} Read policy'
              type: DEPENDENT
              key: 'dell.server.hw.virtualdisk.readpolicy[{#DISK_NAME}]'
              delay: '0'
              history: 2w
              trends: '0'
              value_type: CHAR
              description: 'Indicates the read cache policy setting for the Volume. Possible values: ReadAhead, AdaptiveReadAhead, Off.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Oem.Dell.DellVirtualDisk.ReadCachePolicy
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.virtualdisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: component
                  value: virtualdisk
            -
              uuid: b1529c9635904ecbb8ea1168fd006253
              name: 'Dell R720: {#DISK_NAME} Size'
              type: DEPENDENT
              key: 'dell.server.hw.virtualdisk.size[{#DISK_NAME}]'
              delay: '0'
              history: 7d
              trends: 0d
              units: B
              description: 'The size in bytes of this Volume.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.CapacityBytes
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.virtualdisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: component
                  value: virtualdisk
            -
              uuid: aed92b93740a4dc3a0a3db66ebded2d1
              name: 'Dell R720: {#DISK_NAME} Current state'
              type: DEPENDENT
              key: 'dell.server.hw.virtualdisk.state[{#DISK_NAME}]'
              delay: '0'
              history: 2w
              trends: '0'
              value_type: CHAR
              description: 'The known state of the Resource, for example, enabled. Possible values: Enabled, Disabled, StandbyOffline, StandbySpare, InTest, Starting, Absent, UnavailableOffline, Deferring, Quiesced, Updating, Qualified.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Status.State
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.virtualdisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: component
                  value: virtualdisk
            -
              uuid: d80c7530a7e84a31a0e5013229c7d3fe
              name: 'Dell R720: {#DISK_NAME} Status'
              type: DEPENDENT
              key: 'dell.server.hw.virtualdisk.status[{#DISK_NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The status of the job. Possible values: OK, Warning, Critical.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Status.Health
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.virtualdisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: component
                  value: virtualdisk
              trigger_prototypes:
                -
                  uuid: 2284cde0da39410396fa7dd3d9151d85
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.virtualdisk.status[{#DISK_NAME}],,"like","Critical")=1'
                  name: 'Dell R720: {#DISK_NAME} is in a critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Please check the device for faults.'
                  tags:
                    -
                      tag: scope
                      value: availability
                -
                  uuid: ebd49db8ab2f491e9238dd60befe0b20
                  expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.virtualdisk.status[{#DISK_NAME}],,"like","Warning")=1'
                  name: 'Dell R720: {#DISK_NAME} is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the device for warnings.'
                  dependencies:
                    -
                      name: 'Dell R720: {#DISK_NAME} is in a critical state'
                      expression: 'find(/DELL PowerEdge R720 by HTTP/dell.server.hw.virtualdisk.status[{#DISK_NAME}],,"like","Critical")=1'
                  tags:
                    -
                      tag: scope
                      value: availability
            -
              uuid: b7a38f742f6d46e596e373de673db7aa
              name: 'Dell R720: {#DISK_NAME} Write policy'
              type: DEPENDENT
              key: 'dell.server.hw.virtualdisk.writepolicy[{#DISK_NAME}]'
              delay: '0'
              history: 2w
              trends: '0'
              value_type: CHAR
              description: 'Indicates the write cache policy setting for the Volume. Possible values: WriteThrough, ProtectedWriteBack, UnprotectedWriteBack.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Oem.Dell.DellVirtualDisk.WriteCachePolicy
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'dell.server.hw.virtualdisk.get[{#DISK_NAME}]'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: component
                  value: virtualdisk
          url: '{$API.URL}/redfish/v1/Systems/System.Embedded.1/Storage'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  function request(url) {
                      api_request = new HttpRequest();
                      api_request.addHeader('Authorization: Basic ' + btoa(params.user + ':' + params.password));
                      Zabbix.log(4, '[ DELL ] Sending request: ' + url);
                  
                      try {
                          response = api_request.get(url);
                      } catch (error) {
                          Zabbix.log(4, '[ DELL ] Get request returned error ' + error);
                          throw 'Get request returned error ' + error + '. Check debug log for more information.';
                      }
                  
                      Zabbix.log(4, '[ DELL ] Received response with status code ' +
                          api_request.getStatus() + '\n' + response);
                  
                      if (api_request.getStatus() !== 200) {
                          var message = 'Request failed with status code ' + api_request.getStatus();
                          if (response !== null) {
                              if (typeof response.message === 'string') {
                                  message += ': ' + response.message;
                              }
                          }
                  
                          throw message + ' Check debug log for more information.';
                      }
                  
                      if (response !== null) {
                          try {
                              response = JSON.parse(response);
                          }
                          catch (error) {
                              Zabbix.log(4, '[ DELL ] Failed to parse response.');
                              response = null;
                          }
                      }
                  
                      return {
                          status: api_request.getStatus(),
                          body: response
                      };
                  }
                  
                  function getField(object, field, def) {
                      var names = field.split('.');
                      var name = names.shift();
                  
                      while (typeof name !== 'undefined') {
                          if (typeof object === undefined || typeof object[name] === 'undefined') {
                              return def;
                          }
                  
                          object = object[name];
                          name = names.shift();
                      }
                  
                      return object;
                  }
                  
                  try {
                      storages = JSON.parse(value);
                  }
                  catch (error) {
                      Zabbix.log(4, '[ DELL ] Failed to parse response.');
                      storages = null;
                  }
                  
                  var params = {
                      url: '{$API.URL}',
                      user: '{$API.USER}',
                      password: '{$API.PASSWORD}'
                  };
                  var result = [];
                  
                  var index = params.url.indexOf('://');
                  index = params.url.indexOf('/', (index !== -1) ? (index + 3) : 0);
                  if (index !== -1) {
                      params.url = params.url.substring(0, index);
                  }
                  
                  if (storages.Members instanceof Array) {
                      storages.Members.forEach(function (storage) {
                          if (typeof storage["@odata.id"] === 'string') {
                              response = request(params.url + storage["@odata.id"] + "/Volumes");
                              volumes = response.body;
                              if (volumes.Members instanceof Array) {
                                  volumes.Members.forEach(function (volume) {
                                      if (typeof volume["@odata.id"] === 'string') {
                                          response = request(params.url + volume["@odata.id"]);
                                          result.push({ '{#DISK_NAME}': getField(response.body, 'Name', ''), '{#ODATA}': volume["@odata.id"] });
                                      }
                                  });
                              }
                          }
                      });
                  }
                  
                  return JSON.stringify(result);
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
      tags:
        -
          tag: class
          value: hardware
        -
          tag: target
          value: dell
        -
          tag: target
          value: 'dell poweredge'
      macros:
        -
          macro: '{$API.PASSWORD}'
          value: '<Put your password here>'
          description: 'The Dell iDRAC user password.'
        -
          macro: '{$API.URL}'
          value: '<Put your URL here>'
          description: 'The Dell iDRAC Redfish API URL in the format `<scheme>://<host>:<port>`.'
        -
          macro: '{$API.USER}'
          value: '<Put your username here>'
          description: 'The Dell iDRAC username.'
        -
          macro: '{$IFCONTROL}'
          value: '1'
          description: 'Link status trigger will be fired only for interfaces that have the context macro equaled 1.'
      valuemaps:
        -
          uuid: 13a9860da38f4727a6f958b5cd3d3468
          name: zabbix.host.available
          mappings:
            -
              value: '0'
              newvalue: 'not available'
            -
              value: '1'
              newvalue: available
            -
              value: '2'
              newvalue: unknown