zabbix_export: version: '5.4' date: '2021-11-21T21:41:45Z' groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 name: Templates/Applications templates: - uuid: a1f9cfe11f3c4359b70ba1db7162f911 template: NGINX_http_agent name: NGINX_http_agent description: | ## Overview **Nginx template based on http agent** **Nginx configuration example:** > > server { > > > listen 0.0.0.0:8080; > > > server\_name status.localhost; > > > keepalive\_timeout 0; > > > allow 127.0.0.1; > > > allow 192.168.11.254; > > > deny all; > > > location /server-status { > > > stub\_status on; > > > } > > > access\_log off; > > > } > > > **P.S. item "Number of nginx running" using zabbix agent (active), you can change it,** **use macros to specify the ip address and port of nginx** groups: - name: Templates/Applications items: - uuid: b342a50181fd452f867b4649c7aa47e7 name: 'Nginx: accepts per second' type: DEPENDENT key: nginx.accepts delay: '0' preprocessing: - type: REGEX parameters: - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)' - \1 - type: CHANGE_PER_SECOND parameters: - '' master_item: key: nginx.get tags: - tag: Application value: nginx - uuid: 05345787fcc04283821644da23601dab name: 'Nginx active connections' type: DEPENDENT key: nginx.connections.active delay: '0' preprocessing: - type: REGEX parameters: - 'Active connections:\s+([0-9]+)' - \1 master_item: key: nginx.get tags: - tag: Application value: nginx - uuid: 57b5ced42f84403c897d7128ee96824d name: 'Nginx: number of connections in reading state' type: DEPENDENT key: nginx.connections.reading delay: '0' preprocessing: - type: REGEX parameters: - 'Reading:\s+([0-9]+)' - \1 master_item: key: nginx.get tags: - tag: Application value: nginx - uuid: c43a2d6647b7411aaed5940a7fb20aca name: 'Nginx: number of connections in waiting state' type: DEPENDENT key: nginx.connections.waiting delay: '0' preprocessing: - type: REGEX parameters: - 'Waiting:\s+([0-9]+)' - \1 master_item: key: nginx.get tags: - tag: Application value: nginx - uuid: c73f1cd6986e44a7a495559c7fa110e1 name: 'Nginx: number of connections in writing state' type: DEPENDENT key: nginx.connections.writing delay: '0' preprocessing: - type: REGEX parameters: - 'Writing:\s+([0-9]+)' - \1 master_item: key: nginx.get tags: - tag: Application value: nginx - uuid: bb193d2d023a49aaa0e035c222e1e483 name: 'Get NGINX status page' type: HTTP_AGENT key: nginx.get delay: 30s history: 1d trends: '0' value_type: TEXT url: '{$PROTO}://{$HOST.NGINX}/server-status' follow_redirects: 'NO' tags: - tag: Application value: nginx - uuid: efac848ae65442838ad02b166a09e90e name: 'Nginx: handled per second' type: DEPENDENT key: nginx.handled delay: '0' preprocessing: - type: REGEX parameters: - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)' - \2 - type: CHANGE_PER_SECOND parameters: - '' master_item: key: nginx.get tags: - tag: Application value: nginx - uuid: 28d437241de04a1092143c6d53cb6d82 name: 'Nginx: requests per second' type: DEPENDENT key: nginx.requests delay: '0' preprocessing: - type: REGEX parameters: - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)' - \3 - type: CHANGE_PER_SECOND parameters: - '' master_item: key: nginx.get tags: - tag: Application value: nginx - uuid: 453a2762bc77470ebf3ec840bbbfb14b name: 'Number of nginx running' type: ZABBIX_ACTIVE key: 'proc.num[nginx]' delay: '90' history: 9d request_method: POST tags: - tag: Application value: nginx triggers: - uuid: bb671f3d45d44277bd34fdb820be5bdd expression: 'last(/NGINX_http_agent/proc.num[nginx])=0' name: 'nginx is down on {HOSTNAME}' priority: HIGH macros: - macro: '{$HOST.NGINX}' value: '127.0.0.1:8080' - macro: '{$PROTO}' value: http graphs: - uuid: d0adaf04af214f9781847d8136335baa name: 'Nginx status' show_work_period: 'NO' show_triggers: 'NO' graph_items: - color: 0000FF item: host: NGINX_http_agent key: nginx.connections.reading - color: FF33FF item: host: NGINX_http_agent key: nginx.connections.waiting - color: FF3333 item: host: NGINX_http_agent key: nginx.connections.writing - drawtype: BOLD_LINE color: '009900' item: host: NGINX_http_agent key: nginx.connections.active - uuid: bb201a3996dc4fa2a8abbfe8c61542a5 name: 'Nginx workload' graph_items: - color: '009900' item: host: NGINX_http_agent key: nginx.accepts - color: 3333FF item: host: NGINX_http_agent key: nginx.handled - color: FF0000 item: host: NGINX_http_agent key: nginx.requests