Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent?at=release/7.4
Nginx by Zabbix agent
Overview
This template is developed to monitor Nginx by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template Nginx by Zabbix agent
- collects metrics by polling the Module ngx_http_stub_status_module locally with Zabbix agent:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get
).
It also uses Zabbix agent to collect Nginx
Linux process statistics, such as CPU usage, memory usage and whether the process is running or not.
Requirements
Zabbix version: 7.4 and higher.
Tested versions
This template has been tested on:
- Nginx 1.17.2
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for ngx_http_stub_status_module.
Test the availability of the http_stub_status_module
nginx -V 2>&1 | grep -o with-http_stub_status_module
.
Example configuration of Nginx:
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
If you use another location, then don't forget to change the {$NGINX.STUB_STATUS.PATH} macro.
Example answer from Nginx:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support https and redirects (limitations of web.page.get).
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$NGINX.STUB_STATUS.HOST} | The hostname or IP address of the Nginx host or Nginx container of |
localhost |
{$NGINX.STUB_STATUS.PATH} | The path of the |
basic_status |
{$NGINX.STUB_STATUS.PORT} | The port of the |
80 |
{$NGINX.PROCESS_NAME} | The process name filter for the Nginx process discovery. |
nginx |
{$NGINX.PROCESS.NAME.PARAMETER} | The process name of the Nginx server used in the item key |
|
{$NGINX.RESPONSE_TIME.MAX.WARN} | The maximum response time of Nginx expressed in seconds for a trigger expression. |
10 |
{$NGINX.DROP_RATE.MAX.WARN} | The critical rate of the dropped connections for a trigger expression. |
1 |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Get stub status page | The following status information is provided:
See also Module ngx_http_stub_status_module. |
Zabbix agent | web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"] |
Service status | Zabbix agent | net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] Preprocessing
|
|
Service response time | Zabbix agent | net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] | |
Requests total | The total number of client requests. |
Dependent item | nginx.requests.total Preprocessing
|
Requests per second | The total number of client requests. |
Dependent item | nginx.requests.total.rate Preprocessing
|
Connections accepted per second | The total number of accepted client connections. |
Dependent item | nginx.connections.accepted.rate Preprocessing
|
Connections dropped per second | The total number of dropped client connections. |
Dependent item | nginx.connections.dropped.rate Preprocessing
|
Connections handled per second | The total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the |
Dependent item | nginx.connections.handled.rate Preprocessing
|
Connections active | The current number of active client connections including waiting connections. |
Dependent item | nginx.connections.active Preprocessing
|
Connections reading | The current number of connections where Nginx is reading the request header. |
Dependent item | nginx.connections.reading Preprocessing
|
Connections waiting | The current number of idle client connections waiting for a request. |
Dependent item | nginx.connections.waiting Preprocessing
|
Connections writing | The current number of connections where Nginx is writing a response back to the client. |
Dependent item | nginx.connections.writing Preprocessing
|
Version | Dependent item | nginx.version Preprocessing
|
|
Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$NGINX.PROCESS.NAME.PARAMETER},,,summary] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Version has changed | The Nginx version has changed. Acknowledge to close the problem manually. |
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 |
Info | Manual close: Yes |
LLD rule Nginx process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Nginx process discovery | The discovery of Nginx process summary. |
Dependent item | nginx.proc.discovery |
Item prototypes for Nginx process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
CPU utilization | The percentage of the CPU utilization by a process {#NGINX.NAME}. |
Zabbix agent | proc.cpu.util[{#NGINX.NAME}] |
Get process data | The summary metrics aggregated by a process {#NGINX.NAME}. |
Dependent item | nginx.proc.get[{#NGINX.NAME}] Preprocessing
|
Memory usage (vsize) | The summary of virtual memory used by a process {#NGINX.NAME} expressed in bytes. |
Dependent item | nginx.proc.vmem[{#NGINX.NAME}] Preprocessing
|
Memory usage (rss) | The summary of resident set size memory used by a process {#NGINX.NAME} expressed in bytes. |
Dependent item | nginx.proc.rss[{#NGINX.NAME}] Preprocessing
|
Memory usage, % | The percentage of real memory used by a process {#NGINX.NAME}. |
Dependent item | nginx.proc.pmem[{#NGINX.NAME}] Preprocessing
|
Number of running processes | The number of running processes {#NGINX.NAME}. |
Dependent item | nginx.proc.num[{#NGINX.NAME}] Preprocessing
|
Trigger prototypes for Nginx process discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Process is not running | last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])=0 |
High | ||
Nginx: Service is down | last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0 and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Average | Manual close: Yes | |
Nginx: High connections drop rate | The rate of dropping connections has been greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes. |
min(/Nginx by Zabbix agent/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Depends on:
|
Nginx: Service response time is too high | min(/Nginx by Zabbix agent/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
|
Nginx: Failed to fetch stub status page | Zabbix has not received any data for items for the last 30 minutes. |
(find(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],,"iregexp","HTTP\\/[\\d.]+\\s+200")=0 or nodata(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],30m)) and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent?at=release/7.2
Nginx by Zabbix agent
Overview
This template is developed to monitor Nginx by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template Nginx by Zabbix agent
- collects metrics by polling the Module ngx_http_stub_status_module locally with Zabbix agent:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get
).
It also uses Zabbix agent to collect Nginx
Linux process statistics, such as CPU usage, memory usage and whether the process is running or not.
Requirements
Zabbix version: 7.2 and higher.
Tested versions
This template has been tested on:
- Nginx 1.17.2
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for ngx_http_stub_status_module.
Test the availability of the http_stub_status_module
nginx -V 2>&1 | grep -o with-http_stub_status_module
.
Example configuration of Nginx:
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
If you use another location, then don't forget to change the {$NGINX.STUB_STATUS.PATH} macro.
Example answer from Nginx:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support https and redirects (limitations of web.page.get).
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$NGINX.STUB_STATUS.HOST} | The hostname or IP address of the Nginx host or Nginx container of |
localhost |
{$NGINX.STUB_STATUS.PATH} | The path of the |
basic_status |
{$NGINX.STUB_STATUS.PORT} | The port of the |
80 |
{$NGINX.RESPONSE_TIME.MAX.WARN} | The maximum response time of Nginx expressed in seconds for a trigger expression. |
10 |
{$NGINX.DROP_RATE.MAX.WARN} | The critical rate of the dropped connections for a trigger expression. |
1 |
{$NGINX.PROCESS_NAME} | The process name filter for the Nginx process discovery. |
nginx |
{$NGINX.PROCESS.NAME.PARAMETER} | The process name of the Nginx server used in the item key |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Get stub status page | The following status information is provided:
See also Module ngx_http_stub_status_module. |
Zabbix agent | web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"] |
Service status | Zabbix agent | net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] Preprocessing
|
|
Service response time | Zabbix agent | net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] | |
Requests total | The total number of client requests. |
Dependent item | nginx.requests.total Preprocessing
|
Requests per second | The total number of client requests. |
Dependent item | nginx.requests.total.rate Preprocessing
|
Connections accepted per second | The total number of accepted client connections. |
Dependent item | nginx.connections.accepted.rate Preprocessing
|
Connections dropped per second | The total number of dropped client connections. |
Dependent item | nginx.connections.dropped.rate Preprocessing
|
Connections handled per second | The total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the |
Dependent item | nginx.connections.handled.rate Preprocessing
|
Connections active | The current number of active client connections including waiting connections. |
Dependent item | nginx.connections.active Preprocessing
|
Connections reading | The current number of connections where Nginx is reading the request header. |
Dependent item | nginx.connections.reading Preprocessing
|
Connections waiting | The current number of idle client connections waiting for a request. |
Dependent item | nginx.connections.waiting Preprocessing
|
Connections writing | The current number of connections where Nginx is writing a response back to the client. |
Dependent item | nginx.connections.writing Preprocessing
|
Version | Dependent item | nginx.version Preprocessing
|
|
Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$NGINX.PROCESS.NAME.PARAMETER},,,summary] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Version has changed | The Nginx version has changed. Acknowledge to close the problem manually. |
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 |
Info | Manual close: Yes |
LLD rule Nginx process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Nginx process discovery | The discovery of Nginx process summary. |
Dependent item | nginx.proc.discovery |
Item prototypes for Nginx process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
CPU utilization | The percentage of the CPU utilization by a process {#NGINX.NAME}. |
Zabbix agent | proc.cpu.util[{#NGINX.NAME}] |
Get process data | The summary metrics aggregated by a process {#NGINX.NAME}. |
Dependent item | nginx.proc.get[{#NGINX.NAME}] Preprocessing
|
Memory usage (vsize) | The summary of virtual memory used by a process {#NGINX.NAME} expressed in bytes. |
Dependent item | nginx.proc.vmem[{#NGINX.NAME}] Preprocessing
|
Memory usage (rss) | The summary of resident set size memory used by a process {#NGINX.NAME} expressed in bytes. |
Dependent item | nginx.proc.rss[{#NGINX.NAME}] Preprocessing
|
Memory usage, % | The percentage of real memory used by a process {#NGINX.NAME}. |
Dependent item | nginx.proc.pmem[{#NGINX.NAME}] Preprocessing
|
Number of running processes | The number of running processes {#NGINX.NAME}. |
Dependent item | nginx.proc.num[{#NGINX.NAME}] Preprocessing
|
Trigger prototypes for Nginx process discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Process is not running | last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])=0 |
High | ||
Nginx: Service is down | last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0 and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Average | Manual close: Yes | |
Nginx: High connections drop rate | The rate of dropping connections has been greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes. |
min(/Nginx by Zabbix agent/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Depends on:
|
Nginx: Service response time is too high | min(/Nginx by Zabbix agent/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
|
Nginx: Failed to fetch stub status page | Zabbix has not received any data for items for the last 30 minutes. |
(find(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],,"iregexp","HTTP\\/[\\d.]+\\s+200")=0 or nodata(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],30m)) and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent?at=release/7.0
Nginx by Zabbix agent
Overview
This template is developed to monitor Nginx by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template Nginx by Zabbix agent
- collects metrics by polling the Module ngx_http_stub_status_module locally with Zabbix agent:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get
).
It also uses Zabbix agent to collect Nginx
Linux process statistics, such as CPU usage, memory usage and whether the process is running or not.
Requirements
Zabbix version: 7.0 and higher.
Tested versions
This template has been tested on:
- Nginx 1.17.2
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for ngx_http_stub_status_module.
Test the availability of the http_stub_status_module
nginx -V 2>&1 | grep -o with-http_stub_status_module
.
Example configuration of Nginx:
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
If you use another location, then don't forget to change the {$NGINX.STUB_STATUS.PATH} macro.
Example answer from Nginx:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support https and redirects (limitations of web.page.get).
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$NGINX.STUB_STATUS.HOST} | The hostname or IP address of the Nginx host or Nginx container of |
localhost |
{$NGINX.STUB_STATUS.PATH} | The path of the |
basic_status |
{$NGINX.STUB_STATUS.PORT} | The port of the |
80 |
{$NGINX.RESPONSE_TIME.MAX.WARN} | The maximum response time of Nginx expressed in seconds for a trigger expression. |
10 |
{$NGINX.DROP_RATE.MAX.WARN} | The critical rate of the dropped connections for a trigger expression. |
1 |
{$NGINX.PROCESS_NAME} | The process name filter for the Nginx process discovery. |
nginx |
{$NGINX.PROCESS.NAME.PARAMETER} | The process name of the Nginx server used in the item key |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Get stub status page | The following status information is provided:
See also Module ngx_http_stub_status_module. |
Zabbix agent | web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"] |
Service status | Zabbix agent | net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] Preprocessing
|
|
Service response time | Zabbix agent | net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] | |
Requests total | The total number of client requests. |
Dependent item | nginx.requests.total Preprocessing
|
Requests per second | The total number of client requests. |
Dependent item | nginx.requests.total.rate Preprocessing
|
Connections accepted per second | The total number of accepted client connections. |
Dependent item | nginx.connections.accepted.rate Preprocessing
|
Connections dropped per second | The total number of dropped client connections. |
Dependent item | nginx.connections.dropped.rate Preprocessing
|
Connections handled per second | The total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the |
Dependent item | nginx.connections.handled.rate Preprocessing
|
Connections active | The current number of active client connections including waiting connections. |
Dependent item | nginx.connections.active Preprocessing
|
Connections reading | The current number of connections where Nginx is reading the request header. |
Dependent item | nginx.connections.reading Preprocessing
|
Connections waiting | The current number of idle client connections waiting for a request. |
Dependent item | nginx.connections.waiting Preprocessing
|
Connections writing | The current number of connections where Nginx is writing a response back to the client. |
Dependent item | nginx.connections.writing Preprocessing
|
Version | Dependent item | nginx.version Preprocessing
|
|
Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$NGINX.PROCESS.NAME.PARAMETER},,,summary] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Version has changed | The Nginx version has changed. Acknowledge to close the problem manually. |
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 |
Info | Manual close: Yes |
LLD rule Nginx process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Nginx process discovery | The discovery of Nginx process summary. |
Dependent item | nginx.proc.discovery |
Item prototypes for Nginx process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
CPU utilization | The percentage of the CPU utilization by a process {#NGINX.NAME}. |
Zabbix agent | proc.cpu.util[{#NGINX.NAME}] |
Get process data | The summary metrics aggregated by a process {#NGINX.NAME}. |
Dependent item | nginx.proc.get[{#NGINX.NAME}] Preprocessing
|
Memory usage (vsize) | The summary of virtual memory used by a process {#NGINX.NAME} expressed in bytes. |
Dependent item | nginx.proc.vmem[{#NGINX.NAME}] Preprocessing
|
Memory usage (rss) | The summary of resident set size memory used by a process {#NGINX.NAME} expressed in bytes. |
Dependent item | nginx.proc.rss[{#NGINX.NAME}] Preprocessing
|
Memory usage, % | The percentage of real memory used by a process {#NGINX.NAME}. |
Dependent item | nginx.proc.pmem[{#NGINX.NAME}] Preprocessing
|
Number of running processes | The number of running processes {#NGINX.NAME}. |
Dependent item | nginx.proc.num[{#NGINX.NAME}] Preprocessing
|
Trigger prototypes for Nginx process discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Process is not running | last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])=0 |
High | ||
Nginx: Service is down | last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0 and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Average | Manual close: Yes | |
Nginx: High connections drop rate | The rate of dropping connections has been greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes. |
min(/Nginx by Zabbix agent/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Depends on:
|
Nginx: Service response time is too high | min(/Nginx by Zabbix agent/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
|
Nginx: Failed to fetch stub status page | Zabbix has not received any data for items for the last 30 minutes. |
(find(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],,"iregexp","HTTP\\/[\\d.]+\\s+200")=0 or nodata(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],30m)) and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent?at=release/6.4
Nginx by Zabbix agent
Overview
This template is developed to monitor Nginx by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template Nginx by Zabbix agent
- collects metrics by polling the Module ngx_http_stub_status_module locally with Zabbix agent:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get
).
It also uses Zabbix agent to collect Nginx
Linux process statistics, such as CPU usage, memory usage and whether the process is running or not.
Requirements
Zabbix version: 6.4 and higher.
Tested versions
This template has been tested on:
- Nginx 1.17.2
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for ngx_http_stub_status_module.
Test the availability of the http_stub_status_module
nginx -V 2>&1 | grep -o with-http_stub_status_module
.
Example configuration of Nginx:
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
If you use another location, then don't forget to change the {$NGINX.STUB_STATUS.PATH} macro.
Example answer from Nginx:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support https and redirects (limitations of web.page.get).
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$NGINX.STUB_STATUS.HOST} | The hostname or IP address of the Nginx host or Nginx container of |
localhost |
{$NGINX.STUB_STATUS.PATH} | The path of the |
basic_status |
{$NGINX.STUB_STATUS.PORT} | The port of the |
80 |
{$NGINX.RESPONSE_TIME.MAX.WARN} | The maximum response time of Nginx expressed in seconds for a trigger expression. |
10 |
{$NGINX.DROP_RATE.MAX.WARN} | The critical rate of the dropped connections for a trigger expression. |
1 |
{$NGINX.PROCESS_NAME} | The process name filter for the Nginx process discovery. |
nginx |
{$NGINX.PROCESS.NAME.PARAMETER} | The process name of the Nginx server used in the item key |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Nginx: Get stub status page | The following status information is provided:
See also Module ngx_http_stub_status_module. |
Zabbix agent | web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"] |
Nginx: Service status | Zabbix agent | net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] Preprocessing
|
|
Nginx: Service response time | Zabbix agent | net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] | |
Nginx: Requests total | The total number of client requests. |
Dependent item | nginx.requests.total Preprocessing
|
Nginx: Requests per second | The total number of client requests. |
Dependent item | nginx.requests.total.rate Preprocessing
|
Nginx: Connections accepted per second | The total number of accepted client connections. |
Dependent item | nginx.connections.accepted.rate Preprocessing
|
Nginx: Connections dropped per second | The total number of dropped client connections. |
Dependent item | nginx.connections.dropped.rate Preprocessing
|
Nginx: Connections handled per second | The total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the |
Dependent item | nginx.connections.handled.rate Preprocessing
|
Nginx: Connections active | The current number of active client connections including waiting connections. |
Dependent item | nginx.connections.active Preprocessing
|
Nginx: Connections reading | The current number of connections where Nginx is reading the request header. |
Dependent item | nginx.connections.reading Preprocessing
|
Nginx: Connections waiting | The current number of idle client connections waiting for a request. |
Dependent item | nginx.connections.waiting Preprocessing
|
Nginx: Connections writing | The current number of connections where Nginx is writing a response back to the client. |
Dependent item | nginx.connections.writing Preprocessing
|
Nginx: Version | Dependent item | nginx.version Preprocessing
|
|
Nginx: Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$NGINX.PROCESS.NAME.PARAMETER},,,summary] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Version has changed | The Nginx version has changed. Acknowledge to close the problem manually. |
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 |
Info | Manual close: Yes |
LLD rule Nginx process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Nginx process discovery | The discovery of Nginx process summary. |
Dependent item | nginx.proc.discovery |
Item prototypes for Nginx process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Nginx: CPU utilization | The percentage of the CPU utilization by a process {#NGINX.NAME}. |
Zabbix agent | proc.cpu.util[{#NGINX.NAME}] |
Nginx: Get process data | The summary metrics aggregated by a process {#NGINX.NAME}. |
Dependent item | nginx.proc.get[{#NGINX.NAME}] Preprocessing
|
Nginx: Memory usage (vsize) | The summary of virtual memory used by a process {#NGINX.NAME} expressed in bytes. |
Dependent item | nginx.proc.vmem[{#NGINX.NAME}] Preprocessing
|
Nginx: Memory usage (rss) | The summary of resident set size memory used by a process {#NGINX.NAME} expressed in bytes. |
Dependent item | nginx.proc.rss[{#NGINX.NAME}] Preprocessing
|
Nginx: Memory usage, % | The percentage of real memory used by a process {#NGINX.NAME}. |
Dependent item | nginx.proc.pmem[{#NGINX.NAME}] Preprocessing
|
Nginx: Number of running processes | The number of running processes {#NGINX.NAME}. |
Dependent item | nginx.proc.num[{#NGINX.NAME}] Preprocessing
|
Trigger prototypes for Nginx process discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Process is not running | last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])=0 |
High | ||
Nginx: Service is down | last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0 and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Average | Manual close: Yes | |
Nginx: High connections drop rate | The rate of dropping connections has been greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes. |
min(/Nginx by Zabbix agent/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Depends on:
|
Nginx: Service response time is too high | min(/Nginx by Zabbix agent/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
|
Nginx: Failed to fetch stub status page | Zabbix has not received any data for items for the last 30 minutes. |
(find(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],,"iregexp","HTTP\/[\d.]+\s+200")=0 or nodata(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],30m)) and last(/Nginx by Zabbix agent/nginx.proc.num[{#NGINX.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent?at=release/6.2
Nginx by Zabbix agent
Overview
For Zabbix version: 6.2 and higher. This template is developed to monitor Nginx by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template Nginx by Zabbix agent
- collects metrics by polling the Module ngx_http_stub_status_module locally with Zabbix agent:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get
).
It also uses Zabbix agent to collect Nginx
Linux process statistics, such as CPU usage, memory usage and whether the process is running or not.
This template was tested on:
- Nginx, version 1.17.2
Setup
See Zabbix template operation for basic instructions.
See the setup instructions for ngx_http_stub_status_module.
Test the availability of the http_stub_status_module
with nginx -V 2>&1 | grep -o with-http_stub_status_module
.
Example configuration of Nginx:
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
If you use another location, then don't forget to change the {$NGINX.STUB_STATUS.PATH} macro. Install and setup Zabbix agent.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
Name | Description | Default |
---|---|---|
{$NGINX.DROP_RATE.MAX.WARN} | The critical rate of the dropped connections for a trigger expression. |
1 |
{$NGINX.PROCESS_NAME} | The process name of the Nginx server. |
nginx |
{$NGINX.RESPONSE_TIME.MAX.WARN} | The maximum response time of Nginx expressed in seconds for a trigger expression. |
10 |
{$NGINX.STUB_STATUS.HOST} | The Hostname or an IP addess of the Nginx host or Nginx container of |
localhost |
{$NGINX.STUB_STATUS.PATH} | The path of the |
basic_status |
{$NGINX.STUB_STATUS.PORT} | The port of the |
80 |
Template links
There are no template links in this template.
Discovery rules
Name | Description | Type | Key and additional info |
---|---|---|---|
Nginx process discovery | The discovery of Nginx process summary. |
DEPENDENT | nginx.proc.discovery Filter: AND- {#NAME} MATCHES_REGEX |
Items collected
Group | Name | Description | Type | Key and additional info |
---|---|---|---|---|
Nginx | Nginx: Service status | - |
ZABBIX_PASSIVE | net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] Preprocessing: - DISCARD_UNCHANGED_HEARTBEAT: |
Nginx | Nginx: Service response time | - |
ZABBIX_PASSIVE | net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] |
Nginx | Nginx: Requests total | The total number of client requests. |
DEPENDENT | nginx.requests.total Preprocessing: - REGEX: |
Nginx | Nginx: Requests per second | The total number of client requests. |
DEPENDENT | nginx.requests.total.rate Preprocessing: - REGEX: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections accepted per second | The total number of accepted client connections. |
DEPENDENT | nginx.connections.accepted.rate Preprocessing: - REGEX: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections dropped per second | The total number of dropped client connections. |
DEPENDENT | nginx.connections.dropped.rate Preprocessing: - JAVASCRIPT: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections handled per second | The total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the |
DEPENDENT | nginx.connections.handled.rate Preprocessing: - REGEX: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections active | The current number of active client connections including waiting connections. |
DEPENDENT | nginx.connections.active Preprocessing: - REGEX: |
Nginx | Nginx: Connections reading | The current number of connections where Nginx is reading the request header. |
DEPENDENT | nginx.connections.reading Preprocessing: - REGEX: |
Nginx | Nginx: Connections waiting | The current number of idle client connections waiting for a request. |
DEPENDENT | nginx.connections.waiting Preprocessing: - REGEX: |
Nginx | Nginx: Connections writing | The current number of connections where Nginx is writing a response back to the client. |
DEPENDENT | nginx.connections.writing Preprocessing: - REGEX: |
Nginx | Nginx: Get processes summary | The aggregated data of summary metrics for all processes. |
ZABBIX_PASSIVE | proc.get[,,,summary] |
Nginx | Nginx: Version | - |
DEPENDENT | nginx.version Preprocessing: - REGEX: - DISCARD_UNCHANGED_HEARTBEAT: |
Nginx | Nginx: CPU utilization | The percentage of the CPU utilization by a process {#NAME}. |
ZABBIX_PASSIVE | proc.cpu.util[{#NAME}] |
Nginx | Nginx: Get process data | The summary metrics aggregated by a process {#NAME}. |
DEPENDENT | nginx.proc.get[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
Nginx | Nginx: Memory usage (vsize) | The summary of virtual memory used by a process {#NAME} expressed in bytes. |
DEPENDENT | nginx.proc.vmem[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
Nginx | Nginx: Memory usage (rss) | The summary of resident set size memory used by a process {#NAME} expressed in bytes. |
DEPENDENT | nginx.proc.rss[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
Nginx | Nginx: Memory usage, % | The percentage of real memory used by a process {#NAME}. |
DEPENDENT | nginx.proc.pmem[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
Nginx | Nginx: Number of running processes | The number of running processes {#NAME}. |
DEPENDENT | nginx.proc.num[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: - DISCARD_UNCHANGED_HEARTBEAT: |
Zabbix raw items | Nginx: Get stub status page | The following status information is provided: See also Module ngx_http_stub_status_module. |
ZABBIX_PASSIVE | web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Version has changed | The Nginx version has changed. Acknowledge (Ack) to close manually. |
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 |
INFO | Manual close: YES |
Nginx: Process is not running | - |
last(/Nginx by Zabbix agent/nginx.proc.num[{#NAME}])=0 |
HIGH | |
Nginx: Service is down | - |
last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0 and last(/Nginx by Zabbix agent/nginx.proc.num[{#NAME}])>0 |
AVERAGE | Manual close: YES |
Nginx: High connections drop rate | The rate of dropping connections has been greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes. |
min(/Nginx by Zabbix agent/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NAME}])>0 |
WARNING | Depends on: - Nginx: Service is down |
Nginx: Service response time is too high | - |
min(/Nginx by Zabbix agent/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN} and last(/Nginx by Zabbix agent/nginx.proc.num[{#NAME}])>0 |
WARNING | Manual close: YES Depends on: - Nginx: Service is down |
Nginx: Failed to fetch stub status page | Zabbix has not received any data for items for the last 30 minutes. |
(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)) and last(/Nginx by Zabbix agent/nginx.proc.num[{#NAME}])>0 |
WARNING | Manual close: YES Depends on: - Nginx: Service is down |
Feedback
Please report any issues with the template at https://support.zabbix.com.
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums.
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent?at=release/6.0
Nginx by Zabbix agent
Overview
This template is developed to monitor Nginx by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
The template Nginx by Zabbix agent
- collects metrics by polling the Module ngx_http_stub_status_module locally with Zabbix agent:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support HTTPS and redirects (limitations of web.page.get
).
It also uses Zabbix agent to collect Nginx
Linux process statistics, such as CPU usage, memory usage and whether the process is running or not.
Requirements
Zabbix version: 6.0 and higher.
Tested versions
This template has been tested on:
- Nginx 1.17.2
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for ngx_http_stub_status_module.
Test the availability of the http_stub_status_module
nginx -V 2>&1 | grep -o with-http_stub_status_module
.
Example configuration of Nginx:
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
If you use another location, then don't forget to change the {$NGINX.STUB_STATUS.PATH} macro.
Example answer from Nginx:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support https and redirects (limitations of web.page.get).
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$NGINX.STUB_STATUS.HOST} | The hostname or IP address of the Nginx host or Nginx container of |
localhost |
{$NGINX.STUB_STATUS.PATH} | The path of the |
basic_status |
{$NGINX.STUB_STATUS.PORT} | The port of the |
80 |
{$NGINX.RESPONSE_TIME.MAX.WARN} | The maximum response time of Nginx expressed in seconds for a trigger expression. |
10 |
{$NGINX.DROP_RATE.MAX.WARN} | The critical rate of the dropped connections for a trigger expression. |
1 |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Nginx: Get stub status page | The following status information is provided:
See also Module ngx_http_stub_status_module. |
Zabbix agent | web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"] |
Nginx: Service status | Zabbix agent | net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] Preprocessing
|
|
Nginx: Service response time | Zabbix agent | net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] | |
Nginx: Requests total | The total number of client requests. |
Dependent item | nginx.requests.total Preprocessing
|
Nginx: Requests per second | The total number of client requests. |
Dependent item | nginx.requests.total.rate Preprocessing
|
Nginx: Connections accepted per second | The total number of accepted client connections. |
Dependent item | nginx.connections.accepted.rate Preprocessing
|
Nginx: Connections dropped per second | The total number of dropped client connections. |
Dependent item | nginx.connections.dropped.rate Preprocessing
|
Nginx: Connections handled per second | The total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the |
Dependent item | nginx.connections.handled.rate Preprocessing
|
Nginx: Connections active | The current number of active client connections including waiting connections. |
Dependent item | nginx.connections.active Preprocessing
|
Nginx: Connections reading | The current number of connections where Nginx is reading the request header. |
Dependent item | nginx.connections.reading Preprocessing
|
Nginx: Connections waiting | The current number of idle client connections waiting for a request. |
Dependent item | nginx.connections.waiting Preprocessing
|
Nginx: Connections writing | The current number of connections where Nginx is writing a response back to the client. |
Dependent item | nginx.connections.writing Preprocessing
|
Nginx: Number of running processes | Number of the Nginx processes running. |
Zabbix agent | proc.num[nginx] |
Nginx: Memory usage (vsize) | Virtual memory size used by process in bytes. |
Zabbix agent | proc.mem[nginx,,,,vsize] |
Nginx: Memory usage (rss) | Resident set size memory used by process in bytes. |
Zabbix agent | proc.mem[nginx,,,,rss] |
Nginx: CPU utilization | Process CPU utilization percentage. |
Zabbix agent | proc.cpu.util[nginx] |
Nginx: Version | Dependent item | nginx.version Preprocessing
|
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Failed to fetch stub status page | Zabbix has not received any data for items for the last 30 minutes. |
find(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"],,"iregexp","HTTP\/[\d.]+\s+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 |
Warning | Manual close: Yes Depends on:
|
Nginx: Service is down | last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0 |
Average | Manual close: Yes Depends on:
|
|
Nginx: Service response time is too high | min(/Nginx by Zabbix agent/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN} |
Warning | Manual close: Yes Depends on:
|
|
Nginx: High connections drop rate | The rate of dropping connections has been greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes. |
min(/Nginx by Zabbix agent/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN} |
Warning | Depends on:
|
Nginx: Process is not running | last(/Nginx by Zabbix agent/proc.num[nginx])=0 |
High | ||
Nginx: Version has changed | The Nginx version has changed. Acknowledge to close the problem manually. |
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 |
Info | Manual close: Yes |
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent?at=release/5.4
Nginx by Zabbix agent
Overview
For Zabbix version: 5.4 and higher
The template to monitor Nginx by Zabbix that work without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
Template Nginx by Zabbix agent
collects metrics by polling ngx_http_stub_status_module locally with Zabbix agent:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support https and redirects (limitations of web.page.get).
It also uses Zabbix agent to collect nginx
Linux process stats like CPU usage, memory usage and whether process is running or not.
This template was tested on:
- Nginx, version 1.17.2
Setup
See Zabbix template operation for basic instructions.
Setup ngx_http_stub_status_module.
Test availability of http_stub_status module with nginx -V 2>&1 | grep -o with-http_stub_status_module
.
Example configuration of Nginx:
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
If you use another location, then don't forget to change {$NGINX.STUB_STATUS.PATH} macro. Install and setup Zabbix agent.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
Name | Description | Default |
---|---|---|
{$NGINX.DROP_RATE.MAX.WARN} | The critical rate of the dropped connections for trigger expression. |
1 |
{$NGINX.RESPONSE_TIME.MAX.WARN} | The Nginx maximum response time in seconds for trigger expression. |
10 |
{$NGINX.STUB_STATUS.HOST} | Hostname or IP of Nginx stub_status host or container. |
localhost |
{$NGINX.STUB_STATUS.PATH} | The path of Nginx stub_status page. |
basic_status |
{$NGINX.STUB_STATUS.PORT} | The port of Nginx stub_status host or container. |
80 |
Template links
There are no template links in this template.
Discovery rules
Items collected
Group | Name | Description | Type | Key and additional info |
---|---|---|---|---|
Nginx | Nginx: Service status | - |
ZABBIX_PASSIVE | net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] Preprocessing: - DISCARD_UNCHANGED_HEARTBEAT: |
Nginx | Nginx: Service response time | - |
ZABBIX_PASSIVE | net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] |
Nginx | Nginx: Requests total | The total number of client requests. |
DEPENDENT | nginx.requests.total Preprocessing: - REGEX: |
Nginx | Nginx: Requests per second | The total number of client requests. |
DEPENDENT | nginx.requests.total.rate Preprocessing: - REGEX: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections accepted per second | The total number of accepted client connections. |
DEPENDENT | nginx.connections.accepted.rate Preprocessing: - REGEX: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections dropped per second | The total number of dropped client connections. |
DEPENDENT | nginx.connections.dropped.rate Preprocessing: - JAVASCRIPT: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections handled per second | 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). |
DEPENDENT | nginx.connections.handled.rate Preprocessing: - REGEX: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections active | The current number of active client connections including Waiting connections. |
DEPENDENT | nginx.connections.active Preprocessing: - REGEX: |
Nginx | Nginx: Connections reading | The current number of connections where nginx is reading the request header. |
DEPENDENT | nginx.connections.reading Preprocessing: - REGEX: |
Nginx | Nginx: Connections waiting | The current number of idle client connections waiting for a request. |
DEPENDENT | nginx.connections.waiting Preprocessing: - REGEX: |
Nginx | Nginx: Connections writing | The current number of connections where nginx is writing the response back to the client. |
DEPENDENT | nginx.connections.writing Preprocessing: - REGEX: |
Nginx | Nginx: Number of processes running | Number of the Nginx processes running. |
ZABBIX_PASSIVE | proc.num[nginx] |
Nginx | Nginx: Memory usage (vsize) | Virtual memory size used by process in bytes. |
ZABBIX_PASSIVE | proc.mem[nginx,,,,vsize] |
Nginx | Nginx: Memory usage (rss) | Resident set size memory used by process in bytes. |
ZABBIX_PASSIVE | proc.mem[nginx,,,,rss] |
Nginx | Nginx: CPU utilization | Process CPU utilization percentage. |
ZABBIX_PASSIVE | proc.cpu.util[nginx] |
Nginx | Nginx: Version | - |
DEPENDENT | nginx.version Preprocessing: - REGEX: - DISCARD_UNCHANGED_HEARTBEAT: |
Zabbix_raw_items | Nginx: Get stub status page | 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 |
ZABBIX_PASSIVE | web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Service is down | - |
last(/Nginx by Zabbix agent/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0 |
AVERAGE | Manual close: YES Depends on: - Nginx: Process is not running |
Nginx: Service response time is too high (over {$NGINX.RESPONSE_TIME.MAX.WARN}s for 5m) | - |
min(/Nginx by Zabbix agent/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN} |
WARNING | Manual close: YES Depends on: - Nginx: Process is not running - Nginx: Service is down |
Nginx: High connections drop rate (more than {$NGINX.DROP_RATE.MAX.WARN} for 5m) | The dropping rate connections is greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes. |
min(/Nginx by Zabbix agent/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN} |
WARNING | Depends on: - Nginx: Process is not running - Nginx: Service is down |
Nginx: Process is not running | - |
last(/Nginx by Zabbix agent/proc.num[nginx])=0 |
HIGH | |
Nginx: Version has changed (new version: {ITEM.VALUE}) | Nginx version has changed. Ack to close. |
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 |
INFO | Manual close: YES |
Nginx: Failed to fetch stub status page (or no data for 30m) | Zabbix has not received data for items for the last 30 minutes. |
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 |
WARNING | Manual close: YES Depends on: - Nginx: Process is not running - Nginx: Service is down |
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide a feedback, discuss the template or ask for help with it at ZABBIX forums.
Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent?at=release/5.0
Template App Nginx by Zabbix agent
Overview
For Zabbix version: 5.0 and higher
The template to monitor Nginx by Zabbix that work without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
Template Nginx by Zabbix agent
collects metrics by polling ngx_http_stub_status_module locally with Zabbix agent:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
Note that this template doesn't support https and redirects (limitations of web.page.get).
It also uses Zabbix agent to collect nginx
Linux process stats like CPU usage, memory usage and whether process is running or not.
This template was tested on:
- Nginx, version 1.17.2
Setup
See Zabbix template operation for basic instructions.
Setup ngx_http_stub_status_module.
Test availability of http_stub_status module with nginx -V 2>&1 | grep -o with-http_stub_status_module
.
Example configuration of Nginx:
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
If you use another location, then don't forget to change {$NGINX.STUB_STATUS.PATH} macro. Install and setup Zabbix agent.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
Name | Description | Default |
---|---|---|
{$NGINX.DROP_RATE.MAX.WARN} | The critical rate of the dropped connections for trigger expression. |
1 |
{$NGINX.RESPONSE_TIME.MAX.WARN} | The Nginx maximum response time in seconds for trigger expression. |
10 |
{$NGINX.STUB_STATUS.HOST} | Hostname or IP of Nginx stub_status host or container. |
localhost |
{$NGINX.STUB_STATUS.PATH} | The path of Nginx stub_status page. |
basic_status |
{$NGINX.STUB_STATUS.PORT} | The port of Nginx stub_status host or container. |
80 |
Template links
There are no template links in this template.
Discovery rules
Items collected
Group | Name | Description | Type | Key and additional info |
---|---|---|---|---|
Nginx | Nginx: Service status | - |
ZABBIX_PASSIVE | net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] Preprocessing: - DISCARD_UNCHANGED_HEARTBEAT: |
Nginx | Nginx: Service response time | - |
ZABBIX_PASSIVE | net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] |
Nginx | Nginx: Requests total | The total number of client requests. |
DEPENDENT | nginx.requests.total Preprocessing: - REGEX: |
Nginx | Nginx: Requests per second | The total number of client requests. |
DEPENDENT | nginx.requests.total.rate Preprocessing: - REGEX: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections accepted per second | The total number of accepted client connections. |
DEPENDENT | nginx.connections.accepted.rate Preprocessing: - REGEX: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections dropped per second | The total number of dropped client connections. |
DEPENDENT | nginx.connections.dropped.rate Preprocessing: - JAVASCRIPT: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections handled per second | 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). |
DEPENDENT | nginx.connections.handled.rate Preprocessing: - REGEX: - CHANGE_PER_SECOND |
Nginx | Nginx: Connections active | The current number of active client connections including Waiting connections. |
DEPENDENT | nginx.connections.active Preprocessing: - REGEX: |
Nginx | Nginx: Connections reading | The current number of connections where nginx is reading the request header. |
DEPENDENT | nginx.connections.reading Preprocessing: - REGEX: |
Nginx | Nginx: Connections waiting | The current number of idle client connections waiting for a request. |
DEPENDENT | nginx.connections.waiting Preprocessing: - REGEX: |
Nginx | Nginx: Connections writing | The current number of connections where nginx is writing the response back to the client. |
DEPENDENT | nginx.connections.writing Preprocessing: - REGEX: |
Nginx | Nginx: Number of processes running | Number of the Nginx processes running. |
ZABBIX_PASSIVE | proc.num[nginx] |
Nginx | Nginx: Memory usage (vsize) | Virtual memory size used by process in bytes. |
ZABBIX_PASSIVE | proc.mem[nginx,,,,vsize] |
Nginx | Nginx: Memory usage (rss) | Resident set size memory used by process in bytes. |
ZABBIX_PASSIVE | proc.mem[nginx,,,,rss] |
Nginx | Nginx: CPU utilization | Process CPU utilization percentage. |
ZABBIX_PASSIVE | proc.cpu.util[nginx] |
Nginx | Nginx: Version | - |
DEPENDENT | nginx.version Preprocessing: - REGEX: - DISCARD_UNCHANGED_HEARTBEAT: |
Zabbix_raw_items | Nginx: Get stub status page | 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 |
ZABBIX_PASSIVE | web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Nginx: Service is down | - |
{TEMPLATE_NAME:net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"].last()}=0 |
AVERAGE | Manual close: YES Depends on: - Nginx: Process is not running |
Nginx: Service response time is too high (over {$NGINX.RESPONSE_TIME.MAX.WARN}s for 5m) | - |
{TEMPLATE_NAME:net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"].min(5m)}>{$NGINX.RESPONSE_TIME.MAX.WARN} |
WARNING | Manual close: YES Depends on: - Nginx: Process is not running - Nginx: Service is down |
Nginx: High connections drop rate (more than {$NGINX.DROP_RATE.MAX.WARN} for 5m) | The dropping rate connections is greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes. |
{TEMPLATE_NAME:nginx.connections.dropped.rate.min(5m)} > {$NGINX.DROP_RATE.MAX.WARN} |
WARNING | Depends on: - Nginx: Process is not running - Nginx: Service is down |
Nginx: Process is not running | - |
{TEMPLATE_NAME:proc.num[nginx].last()}=0 |
HIGH | |
Nginx: Version has changed (new version: {ITEM.VALUE}) | Nginx version has changed. Ack to close. |
{TEMPLATE_NAME:nginx.version.diff()}=1 and {TEMPLATE_NAME:nginx.version.strlen()}>0 |
INFO | Manual close: YES |
Nginx: Failed to fetch stub status page (or no data for 30m) | Zabbix has not received data for items for the last 30 minutes. |
{TEMPLATE_NAME:web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"].str("HTTP/1.1 200")}=0 or {TEMPLATE_NAME:web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PATH}","{$NGINX.STUB_STATUS.PORT}"].nodata(30m)}=1 |
WARNING | Manual close: YES Depends on: - Nginx: Process is not running - Nginx: Service is down |
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide a feedback, discuss the template or ask for help with it at ZABBIX forums.