5.02021-11-21T21:33:59ZTemplatesApp Nginx by Alex GluckApp Nginx by Alex Gluck## Overview
System requirements
-------------------
[Nginx](http://nginx.org/ "Nginx"), with configured `http\_stub\_status\_module`
Features
--------
##### HTTP/HTTPS support
##### Connection Statistics:
* Active
* Reading
* Waiting
* Writing
##### Request Statistics:
* Accepted
* Handled
* Total
##### Graph and screen:
* 'Requests Statistics' graph
* 'Connection Status' graph
* Screen combining both graph
##### Macros for customization:
* {$NGINX\_HOST}
* {$NGINX\_STATS\_URI}
* {$NGINX\_PORT}
* {$NGINX\_REQ\_NUM}
* {$NGINX\_CON\_NUM}
Installation
------------
### Nginx Configuration
Add the following example to your default vhost configuration file:
```
location /nginx\_status {
stub\_status on;
access\_log off;
allow 127.0.0.1;
allow ::1;
deny all;
}
```
```
```
### Zabbix Configuration
1. Import XML template file (`zbx\_template\_nginx.xml`) into Zabbix via Web GUI (Configuration -> Templates -> Import).
2. Assign the imported template to a host and enjoy!
## Author
Alex Gluck
TemplatesNginx- Nginx: connections accepted per secDEPENDENTnginx.accepts033d100dNginxREGEX\s\d+\s\d+\s\d+
\0REGEX\d+
\0CHANGE_PER_SECONDweb.page.get[{$NGINX_HOST},{$NGINX_STATS_URI},{$NGINX_PORT}]
- Nginx: connects activeDEPENDENTnginx.active.connect033d100dNginxREGEXActive(.*)
\0REGEX\d+
\0web.page.get[{$NGINX_HOST},{$NGINX_STATS_URI},{$NGINX_PORT}]{last(0)}>{$NGINX_CON_NUM}RECOVERY_EXPRESSION{last(0)}<{$NGINX_CON_NUM}*0.8Nginx: many active connections on {HOST.NAME}WARNINGYESNginx: nginx is not running on {HOST.NAME}{App Nginx by Alex Gluck:proc.num[nginx].last(0)}<1
- Nginx: connections handled per secDEPENDENTnginx.handled033d100dNginxREGEX\s\d+\s\d+\s\d+
\0REGEX\s\d+\s\d+\s
\0REGEX\s\d+\s(.*)
\1CHANGE_PER_SECONDweb.page.get[{$NGINX_HOST},{$NGINX_STATS_URI},{$NGINX_PORT}]
- Nginx: connections readingDEPENDENTnginx.reading033d100dNginxREGEXReading:(.*)
\0REGEX\d+
\0web.page.get[{$NGINX_HOST},{$NGINX_STATS_URI},{$NGINX_PORT}]
- Nginx: requests per secDEPENDENTnginx.requests033d100dNginxREGEX\s\d+\s\d+\s\d+
\0REGEX\s\d+\s\d+\s(.*)
\1CHANGE_PER_SECONDweb.page.get[{$NGINX_HOST},{$NGINX_STATS_URI},{$NGINX_PORT}]{avg(240)}>{$NGINX_REQ_NUM}RECOVERY_EXPRESSION{avg(240)}>{$NGINX_REQ_NUM}*0.8Nginx: many requests on {HOST.NAME}WARNINGYESNginx: nginx is not running on {HOST.NAME}{App Nginx by Alex Gluck:proc.num[nginx].last(0)}<1{avg(240)}>{$NGINX_REQ_NUM}*1.5RECOVERY_EXPRESSION{avg(240)}>{$NGINX_REQ_NUM}*0.8Nginx: too many requests on {HOST.NAME}AVERAGEYESNginx: many active connections on {HOST.NAME}{App Nginx by Alex Gluck:nginx.active.connect.last(0)}>{$NGINX_CON_NUM}{App Nginx by Alex Gluck:nginx.active.connect.last(0)}<{$NGINX_CON_NUM}*0.8
- Nginx: connections waitingDEPENDENTnginx.waiting033d100dNginxREGEXWaiting:(.*)
\0REGEX\d+
\0web.page.get[{$NGINX_HOST},{$NGINX_STATS_URI},{$NGINX_PORT}]
- Nginx: connections writingDEPENDENTnginx.writing033d100dNginxREGEXWriting:(.*)
\0REGEX\d+
\0web.page.get[{$NGINX_HOST},{$NGINX_STATS_URI},{$NGINX_PORT}]
- Nginx: Number of processes $1proc.num[nginx]60s33d100dNginx{last(0)}<1Nginx: nginx is not running on {HOST.NAME}DISASTER
- Get Nginx stat pageweb.page.get[{$NGINX_HOST},{$NGINX_STATS_URI},{$NGINX_PORT}]60s12h0TEXTNginx
{$NGINX_CON_NUM}2500{$NGINX_HOST}localhost{$NGINX_PORT}80{$NGINX_REQ_NUM}600{$NGINX_STATS_URI}nginx-statsNginx performance210Nginx: ConnectionsApp Nginx by Alex Gluck50010000110000030Nginx: RequestsApp Nginx by Alex Gluck5001281011000003Nginx: Connections600NODASHED_LINEA54F10RIGHT- App Nginx by Alex Glucknginx.active.connect
12774A4RIGHT- App Nginx by Alex Glucknginx.writing
21A7C11RIGHT- App Nginx by Alex Glucknginx.reading
3F63100RIGHT- App Nginx by Alex Glucknginx.waiting
Nginx: Requests600NOGRADIENT_LINE1A7C11RIGHT- App Nginx by Alex Glucknginx.requests
1BOLD_LINEF63100RIGHT- App Nginx by Alex Glucknginx.accepts