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

template_app_apache_agent.yaml « apache_agent « app « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 16a9e7b9da866d133cba7393a2ef172f3f5adb65 (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
zabbix_export:
  version: '6.2'
  date: '2022-04-06T19:53:58Z'
  groups:
    -
      uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Templates/Applications
  templates:
    -
      uuid: a8d91e4f36794e32b73090d5edf3d7ae
      template: 'Apache by Zabbix agent'
      name: 'Apache by Zabbix agent'
      description: |
        Get metrics from mod_status module using HTTP agent.
        https://httpd.apache.org/docs/current/mod/mod_status.html
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384764-discussion-thread-for-official-zabbix-template-apache
        
        Template tooling version used: 0.41
      groups:
        -
          name: Templates/Applications
      items:
        -
          uuid: 2d3ebb059bd944ee8a7b95e2c60b08f0
          name: 'Apache: Total bytes'
          type: DEPENDENT
          key: apache.bytes
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: B
          description: 'Total bytes served'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - '$["Total kBytes"]'
            -
              type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: network
        -
          uuid: be97c53d82f846cdbc2d0ec640435b6f
          name: 'Apache: Bytes per second'
          type: DEPENDENT
          key: apache.bytes.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: Bps
          description: |
            Calculated as change rate for 'Total bytes' stat.
            BytesPerSec is not used, as it counts average since last Apache server start.
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - '$["Total kBytes"]'
            -
              type: MULTIPLIER
              parameters:
                - '1024'
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: network
        -
          uuid: 5919f29c692b468fb5642e83f408c2e5
          name: 'Apache: Total requests'
          type: DEPENDENT
          key: apache.requests
          delay: '0'
          history: 7d
          description: 'A total number of accesses'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - '$["Total Accesses"]'
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: network
        -
          uuid: 7e1e674a23d24fafa31b76a048fe9fd0
          name: 'Apache: Requests per second'
          type: DEPENDENT
          key: apache.requests.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: |
            Calculated as change rate for 'Total requests' stat.
            ReqPerSec is not used, as it counts average since last Apache server start.
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - '$["Total Accesses"]'
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: network
        -
          uuid: 5a4bd2d6c2874d888ec4c82409e1c711
          name: 'Apache: Uptime'
          type: DEPENDENT
          key: apache.uptime
          delay: '0'
          history: 7d
          units: uptime
          description: 'Service uptime in seconds'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.ServerUptimeSeconds
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
          triggers:
            -
              uuid: 7872d9665c234f45941ca26206e0255c
              expression: 'last(/Apache by Zabbix agent/apache.uptime)<10m'
              name: 'Apache: has been restarted'
              event_name: 'Apache: has been restarted (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes'
              manual_close: 'YES'
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: 78a611c2b15c4ae8949257b6fdf922f1
          name: 'Apache: Version'
          type: DEPENDENT
          key: apache.version
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          description: 'Service version'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.ServerVersion
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
          triggers:
            -
              uuid: 5124b17918f545758ca5c936332f51cd
              expression: 'last(/Apache by Zabbix agent/apache.version,#1)<>last(/Apache by Zabbix agent/apache.version,#2) and length(last(/Apache by Zabbix agent/apache.version))>0'
              name: 'Apache: Version has changed'
              event_name: 'Apache: Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'Apache version has changed. Ack to close.'
              manual_close: 'YES'
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: 35f48761ec6d451bbb8b0d80cd0ccd91
          name: 'Apache: Workers idle cleanup'
          type: DEPENDENT
          key: apache.workers.cleanup
          delay: '0'
          history: 7d
          description: 'Number of workers in cleanup state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.cleanup
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: ebd391702cbd432ab458578a3cb45361
          name: 'Apache: Workers closing connection'
          type: DEPENDENT
          key: apache.workers.closing
          delay: '0'
          history: 7d
          description: 'Number of workers in closing state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.closing
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: 6a961707e7084d8ebc09f572b15ef1fd
          name: 'Apache: Workers DNS lookup'
          type: DEPENDENT
          key: apache.workers.dnslookup
          delay: '0'
          history: 7d
          description: 'Number of workers in dnslookup state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.dnslookup
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: fd383c9ace4647deb9d3e3882554b8d0
          name: 'Apache: Workers finishing'
          type: DEPENDENT
          key: apache.workers.finishing
          delay: '0'
          history: 7d
          description: 'Number of workers in finishing state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.finishing
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: 2a02413c0e9144b4a70b8a5a71d680e0
          name: 'Apache: Workers keepalive (read)'
          type: DEPENDENT
          key: apache.workers.keepalive
          delay: '0'
          history: 7d
          description: 'Number of workers in keepalive state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.keepalive
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: ed71fb2ec75f4537a2937293add75274
          name: 'Apache: Workers logging'
          type: DEPENDENT
          key: apache.workers.logging
          delay: '0'
          history: 7d
          description: 'Number of workers in logging state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.logging
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: 6c38147f9f3449a194f36a6e6d828865
          name: 'Apache: Workers reading request'
          type: DEPENDENT
          key: apache.workers.reading
          delay: '0'
          history: 7d
          description: 'Number of workers in reading state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.reading
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: 47856ac3b68644e0861b593d3083d35b
          name: 'Apache: Workers sending reply'
          type: DEPENDENT
          key: apache.workers.sending
          delay: '0'
          history: 7d
          description: 'Number of workers in sending state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.sending
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: 60cf954a40594cf69afdd1bf0319c031
          name: 'Apache: Workers slot with no current process'
          type: DEPENDENT
          key: apache.workers.slot
          delay: '0'
          history: 7d
          description: 'Number of slots with no current process'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.slot
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: 441c797164bf4c8da8112d78240abc43
          name: 'Apache: Workers starting up'
          type: DEPENDENT
          key: apache.workers.starting
          delay: '0'
          history: 7d
          description: 'Number of workers in starting state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.starting
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: ec87e89ee9304acd8c7a76e863cb4443
          name: 'Apache: Workers waiting for connection'
          type: DEPENDENT
          key: apache.workers.waiting
          delay: '0'
          history: 7d
          description: 'Number of workers in waiting state'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.Workers.waiting
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: b52addb50ccb415fb63eaf67076991c1
          name: 'Apache: Total workers busy'
          type: DEPENDENT
          key: apache.workers_total.busy
          delay: '0'
          history: 7d
          description: 'Total number of busy worker threads/processes'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.BusyWorkers
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: 6955f78c203b435987b5ab75a1114867
          name: 'Apache: Total workers idle'
          type: DEPENDENT
          key: apache.workers_total.idle
          delay: '0'
          history: 7d
          description: 'Total number of idle worker threads/processes'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.IdleWorkers
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          tags:
            -
              tag: component
              value: system
        -
          uuid: 267ca6fe038346e5be1113f3bf9b4023
          name: 'Apache: Service response time'
          key: 'net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]'
          history: 7d
          value_type: FLOAT
          units: s
          tags:
            -
              tag: component
              value: application
            -
              tag: component
              value: health
          triggers:
            -
              uuid: 128905793a4b4a1db5a49f87e87d3383
              expression: 'min(/Apache by Zabbix agent/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN}'
              name: 'Apache: Service response time is too high'
              event_name: 'Apache: Service response time is too high (over {$APACHE.RESPONSE_TIME.MAX.WARN}s for 5m)'
              priority: WARNING
              manual_close: 'YES'
              dependencies:
                -
                  name: 'Apache: Process is not running'
                  expression: 'last(/Apache by Zabbix agent/proc.num["{$APACHE.PROCESS_NAME}"])=0'
                -
                  name: 'Apache: Service is down'
                  expression: 'last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0'
              tags:
                -
                  tag: scope
                  value: performance
        -
          uuid: 369f00e2970048c786ce3bd609e65566
          name: 'Apache: Service ping'
          key: 'net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]'
          history: 7d
          valuemap:
            name: 'Service state'
          preprocessing:
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          tags:
            -
              tag: component
              value: application
            -
              tag: component
              value: health
          triggers:
            -
              uuid: e24dbf9b89c34d839cb12a22b1103df3
              expression: 'last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0'
              name: 'Apache: Service is down'
              priority: AVERAGE
              manual_close: 'YES'
              dependencies:
                -
                  name: 'Apache: Process is not running'
                  expression: 'last(/Apache by Zabbix agent/proc.num["{$APACHE.PROCESS_NAME}"])=0'
              tags:
                -
                  tag: scope
                  value: availability
        -
          uuid: b73280fb0af64c7899abfc74cc074b13
          name: 'Apache: CPU utilization'
          key: 'proc.cpu.util["{$APACHE.PROCESS_NAME}"]'
          history: 7d
          value_type: FLOAT
          units: '%'
          description: 'Process CPU utilization percentage.'
          tags:
            -
              tag: component
              value: cpu
        -
          uuid: 384bf197e6a241b3b63bb89d009bba6b
          name: 'Apache: Memory usage (rss)'
          key: 'proc.mem["{$APACHE.PROCESS_NAME}",,,,rss]'
          history: 7d
          units: B
          description: 'Resident set size memory used by process in bytes.'
          tags:
            -
              tag: component
              value: memory
        -
          uuid: f20b7a01ff134a128c54ea83af8557e2
          name: 'Apache: Memory usage (vsize)'
          key: 'proc.mem["{$APACHE.PROCESS_NAME}",,,,vsize]'
          history: 7d
          units: B
          description: 'Virtual memory size used by process in bytes.'
          tags:
            -
              tag: component
              value: memory
        -
          uuid: 233b5466014640e4b990ffd81fa19fa1
          name: 'Apache: Number of processes running'
          key: 'proc.num["{$APACHE.PROCESS_NAME}"]'
          history: 7d
          tags:
            -
              tag: component
              value: system
          triggers:
            -
              uuid: b62f49b09d6b4c6ca01ff60cd9dd2209
              expression: 'last(/Apache by Zabbix agent/proc.num["{$APACHE.PROCESS_NAME}"])=0'
              name: 'Apache: Process is not running'
              priority: HIGH
              tags:
                -
                  tag: scope
                  value: availability
        -
          uuid: 115413a0f5ab4caba418ab841ad81eba
          name: 'Apache: Get status'
          key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: |
            Getting data from a machine-readable version of the Apache status page.
            https://httpd.apache.org/docs/current/mod/mod_status.html
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  // Convert Apache status to JSON
                  var lines = value.split('\n');
                  var output = {},
                      workers = {
                          '_': 0, 'S': 0, 'R': 0, 'W': 0,
                          'K': 0, 'D': 0, 'C': 0, 'L': 0,
                          'G': 0, 'I': 0, '.': 0
                      };
                  
                  // Get all "Key: Value" pairs as an object
                  for (var i = 0; i < lines.length; i++) {
                      var line = lines[i].match(/([A-z0-9 ]+): (.*)/);
                  
                      if (line !== null) {
                          output[line[1]] = isNaN(line[2]) ? line[2] : Number(line[2]);
                      }
                  }
                  
                  // Multiversion metrics
                  output.ServerUptimeSeconds = output.ServerUptimeSeconds || output.Uptime;
                  output.ServerVersion = output.Server || output.ServerVersion;
                  
                  // Parse "Scoreboard" to get worker count.
                  if (typeof output.Scoreboard === 'string') {
                      for (var i = 0; i < output.Scoreboard.length; i++) {
                          var char = output.Scoreboard[i];
                  
                          workers[char]++;
                      }
                  }
                  
                  // Add worker data to the output
                  output.Workers = {
                      waiting: workers['_'], starting: workers['S'], reading: workers['R'],
                      sending: workers['W'], keepalive: workers['K'], dnslookup: workers['D'],
                      closing: workers['C'], logging: workers['L'], finishing: workers['G'],
                      cleanup: workers['I'], slot: workers['.']
                  };
                  
                  // Return JSON string
                  return JSON.stringify(output);
          tags:
            -
              tag: component
              value: raw
          triggers:
            -
              uuid: 0166ec63913e4bbea25c54b458b3213a
              expression: 'nodata(/Apache by Zabbix agent/web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"],30m)=1'
              name: 'Apache: Failed to fetch status page'
              event_name: 'Apache: Failed to fetch status page (or no data for 30m)'
              priority: WARNING
              description: 'Zabbix has not received data for items for the last 30 minutes.'
              manual_close: 'YES'
              dependencies:
                -
                  name: 'Apache: Process is not running'
                  expression: 'last(/Apache by Zabbix agent/proc.num["{$APACHE.PROCESS_NAME}"])=0'
                -
                  name: 'Apache: Service is down'
                  expression: 'last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0'
              tags:
                -
                  tag: scope
                  value: availability
      discovery_rules:
        -
          uuid: 36a82bdda7754c51a05da3bb0b65b83e
          name: 'Event MPM discovery'
          type: DEPENDENT
          key: apache.mpm.event.discovery
          delay: '0'
          description: |
            Additional metrics if event MPM is used
            https://httpd.apache.org/docs/current/mod/event.html
          item_prototypes:
            -
              uuid: 99df2ff5970b4497887371bcd16d5ada
              name: 'Apache: Bytes per request'
              type: DEPENDENT
              key: 'apache.bytes[per_request{#SINGLETON}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: B
              description: 'Average number of client requests per second'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.BytesPerReq
              master_item:
                key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
              tags:
                -
                  tag: component
                  value: connection
            -
              uuid: 2e0692f36b924b52ab7b2ff7788b641d
              name: 'Apache: Connections async closing'
              type: DEPENDENT
              key: 'apache.connections[async_closing{#SINGLETON}]'
              delay: '0'
              history: 7d
              description: 'Number of async connections in closing state (only applicable to event MPM)'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.ConnsAsyncClosing
              master_item:
                key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
              tags:
                -
                  tag: component
                  value: connection
            -
              uuid: 33d3fec8f45c493097bab986d5ea1e55
              name: 'Apache: Connections async keep alive'
              type: DEPENDENT
              key: 'apache.connections[async_keep_alive{#SINGLETON}]'
              delay: '0'
              history: 7d
              description: 'Number of async connections in keep-alive state (only applicable to event MPM)'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.ConnsAsyncKeepAlive
              master_item:
                key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
              tags:
                -
                  tag: component
                  value: connection
            -
              uuid: 9ad0e5c49e7c4b939eb7977a5158953f
              name: 'Apache: Connections async writing'
              type: DEPENDENT
              key: 'apache.connections[async_writing{#SINGLETON}]'
              delay: '0'
              history: 7d
              description: 'Number of async connections in writing state (only applicable to event MPM)'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.ConnsAsyncWriting
              master_item:
                key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
              tags:
                -
                  tag: component
                  value: connection
            -
              uuid: 0fbfbfae187040c790bb4d68f9e2fae5
              name: 'Apache: Connections total'
              type: DEPENDENT
              key: 'apache.connections[total{#SINGLETON}]'
              delay: '0'
              history: 7d
              description: 'Number of total connections'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.ConnsTotal
              master_item:
                key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
              tags:
                -
                  tag: component
                  value: connection
            -
              uuid: 778a1bfeaa1b474ba529e6c0a55a9949
              name: 'Apache: Number of async processes'
              type: DEPENDENT
              key: 'apache.process[num{#SINGLETON}]'
              delay: '0'
              history: 7d
              description: 'Number of async processes'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.Processes
              master_item:
                key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
              tags:
                -
                  tag: component
                  value: system
          graph_prototypes:
            -
              uuid: 4845e6716bd74e7698406e6d8389eba5
              name: 'Apache: Current async connections{#SINGLETON}'
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'Apache by Zabbix agent'
                    key: 'apache.connections[async_closing{#SINGLETON}]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'Apache by Zabbix agent'
                    key: 'apache.connections[async_keep_alive{#SINGLETON}]'
                -
                  sortorder: '2'
                  color: F63100
                  item:
                    host: 'Apache by Zabbix agent'
                    key: 'apache.connections[async_writing{#SINGLETON}]'
                -
                  sortorder: '3'
                  drawtype: BOLD_LINE
                  color: A54F10
                  item:
                    host: 'Apache by Zabbix agent'
                    key: 'apache.connections[total{#SINGLETON}]'
            -
              uuid: 19ecb4e04c3742daac1a0e06d5f98c0c
              name: 'Apache: Current async processes{#SINGLETON}'
              graph_items:
                -
                  drawtype: GRADIENT_LINE
                  color: 1A7C11
                  item:
                    host: 'Apache by Zabbix agent'
                    key: 'apache.process[num{#SINGLETON}]'
          master_item:
            key: 'web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"]'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  return JSON.stringify(JSON.parse(value).ServerMPM === 'event'
                      ? [{'{#SINGLETON}': ''}] : []);
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
      tags:
        -
          tag: class
          value: software
        -
          tag: target
          value: apache
      macros:
        -
          macro: '{$APACHE.PROCESS_NAME}'
          value: httpd
          description: 'Apache server process name'
        -
          macro: '{$APACHE.RESPONSE_TIME.MAX.WARN}'
          value: '10'
          description: 'Maximum Apache response time in seconds for trigger expression'
        -
          macro: '{$APACHE.STATUS.HOST}'
          value: 127.0.0.1
          description: 'Hostname or IP address of the Apache status page'
        -
          macro: '{$APACHE.STATUS.PATH}'
          value: 'server-status?auto'
          description: 'The URL path'
        -
          macro: '{$APACHE.STATUS.PORT}'
          value: '80'
          description: 'The port of Apache status page'
        -
          macro: '{$APACHE.STATUS.SCHEME}'
          value: http
          description: 'Request scheme which may be http or https'
      dashboards:
        -
          uuid: c27c68fb9c234a09b4023076b45affc1
          name: 'Apache performance'
          pages:
            -
              widgets:
                -
                  type: GRAPH_CLASSIC
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'Apache: Requests per second'
                        host: 'Apache by Zabbix agent'
                -
                  type: GRAPH_CLASSIC
                  x: '12'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'Apache: Workers total'
                        host: 'Apache by Zabbix agent'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '5'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        name: 'Apache: Current async connections{#SINGLETON}'
                        host: 'Apache by Zabbix agent'
                -
                  type: GRAPH_PROTOTYPE
                  x: '12'
                  'y': '5'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        name: 'Apache: Current async processes{#SINGLETON}'
                        host: 'Apache by Zabbix agent'
                -
                  type: GRAPH_CLASSIC
                  'y': '10'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'Apache: Worker states'
                        host: 'Apache by Zabbix agent'
      valuemaps:
        -
          uuid: 452297e814a84b08a72730a7b777e378
          name: 'Service state'
          mappings:
            -
              value: '0'
              newvalue: Down
            -
              value: '1'
              newvalue: Up
  graphs:
    -
      uuid: d317a2ccde4f4a2ab20e983b27ae64e2
      name: 'Apache: Memory usage'
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Apache by Zabbix agent'
            key: 'proc.mem["{$APACHE.PROCESS_NAME}",,,,vsize]'
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Apache by Zabbix agent'
            key: 'proc.mem["{$APACHE.PROCESS_NAME}",,,,rss]'
    -
      uuid: dfc5334e77ce45d286145cc08d036f38
      name: 'Apache: Requests per second'
      graph_items:
        -
          drawtype: GRADIENT_LINE
          color: 1A7C11
          item:
            host: 'Apache by Zabbix agent'
            key: apache.requests.rate
    -
      uuid: 6f646e8c11b04e8a835b81bc17824593
      name: 'Apache: Worker states'
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.dnslookup
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.cleanup
        -
          sortorder: '2'
          color: F63100
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.logging
        -
          sortorder: '3'
          color: A54F10
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.reading
        -
          sortorder: '4'
          color: FC6EA3
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.sending
        -
          sortorder: '5'
          color: 6C59DC
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.starting
        -
          sortorder: '6'
          color: AC8C14
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.closing
        -
          sortorder: '7'
          color: 611F27
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.finishing
        -
          sortorder: '8'
          color: F230E0
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.keepalive
        -
          sortorder: '9'
          color: FFAD40
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.slot
        -
          sortorder: '10'
          color: 40CDFF
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers.waiting
    -
      uuid: 121c2d4feb0b4b53b027f1566107ab29
      name: 'Apache: Workers total'
      type: STACKED
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers_total.busy
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Apache by Zabbix agent'
            key: apache.workers_total.idle