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

template_app_nginx_agent.yaml « nginx_agent « app « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5f30f0853bc9f01a21fe4ae30d4d8a0330b57576 (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
zabbix_export:
  version: '6.0'
  date: '2022-01-26T10:48:34Z'
  groups:
    -
      uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Templates/Applications
  templates:
    -
      uuid: 27f6424905884dbb96ab9210d987a56c
      template: 'Nginx by Zabbix agent'
      name: 'Nginx by Zabbix agent'
      description: |
        Get metrics from stub status module using Zabbix agent running on Linux
        https://nginx.ru/en/docs/http/ngx_http_stub_status_module.html
        
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384765-discussion-thread-for-official-zabbix-template-nginx
        
        Template tooling version used: 0.41
      groups:
        -
          name: Templates/Applications
      items:
        -
          uuid: 75a7795df3034835bcfd143f7c3e9b94
          name: 'Nginx: Service response time'
          key: 'net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"]'
          history: 7d
          value_type: FLOAT
          units: s
          tags:
            -
              tag: component
              value: application
            -
              tag: component
              value: health
          triggers:
            -
              uuid: f5db329410a14609a5f3e883ca493cc8
              expression: 'min(/Nginx by Zabbix agent/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN}'
              name: 'Nginx: Service response time is too high (over {$NGINX.RESPONSE_TIME.MAX.WARN}s for 5m)'
              priority: WARNING
              manual_close: 'YES'
              dependencies:
                -
                  name: 'Nginx: Process is not running'
                  expression: 'last(/Nginx by Zabbix agent/proc.num[nginx])=0'
                -
                  name: 'Nginx: Service is down'
                  expression: 'last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0'
              tags:
                -
                  tag: scope
                  value: performance
        -
          uuid: f06e76888f464e13b7cc4c3db33e8131
          name: 'Nginx: Service status'
          key: 'net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_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: c043191c22f34522ba4f83430d9f88b1
              expression: 'last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0'
              name: 'Nginx: Service is down'
              priority: AVERAGE
              manual_close: 'YES'
              dependencies:
                -
                  name: 'Nginx: Process is not running'
                  expression: 'last(/Nginx by Zabbix agent/proc.num[nginx])=0'
              tags:
                -
                  tag: scope
                  value: availability
        -
          uuid: 9e2be446ac79491c8be1bcd789392066
          name: 'Nginx: Connections accepted per second'
          type: DEPENDENT
          key: nginx.connections.accepted.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: 'The total number of accepted client connections.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)'
                - \1
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: 436f2dc87cda418eb8f19ed6910c7bd0
          name: 'Nginx: Connections active'
          type: DEPENDENT
          key: nginx.connections.active
          delay: '0'
          history: 7d
          description: 'The current number of active client connections including Waiting connections.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'Active connections: ([0-9]+)'
                - \1
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: 4027e6db5e024aff98056faa2d4b43cd
          name: 'Nginx: Connections dropped per second'
          type: DEPENDENT
          key: nginx.connections.dropped.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: 'The total number of dropped client connections.'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var a = value.match(/server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)/)
                  if (a) {
                      return a[1]-a[2]
                  }
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: connections
          triggers:
            -
              uuid: f2d431fa9bc446608caa3f80ef27c41b
              expression: 'min(/Nginx by Zabbix agent/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN}'
              name: 'Nginx: High connections drop rate (more than {$NGINX.DROP_RATE.MAX.WARN} for 5m)'
              opdata: 'Current rate: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The dropping rate connections is greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes.'
              dependencies:
                -
                  name: 'Nginx: Process is not running'
                  expression: 'last(/Nginx by Zabbix agent/proc.num[nginx])=0'
                -
                  name: 'Nginx: Service is down'
                  expression: 'last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0'
              tags:
                -
                  tag: scope
                  value: performance
        -
          uuid: 06191636a7104e1bb40d197493b80958
          name: 'Nginx: Connections handled per second'
          type: DEPENDENT
          key: nginx.connections.handled.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: 'The total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached (for example, the worker_connections limit).'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)'
                - \2
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: f5925c78389143c7924432483a5c716c
          name: 'Nginx: Connections reading'
          type: DEPENDENT
          key: nginx.connections.reading
          delay: '0'
          history: 7d
          description: 'The current number of connections where nginx is reading the request header.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)'
                - \1
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: d6cfa828ba344ffe948d8d985b849316
          name: 'Nginx: Connections waiting'
          type: DEPENDENT
          key: nginx.connections.waiting
          delay: '0'
          history: 7d
          description: 'The current number of idle client connections waiting for a request.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)'
                - \3
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: c038a572f73f4a418ddcc5aeb8b0a547
          name: 'Nginx: Connections writing'
          type: DEPENDENT
          key: nginx.connections.writing
          delay: '0'
          history: 7d
          description: 'The current number of connections where nginx is writing the response back to the client.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)'
                - \2
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: b28444fb9b834d03a72036882c80b921
          name: 'Nginx: Requests total'
          type: DEPENDENT
          key: nginx.requests.total
          delay: '0'
          history: 7d
          description: 'The total number of client requests.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)'
                - \3
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: requests
        -
          uuid: 2600a696278f490f86cadd8c8836f269
          name: 'Nginx: Requests per second'
          type: DEPENDENT
          key: nginx.requests.total.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: 'The total number of client requests.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)'
                - \3
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: requests
        -
          uuid: 3dcc81006977478f92be6dd040d66eb5
          name: 'Nginx: Version'
          type: DEPENDENT
          key: nginx.version
          delay: '0'
          history: 7d
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'Server: nginx\/(.+(?<!\r))'
                - \1
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          master_item:
            key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          tags:
            -
              tag: component
              value: application
          triggers:
            -
              uuid: 7ad80c508f2f48b59f7659c673db9f36
              expression: 'last(/Nginx by Zabbix agent/nginx.version,#1)<>last(/Nginx by Zabbix agent/nginx.version,#2) and length(last(/Nginx by Zabbix agent/nginx.version))>0'
              name: 'Nginx: Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'Nginx version has changed. Ack to close.'
              manual_close: 'YES'
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: 84c95c1955bf4ccaa12a060a9acdb478
          name: 'Nginx: CPU utilization'
          key: 'proc.cpu.util[nginx]'
          history: 7d
          value_type: FLOAT
          units: '%'
          description: 'Process CPU utilization percentage.'
          tags:
            -
              tag: component
              value: cpu
        -
          uuid: 64d208475c034bae953a64cde1833ebb
          name: 'Nginx: Memory usage (rss)'
          key: 'proc.mem[nginx,,,,rss]'
          history: 7d
          units: B
          description: 'Resident set size memory used by process in bytes.'
          tags:
            -
              tag: component
              value: memory
        -
          uuid: 21fccb0286fb407c85f1972e994c698e
          name: 'Nginx: Memory usage (vsize)'
          key: 'proc.mem[nginx,,,,vsize]'
          history: 7d
          units: B
          description: 'Virtual memory size used by process in bytes.'
          tags:
            -
              tag: component
              value: memory
        -
          uuid: ba3da6baccee4b31947bf20d3cae0e5f
          name: 'Nginx: Number of processes running'
          key: 'proc.num[nginx]'
          history: 7d
          description: 'Number of the Nginx processes running.'
          tags:
            -
              tag: component
              value: system
          triggers:
            -
              uuid: 903e6a1f30154ee49df3f8d87e0164cc
              expression: 'last(/Nginx by Zabbix agent/proc.num[nginx])=0'
              name: 'Nginx: Process is not running'
              priority: HIGH
              tags:
                -
                  tag: scope
                  value: availability
        -
          uuid: 52a23a9f6d60490c8f5565b938154f61
          name: 'Nginx: Get stub status page'
          key: 'web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: |
            The following status information is provided:
            Active connections - the current number of active client connections including Waiting connections.
            Accepts - the total number of accepted client connections.
            Handled - the total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached (for example, the worker_connections limit).
            Requests - the total number of client requests.
            Reading - the current number of connections where nginx is reading the request header.
            Writing - the current number of connections where nginx is writing the response back to the client.
            Waiting - the current number of idle client connections waiting for a request.
            https://nginx.org/en/docs/http/ngx_http_stub_status_module.html
          tags:
            -
              tag: component
              value: application
            -
              tag: component
              value: health
          triggers:
            -
              uuid: a497b80eb03f469c9552881b498003b2
              expression: |
                find(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],,"like","HTTP/1.1 200")=0 or
                 nodata(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],30m)=1
              name: 'Nginx: Failed to fetch stub 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: 'Nginx: Process is not running'
                  expression: 'last(/Nginx by Zabbix agent/proc.num[nginx])=0'
                -
                  name: 'Nginx: Service is down'
                  expression: 'last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0'
              tags:
                -
                  tag: scope
                  value: availability
      tags:
        -
          tag: class
          value: software
        -
          tag: target
          value: nginx
      macros:
        -
          macro: '{$NGINX.DROP_RATE.MAX.WARN}'
          value: '1'
          description: 'The critical rate of the dropped connections for trigger expression.'
        -
          macro: '{$NGINX.RESPONSE_TIME.MAX.WARN}'
          value: '10'
          description: 'The Nginx maximum response time in seconds for trigger expression.'
        -
          macro: '{$NGINX.STUB_STATUS.HOST}'
          value: localhost
          description: 'Hostname or IP of Nginx stub_status host or container.'
        -
          macro: '{$NGINX.STUB_STATUS.PATH}'
          value: basic_status
          description: 'The path of Nginx stub_status page.'
        -
          macro: '{$NGINX.STUB_STATUS.PORT}'
          value: '80'
          description: 'The port of Nginx stub_status host or container.'
      dashboards:
        -
          uuid: 9d071e3a148c405e85c53ef25d54efaf
          name: 'Nginx performance'
          pages:
            -
              widgets:
                -
                  type: GRAPH_CLASSIC
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'Nginx: Connections by state'
                        host: 'Nginx 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: 'Nginx: Requests per second'
                        host: 'Nginx by Zabbix agent'
                -
                  type: GRAPH_CLASSIC
                  'y': '5'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'Nginx: Connections per second'
                        host: 'Nginx by Zabbix agent'
      valuemaps:
        -
          uuid: 53c8528c18814f30a45d1540ab9e5c00
          name: 'Service state'
          mappings:
            -
              value: '0'
              newvalue: Down
            -
              value: '1'
              newvalue: Up
  graphs:
    -
      uuid: ba234158aeca468a8592d944f9aae691
      name: 'Nginx: Connections by state'
      graph_items:
        -
          drawtype: BOLD_LINE
          color: 1A7C11
          item:
            host: 'Nginx by Zabbix agent'
            key: nginx.connections.active
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Nginx by Zabbix agent'
            key: nginx.connections.waiting
        -
          sortorder: '2'
          color: F63100
          item:
            host: 'Nginx by Zabbix agent'
            key: nginx.connections.writing
        -
          sortorder: '3'
          color: A54F10
          item:
            host: 'Nginx by Zabbix agent'
            key: nginx.connections.reading
    -
      uuid: b82a5b89864a47638421458f3e74563d
      name: 'Nginx: Connections per second'
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Nginx by Zabbix agent'
            key: nginx.connections.accepted.rate
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Nginx by Zabbix agent'
            key: nginx.connections.handled.rate
        -
          sortorder: '2'
          color: F63100
          item:
            host: 'Nginx by Zabbix agent'
            key: nginx.connections.dropped.rate
    -
      uuid: 69ca908afa1d468d983a263d06910925
      name: 'Nginx: Memory usage'
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'Nginx by Zabbix agent'
            key: 'proc.mem[nginx,,,,vsize]'
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'Nginx by Zabbix agent'
            key: 'proc.mem[nginx,,,,rss]'
    -
      uuid: a2d2fec823514df09731381304c245e9
      name: 'Nginx: Requests per second'
      graph_items:
        -
          drawtype: GRADIENT_LINE
          color: 1A7C11
          item:
            host: 'Nginx by Zabbix agent'
            key: nginx.requests.total.rate