Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/apache_agent?at=release/7.4
Apache by Zabbix agent
Overview
This template is designed for the effortless deployment of Apache monitoring by Zabbix via Zabbix agent and doesn't require any external scripts.
The template Apache by Zabbix agent
- collects metrics by polling mod_status locally with Zabbix agent:
127.0.0.1
ServerVersion: Apache/2.4.41 (Unix)
ServerMPM: event
Server Built: Aug 14 2019 00:35:10
CurrentTime: Friday, 16-Aug-2019 12:38:40 UTC
RestartTime: Wednesday, 14-Aug-2019 07:58:26 UTC
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 189613
ServerUptime: 2 days 4 hours 40 minutes 13 seconds
Load1: 4.60
Load5: 1.20
Load15: 0.47
Total Accesses: 27860
Total kBytes: 33011
Total Duration: 54118
CPUUser: 18.02
CPUSystem: 31.76
CPUChildrenUser: 0
CPUChildrenSystem: 0
CPULoad: .0262535
Uptime: 189613
ReqPerSec: .146931
BytesPerSec: 178.275
BytesPerReq: 1213.33
DurationPerReq: 1.9425
BusyWorkers: 7
IdleWorkers: 93
Processes: 4
Stopping: 0
BusyWorkers: 7
IdleWorkers: 93
ConnsTotal: 13
ConnsAsyncWriting: 0
ConnsAsyncKeepAlive: 5
ConnsAsyncClosing: 0
Scoreboard: ...
It also uses Zabbix agent to collect Apache
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:
- Apache 2.4.41
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for mod_status.
Check the availability of the module with this command line: httpd -M 2>/dev/null | grep status_module
This is an example configuration of the Apache web server:
<Location "/server-status">
SetHandler server-status
Require host example.com
</Location>
If you use another path, then do not forget to change the {$APACHE.STATUS.PATH}
macro.
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$APACHE.STATUS.HOST} | The hostname or IP address of the Apache status page. |
127.0.0.1 |
{$APACHE.STATUS.PORT} | The port of the Apache status page. |
80 |
{$APACHE.STATUS.PATH} | The URL path of the Apache status page. |
server-status?auto |
{$APACHE.STATUS.SCHEME} | The request scheme, which may be either HTTP or HTTPS. |
http |
{$APACHE.RESPONSE_TIME.MAX.WARN} | The maximum Apache response time expressed in seconds for a trigger expression. |
10 |
{$APACHE.PROCESS_NAME} | The process name filter for the Apache process discovery. |
(httpd|apache2) |
{$APACHE.PROCESS.NAME.PARAMETER} | The process name of the Apache web server used in the item key |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Get status | Getting data from a machine-readable version of the Apache status page. For more information see Apache Module mod_status. |
Zabbix agent | web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"] Preprocessing
|
Service ping | Zabbix agent | net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] Preprocessing
|
|
Service response time | Zabbix agent | net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] | |
Total bytes | The total bytes served. |
Dependent item | apache.bytes Preprocessing
|
Bytes per second | It is calculated as a rate of change for total bytes statistics.
|
Dependent item | apache.bytes.rate Preprocessing
|
Requests per second | It is calculated as a rate of change for the "Total requests" statistics.
|
Dependent item | apache.requests.rate Preprocessing
|
Total requests | The total number of the Apache server accesses. |
Dependent item | apache.requests Preprocessing
|
Uptime | The service uptime expressed in seconds. |
Dependent item | apache.uptime Preprocessing
|
Version | The Apache service version. |
Dependent item | apache.version Preprocessing
|
Total workers busy | The total number of busy worker threads/processes. |
Dependent item | apache.workers_total.busy Preprocessing
|
Total workers idle | The total number of idle worker threads/processes. |
Dependent item | apache.workers_total.idle Preprocessing
|
Workers closing connection | The number of workers in closing state. |
Dependent item | apache.workers.closing Preprocessing
|
Workers DNS lookup | The number of workers in |
Dependent item | apache.workers.dnslookup Preprocessing
|
Workers finishing | The number of workers in finishing state. |
Dependent item | apache.workers.finishing Preprocessing
|
Workers idle cleanup | The number of workers in cleanup state. |
Dependent item | apache.workers.cleanup Preprocessing
|
Workers keepalive (read) | The number of workers in |
Dependent item | apache.workers.keepalive Preprocessing
|
Workers logging | The number of workers in logging state. |
Dependent item | apache.workers.logging Preprocessing
|
Workers reading request | The number of workers in reading state. |
Dependent item | apache.workers.reading Preprocessing
|
Workers sending reply | The number of workers in sending state. |
Dependent item | apache.workers.sending Preprocessing
|
Workers slot with no current process | The number of slots with no current process. |
Dependent item | apache.workers.slot Preprocessing
|
Workers starting up | The number of workers in starting state. |
Dependent item | apache.workers.starting Preprocessing
|
Workers waiting for connection | The number of workers in waiting state. |
Dependent item | apache.workers.waiting Preprocessing
|
Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$APACHE.PROCESS.NAME.PARAMETER},,,summary] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Service has been restarted | Uptime is less than 10 minutes. |
last(/Apache by Zabbix agent/apache.uptime)<10m |
Info | Manual close: Yes |
Apache: Version has changed | Apache version has changed. Acknowledge to close the problem manually. |
last(/Apache by Zabbix agent/apache.version,#1)<>last(/Apache by Zabbix agent/apache.version,#2) and length(last(/Apache by Zabbix agent/apache.version))>0 |
Info | Manual close: Yes |
LLD rule Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Event MPM discovery | The discovery of additional metrics if the event Multi-Processing Module (MPM) is used. For more details see Apache MPM event. |
Dependent item | apache.mpm.event.discovery Preprocessing
|
Item prototypes for Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Connections async closing | The number of asynchronous connections in closing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_closing{#SINGLETON}] Preprocessing
|
Connections async keepalive | The number of asynchronous connections in keepalive state (applicable only to the event MPM). |
Dependent item | apache.connections[async_keep_alive{#SINGLETON}] Preprocessing
|
Connections async writing | The number of asynchronous connections in writing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_writing{#SINGLETON}] Preprocessing
|
Connections total | The number of total connections. |
Dependent item | apache.connections[total{#SINGLETON}] Preprocessing
|
Bytes per request | The average number of client requests per second. |
Dependent item | apache.bytes[per_request{#SINGLETON}] Preprocessing
|
Number of async processes | The number of asynchronous processes. |
Dependent item | apache.process[num{#SINGLETON}] Preprocessing
|
LLD rule Apache process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache process discovery | The discovery of the Apache process summary. |
Dependent item | apache.proc.discovery |
Item prototypes for Apache process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
CPU utilization | The percentage of the CPU utilization by a process {#APACHE.NAME}. |
Zabbix agent | proc.cpu.util[{#APACHE.NAME}] |
Get process data | The summary metrics aggregated by a process {#APACHE.NAME}. |
Dependent item | apache.proc.get[{#APACHE.NAME}] Preprocessing
|
Memory usage (rss) | The summary of resident set size memory used by a process {#APACHE.NAME} expressed in bytes. |
Dependent item | apache.proc.rss[{#APACHE.NAME}] Preprocessing
|
Memory usage (vsize) | The summary of virtual memory used by a process {#APACHE.NAME} expressed in bytes. |
Dependent item | apache.proc.vmem[{#APACHE.NAME}] Preprocessing
|
Memory usage, % | The percentage of real memory used by a process {#APACHE.NAME}. |
Dependent item | apache.proc.pmem[{#APACHE.NAME}] Preprocessing
|
Number of running processes | The number of running processes {#APACHE.NAME}. |
Dependent item | apache.proc.num[{#APACHE.NAME}] Preprocessing
|
Trigger prototypes for Apache process discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Process is not running | last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])=0 |
High | ||
Apache: Service is down | last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0 and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])>0 |
Average | Manual close: Yes | |
Apache: Failed to fetch status page | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/Apache by Zabbix agent/web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"],30m)=1 and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
Apache: Service response time is too high | min(/Apache by Zabbix agent/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN} and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.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/apache_agent?at=release/7.2
Apache by Zabbix agent
Overview
This template is designed for the effortless deployment of Apache monitoring by Zabbix via Zabbix agent and doesn't require any external scripts.
The template Apache by Zabbix agent
- collects metrics by polling mod_status locally with Zabbix agent:
127.0.0.1
ServerVersion: Apache/2.4.41 (Unix)
ServerMPM: event
Server Built: Aug 14 2019 00:35:10
CurrentTime: Friday, 16-Aug-2019 12:38:40 UTC
RestartTime: Wednesday, 14-Aug-2019 07:58:26 UTC
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 189613
ServerUptime: 2 days 4 hours 40 minutes 13 seconds
Load1: 4.60
Load5: 1.20
Load15: 0.47
Total Accesses: 27860
Total kBytes: 33011
Total Duration: 54118
CPUUser: 18.02
CPUSystem: 31.76
CPUChildrenUser: 0
CPUChildrenSystem: 0
CPULoad: .0262535
Uptime: 189613
ReqPerSec: .146931
BytesPerSec: 178.275
BytesPerReq: 1213.33
DurationPerReq: 1.9425
BusyWorkers: 7
IdleWorkers: 93
Processes: 4
Stopping: 0
BusyWorkers: 7
IdleWorkers: 93
ConnsTotal: 13
ConnsAsyncWriting: 0
ConnsAsyncKeepAlive: 5
ConnsAsyncClosing: 0
Scoreboard: ...
It also uses Zabbix agent to collect Apache
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:
- Apache 2.4.41
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for mod_status.
Check the availability of the module with this command line: httpd -M 2>/dev/null | grep status_module
This is an example configuration of the Apache web server:
<Location "/server-status">
SetHandler server-status
Require host example.com
</Location>
If you use another path, then do not forget to change the {$APACHE.STATUS.PATH}
macro.
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$APACHE.STATUS.HOST} | The hostname or IP address of the Apache status page. |
127.0.0.1 |
{$APACHE.STATUS.PORT} | The port of the Apache status page. |
80 |
{$APACHE.STATUS.PATH} | The URL path. |
server-status?auto |
{$APACHE.STATUS.SCHEME} | The request scheme, which may be either HTTP or HTTPS. |
http |
{$APACHE.RESPONSE_TIME.MAX.WARN} | The maximum Apache response time expressed in seconds for a trigger expression. |
10 |
{$APACHE.PROCESS_NAME} | The process name filter for the Apache process discovery. |
(httpd|apache2) |
{$APACHE.PROCESS.NAME.PARAMETER} | The process name of the Apache web server used in the item key |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Get status | Getting data from a machine-readable version of the Apache status page. For more information see Apache Module mod_status. |
Zabbix agent | web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"] Preprocessing
|
Service ping | Zabbix agent | net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] Preprocessing
|
|
Service response time | Zabbix agent | net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] | |
Total bytes | The total bytes served. |
Dependent item | apache.bytes Preprocessing
|
Bytes per second | It is calculated as a rate of change for total bytes statistics.
|
Dependent item | apache.bytes.rate Preprocessing
|
Requests per second | It is calculated as a rate of change for the "Total requests" statistics.
|
Dependent item | apache.requests.rate Preprocessing
|
Total requests | The total number of the Apache server accesses. |
Dependent item | apache.requests Preprocessing
|
Uptime | The service uptime expressed in seconds. |
Dependent item | apache.uptime Preprocessing
|
Version | The Apache service version. |
Dependent item | apache.version Preprocessing
|
Total workers busy | The total number of busy worker threads/processes. |
Dependent item | apache.workers_total.busy Preprocessing
|
Total workers idle | The total number of idle worker threads/processes. |
Dependent item | apache.workers_total.idle Preprocessing
|
Workers closing connection | The number of workers in closing state. |
Dependent item | apache.workers.closing Preprocessing
|
Workers DNS lookup | The number of workers in |
Dependent item | apache.workers.dnslookup Preprocessing
|
Workers finishing | The number of workers in finishing state. |
Dependent item | apache.workers.finishing Preprocessing
|
Workers idle cleanup | The number of workers in cleanup state. |
Dependent item | apache.workers.cleanup Preprocessing
|
Workers keepalive (read) | The number of workers in |
Dependent item | apache.workers.keepalive Preprocessing
|
Workers logging | The number of workers in logging state. |
Dependent item | apache.workers.logging Preprocessing
|
Workers reading request | The number of workers in reading state. |
Dependent item | apache.workers.reading Preprocessing
|
Workers sending reply | The number of workers in sending state. |
Dependent item | apache.workers.sending Preprocessing
|
Workers slot with no current process | The number of slots with no current process. |
Dependent item | apache.workers.slot Preprocessing
|
Workers starting up | The number of workers in starting state. |
Dependent item | apache.workers.starting Preprocessing
|
Workers waiting for connection | The number of workers in waiting state. |
Dependent item | apache.workers.waiting Preprocessing
|
Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$APACHE.PROCESS.NAME.PARAMETER},,,summary] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Service has been restarted | Uptime is less than 10 minutes. |
last(/Apache by Zabbix agent/apache.uptime)<10m |
Info | Manual close: Yes |
Apache: Version has changed | Apache version has changed. Acknowledge to close the problem manually. |
last(/Apache by Zabbix agent/apache.version,#1)<>last(/Apache by Zabbix agent/apache.version,#2) and length(last(/Apache by Zabbix agent/apache.version))>0 |
Info | Manual close: Yes |
LLD rule Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Event MPM discovery | The discovery of additional metrics if the event Multi-Processing Module (MPM) is used. For more details see Apache MPM event. |
Dependent item | apache.mpm.event.discovery Preprocessing
|
Item prototypes for Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Connections async closing | The number of asynchronous connections in closing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_closing{#SINGLETON}] Preprocessing
|
Connections async keepalive | The number of asynchronous connections in keepalive state (applicable only to the event MPM). |
Dependent item | apache.connections[async_keep_alive{#SINGLETON}] Preprocessing
|
Connections async writing | The number of asynchronous connections in writing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_writing{#SINGLETON}] Preprocessing
|
Connections total | The number of total connections. |
Dependent item | apache.connections[total{#SINGLETON}] Preprocessing
|
Bytes per request | The average number of client requests per second. |
Dependent item | apache.bytes[per_request{#SINGLETON}] Preprocessing
|
Number of async processes | The number of asynchronous processes. |
Dependent item | apache.process[num{#SINGLETON}] Preprocessing
|
LLD rule Apache process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache process discovery | The discovery of the Apache process summary. |
Dependent item | apache.proc.discovery |
Item prototypes for Apache process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
CPU utilization | The percentage of the CPU utilization by a process {#APACHE.NAME}. |
Zabbix agent | proc.cpu.util[{#APACHE.NAME}] |
Get process data | The summary metrics aggregated by a process {#APACHE.NAME}. |
Dependent item | apache.proc.get[{#APACHE.NAME}] Preprocessing
|
Memory usage (rss) | The summary of resident set size memory used by a process {#APACHE.NAME} expressed in bytes. |
Dependent item | apache.proc.rss[{#APACHE.NAME}] Preprocessing
|
Memory usage (vsize) | The summary of virtual memory used by a process {#APACHE.NAME} expressed in bytes. |
Dependent item | apache.proc.vmem[{#APACHE.NAME}] Preprocessing
|
Memory usage, % | The percentage of real memory used by a process {#APACHE.NAME}. |
Dependent item | apache.proc.pmem[{#APACHE.NAME}] Preprocessing
|
Number of running processes | The number of running processes {#APACHE.NAME}. |
Dependent item | apache.proc.num[{#APACHE.NAME}] Preprocessing
|
Trigger prototypes for Apache process discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Process is not running | last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])=0 |
High | ||
Apache: Service is down | last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0 and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])>0 |
Average | Manual close: Yes | |
Apache: Failed to fetch status page | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/Apache by Zabbix agent/web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"],30m)=1 and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
Apache: Service response time is too high | min(/Apache by Zabbix agent/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN} and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.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/apache_agent?at=release/7.0
Apache by Zabbix agent
Overview
This template is designed for the effortless deployment of Apache monitoring by Zabbix via Zabbix agent and doesn't require any external scripts.
The template Apache by Zabbix agent
- collects metrics by polling mod_status locally with Zabbix agent:
127.0.0.1
ServerVersion: Apache/2.4.41 (Unix)
ServerMPM: event
Server Built: Aug 14 2019 00:35:10
CurrentTime: Friday, 16-Aug-2019 12:38:40 UTC
RestartTime: Wednesday, 14-Aug-2019 07:58:26 UTC
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 189613
ServerUptime: 2 days 4 hours 40 minutes 13 seconds
Load1: 4.60
Load5: 1.20
Load15: 0.47
Total Accesses: 27860
Total kBytes: 33011
Total Duration: 54118
CPUUser: 18.02
CPUSystem: 31.76
CPUChildrenUser: 0
CPUChildrenSystem: 0
CPULoad: .0262535
Uptime: 189613
ReqPerSec: .146931
BytesPerSec: 178.275
BytesPerReq: 1213.33
DurationPerReq: 1.9425
BusyWorkers: 7
IdleWorkers: 93
Processes: 4
Stopping: 0
BusyWorkers: 7
IdleWorkers: 93
ConnsTotal: 13
ConnsAsyncWriting: 0
ConnsAsyncKeepAlive: 5
ConnsAsyncClosing: 0
Scoreboard: ...
It also uses Zabbix agent to collect Apache
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:
- Apache 2.4.41
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for mod_status.
Check the availability of the module with this command line: httpd -M 2>/dev/null | grep status_module
This is an example configuration of the Apache web server:
<Location "/server-status">
SetHandler server-status
Require host example.com
</Location>
If you use another path, then do not forget to change the {$APACHE.STATUS.PATH}
macro.
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$APACHE.STATUS.HOST} | The hostname or IP address of the Apache status page. |
127.0.0.1 |
{$APACHE.STATUS.PORT} | The port of the Apache status page. |
80 |
{$APACHE.STATUS.PATH} | The URL path. |
server-status?auto |
{$APACHE.STATUS.SCHEME} | The request scheme, which may be either HTTP or HTTPS. |
http |
{$APACHE.RESPONSE_TIME.MAX.WARN} | The maximum Apache response time expressed in seconds for a trigger expression. |
10 |
{$APACHE.PROCESS_NAME} | The process name filter for the Apache process discovery. |
(httpd|apache2) |
{$APACHE.PROCESS.NAME.PARAMETER} | The process name of the Apache web server used in the item key |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Get status | Getting data from a machine-readable version of the Apache status page. For more information see Apache Module mod_status. |
Zabbix agent | web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"] Preprocessing
|
Service ping | Zabbix agent | net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] Preprocessing
|
|
Service response time | Zabbix agent | net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] | |
Total bytes | The total bytes served. |
Dependent item | apache.bytes Preprocessing
|
Bytes per second | It is calculated as a rate of change for total bytes statistics.
|
Dependent item | apache.bytes.rate Preprocessing
|
Requests per second | It is calculated as a rate of change for the "Total requests" statistics.
|
Dependent item | apache.requests.rate Preprocessing
|
Total requests | The total number of the Apache server accesses. |
Dependent item | apache.requests Preprocessing
|
Uptime | The service uptime expressed in seconds. |
Dependent item | apache.uptime Preprocessing
|
Version | The Apache service version. |
Dependent item | apache.version Preprocessing
|
Total workers busy | The total number of busy worker threads/processes. |
Dependent item | apache.workers_total.busy Preprocessing
|
Total workers idle | The total number of idle worker threads/processes. |
Dependent item | apache.workers_total.idle Preprocessing
|
Workers closing connection | The number of workers in closing state. |
Dependent item | apache.workers.closing Preprocessing
|
Workers DNS lookup | The number of workers in |
Dependent item | apache.workers.dnslookup Preprocessing
|
Workers finishing | The number of workers in finishing state. |
Dependent item | apache.workers.finishing Preprocessing
|
Workers idle cleanup | The number of workers in cleanup state. |
Dependent item | apache.workers.cleanup Preprocessing
|
Workers keepalive (read) | The number of workers in |
Dependent item | apache.workers.keepalive Preprocessing
|
Workers logging | The number of workers in logging state. |
Dependent item | apache.workers.logging Preprocessing
|
Workers reading request | The number of workers in reading state. |
Dependent item | apache.workers.reading Preprocessing
|
Workers sending reply | The number of workers in sending state. |
Dependent item | apache.workers.sending Preprocessing
|
Workers slot with no current process | The number of slots with no current process. |
Dependent item | apache.workers.slot Preprocessing
|
Workers starting up | The number of workers in starting state. |
Dependent item | apache.workers.starting Preprocessing
|
Workers waiting for connection | The number of workers in waiting state. |
Dependent item | apache.workers.waiting Preprocessing
|
Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$APACHE.PROCESS.NAME.PARAMETER},,,summary] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Service has been restarted | Uptime is less than 10 minutes. |
last(/Apache by Zabbix agent/apache.uptime)<10m |
Info | Manual close: Yes |
Apache: Version has changed | Apache version has changed. Acknowledge to close the problem manually. |
last(/Apache by Zabbix agent/apache.version,#1)<>last(/Apache by Zabbix agent/apache.version,#2) and length(last(/Apache by Zabbix agent/apache.version))>0 |
Info | Manual close: Yes |
LLD rule Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Event MPM discovery | The discovery of additional metrics if the event Multi-Processing Module (MPM) is used. For more details see Apache MPM event. |
Dependent item | apache.mpm.event.discovery Preprocessing
|
Item prototypes for Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Connections async closing | The number of asynchronous connections in closing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_closing{#SINGLETON}] Preprocessing
|
Connections async keepalive | The number of asynchronous connections in keepalive state (applicable only to the event MPM). |
Dependent item | apache.connections[async_keep_alive{#SINGLETON}] Preprocessing
|
Connections async writing | The number of asynchronous connections in writing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_writing{#SINGLETON}] Preprocessing
|
Connections total | The number of total connections. |
Dependent item | apache.connections[total{#SINGLETON}] Preprocessing
|
Bytes per request | The average number of client requests per second. |
Dependent item | apache.bytes[per_request{#SINGLETON}] Preprocessing
|
Number of async processes | The number of asynchronous processes. |
Dependent item | apache.process[num{#SINGLETON}] Preprocessing
|
LLD rule Apache process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache process discovery | The discovery of the Apache process summary. |
Dependent item | apache.proc.discovery |
Item prototypes for Apache process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
CPU utilization | The percentage of the CPU utilization by a process {#APACHE.NAME}. |
Zabbix agent | proc.cpu.util[{#APACHE.NAME}] |
Get process data | The summary metrics aggregated by a process {#APACHE.NAME}. |
Dependent item | apache.proc.get[{#APACHE.NAME}] Preprocessing
|
Memory usage (rss) | The summary of resident set size memory used by a process {#APACHE.NAME} expressed in bytes. |
Dependent item | apache.proc.rss[{#APACHE.NAME}] Preprocessing
|
Memory usage (vsize) | The summary of virtual memory used by a process {#APACHE.NAME} expressed in bytes. |
Dependent item | apache.proc.vmem[{#APACHE.NAME}] Preprocessing
|
Memory usage, % | The percentage of real memory used by a process {#APACHE.NAME}. |
Dependent item | apache.proc.pmem[{#APACHE.NAME}] Preprocessing
|
Number of running processes | The number of running processes {#APACHE.NAME}. |
Dependent item | apache.proc.num[{#APACHE.NAME}] Preprocessing
|
Trigger prototypes for Apache process discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Process is not running | last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])=0 |
High | ||
Apache: Service is down | last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0 and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])>0 |
Average | Manual close: Yes | |
Apache: Failed to fetch status page | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/Apache by Zabbix agent/web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"],30m)=1 and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
Apache: Service response time is too high | min(/Apache by Zabbix agent/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN} and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.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/apache_agent?at=release/6.4
Apache by Zabbix agent
Overview
This template is designed for the effortless deployment of Apache monitoring by Zabbix via Zabbix agent and doesn't require any external scripts.
The template Apache by Zabbix agent
- collects metrics by polling mod_status locally with Zabbix agent:
127.0.0.1
ServerVersion: Apache/2.4.41 (Unix)
ServerMPM: event
Server Built: Aug 14 2019 00:35:10
CurrentTime: Friday, 16-Aug-2019 12:38:40 UTC
RestartTime: Wednesday, 14-Aug-2019 07:58:26 UTC
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 189613
ServerUptime: 2 days 4 hours 40 minutes 13 seconds
Load1: 4.60
Load5: 1.20
Load15: 0.47
Total Accesses: 27860
Total kBytes: 33011
Total Duration: 54118
CPUUser: 18.02
CPUSystem: 31.76
CPUChildrenUser: 0
CPUChildrenSystem: 0
CPULoad: .0262535
Uptime: 189613
ReqPerSec: .146931
BytesPerSec: 178.275
BytesPerReq: 1213.33
DurationPerReq: 1.9425
BusyWorkers: 7
IdleWorkers: 93
Processes: 4
Stopping: 0
BusyWorkers: 7
IdleWorkers: 93
ConnsTotal: 13
ConnsAsyncWriting: 0
ConnsAsyncKeepAlive: 5
ConnsAsyncClosing: 0
Scoreboard: ...
It also uses Zabbix agent to collect Apache
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:
- Apache 2.4.41
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for mod_status.
Check the availability of the module with this command line: httpd -M 2>/dev/null | grep status_module
This is an example configuration of the Apache web server:
<Location "/server-status">
SetHandler server-status
Require host example.com
</Location>
If you use another path, then do not forget to change the {$APACHE.STATUS.PATH}
macro.
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$APACHE.STATUS.HOST} | The hostname or IP address of the Apache status page. |
127.0.0.1 |
{$APACHE.STATUS.PORT} | The port of the Apache status page. |
80 |
{$APACHE.STATUS.PATH} | The URL path. |
server-status?auto |
{$APACHE.STATUS.SCHEME} | The request scheme, which may be either HTTP or HTTPS. |
http |
{$APACHE.RESPONSE_TIME.MAX.WARN} | The maximum Apache response time expressed in seconds for a trigger expression. |
10 |
{$APACHE.PROCESS_NAME} | The process name filter for the Apache process discovery. |
(httpd|apache2) |
{$APACHE.PROCESS.NAME.PARAMETER} | The process name of the Apache web server used in the item key |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache: Get status | Getting data from a machine-readable version of the Apache status page. For more information see Apache Module mod_status. |
Zabbix agent | web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"] Preprocessing
|
Apache: Service ping | Zabbix agent | net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] Preprocessing
|
|
Apache: Service response time | Zabbix agent | net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] | |
Apache: Total bytes | The total bytes served. |
Dependent item | apache.bytes Preprocessing
|
Apache: Bytes per second | It is calculated as a rate of change for total bytes statistics.
|
Dependent item | apache.bytes.rate Preprocessing
|
Apache: Requests per second | It is calculated as a rate of change for the "Total requests" statistics.
|
Dependent item | apache.requests.rate Preprocessing
|
Apache: Total requests | The total number of the Apache server accesses. |
Dependent item | apache.requests Preprocessing
|
Apache: Uptime | The service uptime expressed in seconds. |
Dependent item | apache.uptime Preprocessing
|
Apache: Version | The Apache service version. |
Dependent item | apache.version Preprocessing
|
Apache: Total workers busy | The total number of busy worker threads/processes. |
Dependent item | apache.workers_total.busy Preprocessing
|
Apache: Total workers idle | The total number of idle worker threads/processes. |
Dependent item | apache.workers_total.idle Preprocessing
|
Apache: Workers closing connection | The number of workers in closing state. |
Dependent item | apache.workers.closing Preprocessing
|
Apache: Workers DNS lookup | The number of workers in |
Dependent item | apache.workers.dnslookup Preprocessing
|
Apache: Workers finishing | The number of workers in finishing state. |
Dependent item | apache.workers.finishing Preprocessing
|
Apache: Workers idle cleanup | The number of workers in cleanup state. |
Dependent item | apache.workers.cleanup Preprocessing
|
Apache: Workers keepalive (read) | The number of workers in |
Dependent item | apache.workers.keepalive Preprocessing
|
Apache: Workers logging | The number of workers in logging state. |
Dependent item | apache.workers.logging Preprocessing
|
Apache: Workers reading request | The number of workers in reading state. |
Dependent item | apache.workers.reading Preprocessing
|
Apache: Workers sending reply | The number of workers in sending state. |
Dependent item | apache.workers.sending Preprocessing
|
Apache: Workers slot with no current process | The number of slots with no current process. |
Dependent item | apache.workers.slot Preprocessing
|
Apache: Workers starting up | The number of workers in starting state. |
Dependent item | apache.workers.starting Preprocessing
|
Apache: Workers waiting for connection | The number of workers in waiting state. |
Dependent item | apache.workers.waiting Preprocessing
|
Apache: Get processes summary | The aggregated data of summary metrics for all processes. |
Zabbix agent | proc.get[{$APACHE.PROCESS.NAME.PARAMETER},,,summary] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Host has been restarted | Uptime is less than 10 minutes. |
last(/Apache by Zabbix agent/apache.uptime)<10m |
Info | Manual close: Yes |
Apache: Version has changed | Apache version has changed. Acknowledge to close the problem manually. |
last(/Apache by Zabbix agent/apache.version,#1)<>last(/Apache by Zabbix agent/apache.version,#2) and length(last(/Apache by Zabbix agent/apache.version))>0 |
Info | Manual close: Yes |
LLD rule Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Event MPM discovery | The discovery of additional metrics if the event Multi-Processing Module (MPM) is used. For more details see Apache MPM event. |
Dependent item | apache.mpm.event.discovery Preprocessing
|
Item prototypes for Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache: Connections async closing | The number of asynchronous connections in closing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_closing{#SINGLETON}] Preprocessing
|
Apache: Connections async keepalive | The number of asynchronous connections in keepalive state (applicable only to the event MPM). |
Dependent item | apache.connections[async_keep_alive{#SINGLETON}] Preprocessing
|
Apache: Connections async writing | The number of asynchronous connections in writing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_writing{#SINGLETON}] Preprocessing
|
Apache: Connections total | The number of total connections. |
Dependent item | apache.connections[total{#SINGLETON}] Preprocessing
|
Apache: Bytes per request | The average number of client requests per second. |
Dependent item | apache.bytes[per_request{#SINGLETON}] Preprocessing
|
Apache: Number of async processes | The number of asynchronous processes. |
Dependent item | apache.process[num{#SINGLETON}] Preprocessing
|
LLD rule Apache process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache process discovery | The discovery of the Apache process summary. |
Dependent item | apache.proc.discovery |
Item prototypes for Apache process discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache: CPU utilization | The percentage of the CPU utilization by a process {#APACHE.NAME}. |
Zabbix agent | proc.cpu.util[{#APACHE.NAME}] |
Apache: Get process data | The summary metrics aggregated by a process {#APACHE.NAME}. |
Dependent item | apache.proc.get[{#APACHE.NAME}] Preprocessing
|
Apache: Memory usage (rss) | The summary of resident set size memory used by a process {#APACHE.NAME} expressed in bytes. |
Dependent item | apache.proc.rss[{#APACHE.NAME}] Preprocessing
|
Apache: Memory usage (vsize) | The summary of virtual memory used by a process {#APACHE.NAME} expressed in bytes. |
Dependent item | apache.proc.vmem[{#APACHE.NAME}] Preprocessing
|
Apache: Memory usage, % | The percentage of real memory used by a process {#APACHE.NAME}. |
Dependent item | apache.proc.pmem[{#APACHE.NAME}] Preprocessing
|
Apache: Number of running processes | The number of running processes {#APACHE.NAME}. |
Dependent item | apache.proc.num[{#APACHE.NAME}] Preprocessing
|
Trigger prototypes for Apache process discovery
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Process is not running | last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])=0 |
High | ||
Apache: Service is down | last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0 and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])>0 |
Average | Manual close: Yes | |
Apache: Failed to fetch status page | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/Apache by Zabbix agent/web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"],30m)=1 and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.NAME}])>0 |
Warning | Manual close: Yes Depends on:
|
Apache: Service response time is too high | min(/Apache by Zabbix agent/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN} and last(/Apache by Zabbix agent/apache.proc.num[{#APACHE.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/apache_agent?at=release/6.2
Apache by Zabbix agent
Overview
For Zabbix version: 6.2 and higher.
This template is developed to monitor Apache HTTPD 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 Apache by Zabbix agent
- collects metrics by polling Apache Satus module locally with Zabbix agent:
127.0.0.1
ServerVersion: Apache/2.4.41 (Unix)
ServerMPM: event
Server Built: Aug 14 2019 00:35:10
CurrentTime: Friday, 16-Aug-2019 12:38:40 UTC
RestartTime: Wednesday, 14-Aug-2019 07:58:26 UTC
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 189613
ServerUptime: 2 days 4 hours 40 minutes 13 seconds
Load1: 4.60
Load5: 1.20
Load15: 0.47
Total Accesses: 27860
Total kBytes: 33011
Total Duration: 54118
CPUUser: 18.02
CPUSystem: 31.76
CPUChildrenUser: 0
CPUChildrenSystem: 0
CPULoad: .0262535
Uptime: 189613
ReqPerSec: .146931
BytesPerSec: 178.275
BytesPerReq: 1213.33
DurationPerReq: 1.9425
BusyWorkers: 7
IdleWorkers: 93
Processes: 4
Stopping: 0
BusyWorkers: 7
IdleWorkers: 93
ConnsTotal: 13
ConnsAsyncWriting: 0
ConnsAsyncKeepAlive: 5
ConnsAsyncClosing: 0
Scoreboard: __________________________________________W_____________W___________________LW_____W______W_W_______............................................................................................................................................................................................................................................................................................................
It also uses Zabbix agent to collect Apache
Linux process statistics, such as CPU usage, memory usage, and whether the process is running or not.
This template was tested on:
- Apache, version 2.4.41
Setup
See Zabbix template operation for basic instructions.
See the setup instructions for Apache Satus module.
Check the availability of the module with this command line: httpd -M 2>/dev/null | grep status_module
This is an example configuration of the Apache web server:
<Location "/server-status">
SetHandler server-status
Require host example.com
</Location>
If you use another path, then do not forget to change the {$APACHE.STATUS.PATH}
macro.
Install and setup Zabbix agent.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
Name | Description | Default |
---|---|---|
{$APACHE.PROCESS_NAME} | The process name of the Apache web server (Apache). |
`(httpd |
{$APACHE.RESPONSE_TIME.MAX.WARN} | The maximum Apache response time expressed in seconds for a trigger expression. |
10 |
{$APACHE.STATUS.HOST} | The Hostname or an IP address of the Apache status page. |
127.0.0.1 |
{$APACHE.STATUS.PATH} | The URL path. |
server-status?auto |
{$APACHE.STATUS.PORT} | The port of the Apache status page. |
80 |
{$APACHE.STATUS.SCHEME} | The request scheme, which may be either HTTP or HTTPS. |
http |
Template links
There are no template links in this template.
Discovery rules
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache process discovery | The discovery of the Apache process summary. |
DEPENDENT | apache.proc.discovery Filter: AND- {#NAME} MATCHES_REGEX |
Event MPM discovery | The discovery of additional metrics if the event Multi-Processing Module (MPM) is used. For more details see Apache MPM event. |
DEPENDENT | apache.mpm.event.discovery Preprocessing: - JAVASCRIPT: - DISCARD_UNCHANGED_HEARTBEAT: |
Items collected
Group | Name | Description | Type | Key and additional info |
---|---|---|---|---|
Apache | Apache: Service ping | - |
ZABBIX_PASSIVE | net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] Preprocessing: - DISCARD_UNCHANGED_HEARTBEAT: |
Apache | Apache: Service response time | - |
ZABBIX_PASSIVE | net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] |
Apache | Apache: Total bytes | The total bytes served. |
DEPENDENT | apache.bytes Preprocessing: - JSONPATH: - MULTIPLIER: |
Apache | Apache: Bytes per second | It is calculated as a rate of change for total bytes statistics.
|
DEPENDENT | apache.bytes.rate Preprocessing: - JSONPATH: - MULTIPLIER: - CHANGE_PER_SECOND |
Apache | Apache: Requests per second | It is calculated as a rate of change for the "Total requests" statistics.
|
DEPENDENT | apache.requests.rate Preprocessing: - JSONPATH: - CHANGE_PER_SECOND |
Apache | Apache: Total requests | The total number of the Apache server accesses. |
DEPENDENT | apache.requests Preprocessing: - JSONPATH: |
Apache | Apache: Uptime | The service uptime expressed in seconds. |
DEPENDENT | apache.uptime Preprocessing: - JSONPATH: |
Apache | Apache: Version | The Apache service version. |
DEPENDENT | apache.version Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
Apache | Apache: Total workers busy | The total number of busy worker threads/processes. |
DEPENDENT | apache.workers_total.busy Preprocessing: - JSONPATH: |
Apache | Apache: Total workers idle | The total number of idle worker threads/processes. |
DEPENDENT | apache.workers_total.idle Preprocessing: - JSONPATH: |
Apache | Apache: Workers closing connection | The number of workers in closing state. |
DEPENDENT | apache.workers.closing Preprocessing: - JSONPATH: |
Apache | Apache: Workers DNS lookup | The number of workers in |
DEPENDENT | apache.workers.dnslookup Preprocessing: - JSONPATH: |
Apache | Apache: Workers finishing | The number of workers in finishing state. |
DEPENDENT | apache.workers.finishing Preprocessing: - JSONPATH: |
Apache | Apache: Workers idle cleanup | The number of workers in cleanup state. |
DEPENDENT | apache.workers.cleanup Preprocessing: - JSONPATH: |
Apache | Apache: Workers keepalive (read) | The number of workers in |
DEPENDENT | apache.workers.keepalive Preprocessing: - JSONPATH: |
Apache | Apache: Workers logging | The number of workers in logging state. |
DEPENDENT | apache.workers.logging Preprocessing: - JSONPATH: |
Apache | Apache: Workers reading request | The number of workers in reading state. |
DEPENDENT | apache.workers.reading Preprocessing: - JSONPATH: |
Apache | Apache: Workers sending reply | The number of workers in sending state. |
DEPENDENT | apache.workers.sending Preprocessing: - JSONPATH: |
Apache | Apache: Workers slot with no current process | The number of slots with no current process. |
DEPENDENT | apache.workers.slot Preprocessing: - JSONPATH: |
Apache | Apache: Workers starting up | The number of workers in starting state. |
DEPENDENT | apache.workers.starting Preprocessing: - JSONPATH: |
Apache | Apache: Workers waiting for connection | The number of workers in waiting state. |
DEPENDENT | apache.workers.waiting Preprocessing: - JSONPATH: |
Apache | Apache: Get processes summary | The aggregated data of summary metrics for all processes. |
ZABBIX_PASSIVE | proc.get[,,,summary] |
Apache | Apache: CPU utilization | The percentage of the CPU utilization by a process {#NAME}. |
ZABBIX_PASSIVE | proc.cpu.util[{#NAME}] |
Apache | Apache: Get process data | The summary metrics aggregated by a process {#NAME}. |
DEPENDENT | apache.proc.get[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
Apache | Apache: Memory usage (rss) | The summary of resident set size memory used by a process {#NAME} expressed in bytes. |
DEPENDENT | apache.proc.rss[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
Apache | Apache: Memory usage (vsize) | The summary of virtual memory used by a process {#NAME} expressed in bytes. |
DEPENDENT | apache.proc.vmem[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
Apache | Apache: Memory usage, % | The percentage of real memory used by a process {#NAME}. |
DEPENDENT | apache.proc.pmem[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: |
Apache | Apache: Number of running processes | The number of running processes {#NAME}. |
DEPENDENT | apache.proc.num[{#NAME}] Preprocessing: - JSONPATH: ⛔️ON_FAIL: - DISCARD_UNCHANGED_HEARTBEAT: |
Apache | Apache: Connections async closing | The number of asynchronous connections in closing state (applicable only to the event MPM). |
DEPENDENT | apache.connections[async_closing{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Connections async keepalive | The number of asynchronous connections in keepalive state (applicable only to the event MPM). |
DEPENDENT | apache.connections[async_keep_alive{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Connections async writing | The number of asynchronous connections in writing state (applicable only to the event MPM). |
DEPENDENT | apache.connections[async_writing{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Connections total | The number of total connections. |
DEPENDENT | apache.connections[total{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Bytes per request | The average number of client requests per second. |
DEPENDENT | apache.bytes[per_request{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Number of async processes | The number of asynchronous processes. |
DEPENDENT | apache.process[num{#SINGLETON}] Preprocessing: - JSONPATH: |
Zabbix raw items | Apache: Get status | Getting data from a machine-readable version of the Apache status page. For more information see Apache Module mod_status. |
ZABBIX_PASSIVE | web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"] Preprocessing: - JAVASCRIPT: |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Host has been restarted | Uptime is less than 10 minutes. |
last(/Apache by Zabbix agent/apache.uptime)<10m |
INFO | Manual close: YES |
Apache: Version has changed | The Apache version has changed. Acknowledge (Ack) to close manually. |
last(/Apache by Zabbix agent/apache.version,#1)<>last(/Apache by Zabbix agent/apache.version,#2) and length(last(/Apache by Zabbix agent/apache.version))>0 |
INFO | Manual close: YES |
Apache: Process is not running | - |
last(/Apache by Zabbix agent/apache.proc.num[{#NAME}])=0 |
HIGH | |
Apache: Failed to fetch status page | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/Apache by Zabbix agent/web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"],30m)=1 and last(/Apache by Zabbix agent/apache.proc.num[{#NAME}])>0 |
WARNING | Manual close: YES Depends on: - Apache: Service is down |
Apache: Service is down | - |
last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0 and last(/Apache by Zabbix agent/apache.proc.num[{#NAME}])>0 |
AVERAGE | Manual close: YES |
Apache: Service response time is too high | - |
min(/Apache by Zabbix agent/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN} and last(/Apache by Zabbix agent/apache.proc.num[{#NAME}])>0 |
WARNING | Manual close: YES Depends on: - Apache: 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/apache_agent?at=release/6.0
Apache by Zabbix agent
Overview
This template is designed for the effortless deployment of Apache monitoring by Zabbix via Zabbix agent and doesn't require any external scripts.
The template Apache by Zabbix agent
- collects metrics by polling mod_status locally with Zabbix agent:
127.0.0.1
ServerVersion: Apache/2.4.41 (Unix)
ServerMPM: event
Server Built: Aug 14 2019 00:35:10
CurrentTime: Friday, 16-Aug-2019 12:38:40 UTC
RestartTime: Wednesday, 14-Aug-2019 07:58:26 UTC
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 189613
ServerUptime: 2 days 4 hours 40 minutes 13 seconds
Load1: 4.60
Load5: 1.20
Load15: 0.47
Total Accesses: 27860
Total kBytes: 33011
Total Duration: 54118
CPUUser: 18.02
CPUSystem: 31.76
CPUChildrenUser: 0
CPUChildrenSystem: 0
CPULoad: .0262535
Uptime: 189613
ReqPerSec: .146931
BytesPerSec: 178.275
BytesPerReq: 1213.33
DurationPerReq: 1.9425
BusyWorkers: 7
IdleWorkers: 93
Processes: 4
Stopping: 0
BusyWorkers: 7
IdleWorkers: 93
ConnsTotal: 13
ConnsAsyncWriting: 0
ConnsAsyncKeepAlive: 5
ConnsAsyncClosing: 0
Scoreboard: ...
It also uses Zabbix agent to collect Apache
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:
- Apache 2.4.41
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
See the setup instructions for mod_status.
Check the availability of the module with this command line: httpd -M 2>/dev/null | grep status_module
This is an example configuration of the Apache web server:
<Location "/server-status">
SetHandler server-status
Require host example.com
</Location>
If you use another path, then do not forget to change the {$APACHE.STATUS.PATH}
macro.
Install and setup Zabbix agent.
Macros used
Name | Description | Default |
---|---|---|
{$APACHE.STATUS.HOST} | The hostname or IP address of the Apache status page. |
127.0.0.1 |
{$APACHE.STATUS.PORT} | The port of the Apache status page. |
80 |
{$APACHE.STATUS.PATH} | The URL path. |
server-status?auto |
{$APACHE.STATUS.SCHEME} | The request scheme, which may be either HTTP or HTTPS. |
http |
{$APACHE.RESPONSE_TIME.MAX.WARN} | The maximum Apache response time expressed in seconds for a trigger expression. |
10 |
{$APACHE.PROCESS_NAME} | The process name of the Apache web server (Apache). |
httpd |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache: Get status | Getting data from a machine-readable version of the Apache status page. For more information see Apache Module mod_status. |
Zabbix agent | web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"] Preprocessing
|
Apache: Service ping | Zabbix agent | net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] Preprocessing
|
|
Apache: Service response time | Zabbix agent | net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] | |
Apache: Total bytes | The total bytes served. |
Dependent item | apache.bytes Preprocessing
|
Apache: Bytes per second | It is calculated as a rate of change for total bytes statistics.
|
Dependent item | apache.bytes.rate Preprocessing
|
Apache: Requests per second | It is calculated as a rate of change for the "Total requests" statistics.
|
Dependent item | apache.requests.rate Preprocessing
|
Apache: Total requests | The total number of the Apache server accesses. |
Dependent item | apache.requests Preprocessing
|
Apache: Uptime | The service uptime expressed in seconds. |
Dependent item | apache.uptime Preprocessing
|
Apache: Version | The Apache service version. |
Dependent item | apache.version Preprocessing
|
Apache: Total workers busy | The total number of busy worker threads/processes. |
Dependent item | apache.workers_total.busy Preprocessing
|
Apache: Total workers idle | The total number of idle worker threads/processes. |
Dependent item | apache.workers_total.idle Preprocessing
|
Apache: Workers closing connection | The number of workers in closing state. |
Dependent item | apache.workers.closing Preprocessing
|
Apache: Workers DNS lookup | The number of workers in |
Dependent item | apache.workers.dnslookup Preprocessing
|
Apache: Workers finishing | The number of workers in finishing state. |
Dependent item | apache.workers.finishing Preprocessing
|
Apache: Workers idle cleanup | The number of workers in cleanup state. |
Dependent item | apache.workers.cleanup Preprocessing
|
Apache: Workers keepalive (read) | The number of workers in |
Dependent item | apache.workers.keepalive Preprocessing
|
Apache: Workers logging | The number of workers in logging state. |
Dependent item | apache.workers.logging Preprocessing
|
Apache: Workers reading request | The number of workers in reading state. |
Dependent item | apache.workers.reading Preprocessing
|
Apache: Workers sending reply | The number of workers in sending state. |
Dependent item | apache.workers.sending Preprocessing
|
Apache: Workers slot with no current process | The number of slots with no current process. |
Dependent item | apache.workers.slot Preprocessing
|
Apache: Workers starting up | The number of workers in starting state. |
Dependent item | apache.workers.starting Preprocessing
|
Apache: Workers waiting for connection | The number of workers in waiting state. |
Dependent item | apache.workers.waiting Preprocessing
|
Apache: Number of running processes | Zabbix agent | proc.num["{$APACHE.PROCESS_NAME}"] | |
Apache: Memory usage (rss) | Resident set size memory used by process in bytes. |
Zabbix agent | proc.mem["{$APACHE.PROCESS_NAME}",,,,rss] |
Apache: Memory usage (vsize) | Virtual memory size used by process in bytes. |
Zabbix agent | proc.mem["{$APACHE.PROCESS_NAME}",,,,vsize] |
Apache: CPU utilization | Process CPU utilization percentage. |
Zabbix agent | proc.cpu.util["{$APACHE.PROCESS_NAME}"] |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Failed to fetch status page | Zabbix has not received any data for items for the last 30 minutes. |
nodata(/Apache by Zabbix agent/web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"],30m)=1 |
Warning | Manual close: Yes Depends on:
|
Apache: Service is down | last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0 |
Average | Manual close: Yes Depends on:
|
|
Apache: Service response time is too high | min(/Apache by Zabbix agent/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN} |
Warning | Manual close: Yes Depends on:
|
|
Apache: Host has been restarted | Uptime is less than 10 minutes. |
last(/Apache by Zabbix agent/apache.uptime)<10m |
Info | Manual close: Yes |
Apache: Version has changed | Apache version has changed. Acknowledge to close the problem manually. |
last(/Apache by Zabbix agent/apache.version,#1)<>last(/Apache by Zabbix agent/apache.version,#2) and length(last(/Apache by Zabbix agent/apache.version))>0 |
Info | Manual close: Yes |
Apache: Process is not running | last(/Apache by Zabbix agent/proc.num["{$APACHE.PROCESS_NAME}"])=0 |
High |
LLD rule Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Event MPM discovery | The discovery of additional metrics if the event Multi-Processing Module (MPM) is used. For more details see Apache MPM event. |
Dependent item | apache.mpm.event.discovery Preprocessing
|
Item prototypes for Event MPM discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Apache: Connections async closing | The number of asynchronous connections in closing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_closing{#SINGLETON}] Preprocessing
|
Apache: Connections async keepalive | The number of asynchronous connections in keepalive state (applicable only to the event MPM). |
Dependent item | apache.connections[async_keep_alive{#SINGLETON}] Preprocessing
|
Apache: Connections async writing | The number of asynchronous connections in writing state (applicable only to the event MPM). |
Dependent item | apache.connections[async_writing{#SINGLETON}] Preprocessing
|
Apache: Connections total | The number of total connections. |
Dependent item | apache.connections[total{#SINGLETON}] Preprocessing
|
Apache: Bytes per request | The average number of client requests per second. |
Dependent item | apache.bytes[per_request{#SINGLETON}] Preprocessing
|
Apache: Number of async processes | The number of asynchronous processes. |
Dependent item | apache.process[num{#SINGLETON}] Preprocessing
|
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/apache_agent?at=release/5.4
Apache by Zabbix agent
Overview
For Zabbix version: 5.4 and higher
The template to monitor Apache HTTPD by Zabbix that work without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
Template Apache by Zabbix agent
- collects metrics by polling mod_status locally with Zabbix agent:
127.0.0.1
ServerVersion: Apache/2.4.41 (Unix)
ServerMPM: event
Server Built: Aug 14 2019 00:35:10
CurrentTime: Friday, 16-Aug-2019 12:38:40 UTC
RestartTime: Wednesday, 14-Aug-2019 07:58:26 UTC
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 189613
ServerUptime: 2 days 4 hours 40 minutes 13 seconds
Load1: 4.60
Load5: 1.20
Load15: 0.47
Total Accesses: 27860
Total kBytes: 33011
Total Duration: 54118
CPUUser: 18.02
CPUSystem: 31.76
CPUChildrenUser: 0
CPUChildrenSystem: 0
CPULoad: .0262535
Uptime: 189613
ReqPerSec: .146931
BytesPerSec: 178.275
BytesPerReq: 1213.33
DurationPerReq: 1.9425
BusyWorkers: 7
IdleWorkers: 93
Processes: 4
Stopping: 0
BusyWorkers: 7
IdleWorkers: 93
ConnsTotal: 13
ConnsAsyncWriting: 0
ConnsAsyncKeepAlive: 5
ConnsAsyncClosing: 0
Scoreboard: __________________________________________W_____________W___________________LW_____W______W_W_______............................................................................................................................................................................................................................................................................................................
It also uses Zabbix agent to collect Apache
Linux process stats like CPU usage, memory usage and whether process is running or not.
This template was tested on:
- Apache, version 2.4.41
Setup
See Zabbix template operation for basic instructions.
Setup mod_status
Check module availability: httpd -M 2>/dev/null | grep status_module
Example configuration of Apache:
<Location "/server-status">
SetHandler server-status
Require host example.com
</Location>
If you use another path, then don't forget to change {$APACHE.STATUS.PATH}
macro.
Install and setup Zabbix agent.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
Name | Description | Default |
---|---|---|
{$APACHE.PROCESS_NAME} | Apache server process name |
httpd |
{$APACHE.RESPONSE_TIME.MAX.WARN} | Maximum Apache response time in seconds for trigger expression |
10 |
{$APACHE.STATUS.HOST} | Hostname or IP address of the Apache status page |
127.0.0.1 |
{$APACHE.STATUS.PATH} | The URL path |
server-status?auto |
{$APACHE.STATUS.PORT} | The port of Apache status page |
80 |
{$APACHE.STATUS.SCHEME} | Request scheme which may be http or https |
http |
Template links
There are no template links in this template.
Discovery rules
Name | Description | Type | Key and additional info |
---|---|---|---|
Event MPM discovery | Additional metrics if event MPM is used https://httpd.apache.org/docs/current/mod/event.html |
DEPENDENT | apache.mpm.event.discovery Preprocessing: - JAVASCRIPT: - DISCARD_UNCHANGED_HEARTBEAT: |
Items collected
Group | Name | Description | Type | Key and additional info |
---|---|---|---|---|
Apache | Apache: Service ping | - |
ZABBIX_PASSIVE | net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] Preprocessing: - DISCARD_UNCHANGED_HEARTBEAT: |
Apache | Apache: Service response time | - |
ZABBIX_PASSIVE | net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] |
Apache | Apache: Total bytes | Total bytes served |
DEPENDENT | apache.bytes Preprocessing: - JSONPATH: - MULTIPLIER: |
Apache | Apache: Bytes per second | Calculated as change rate for 'Total bytes' stat. BytesPerSec is not used, as it counts average since last Apache server start. |
DEPENDENT | apache.bytes.rate Preprocessing: - JSONPATH: - MULTIPLIER: - CHANGE_PER_SECOND |
Apache | Apache: Requests per second | Calculated as change rate for 'Total requests' stat. ReqPerSec is not used, as it counts average since last Apache server start. |
DEPENDENT | apache.requests.rate Preprocessing: - JSONPATH: - CHANGE_PER_SECOND |
Apache | Apache: Total requests | A total number of accesses |
DEPENDENT | apache.requests Preprocessing: - JSONPATH: |
Apache | Apache: Uptime | Service uptime in seconds |
DEPENDENT | apache.uptime Preprocessing: - JSONPATH: |
Apache | Apache: Version | Service version |
DEPENDENT | apache.version Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
Apache | Apache: Total workers busy | Total number of busy worker threads/processes |
DEPENDENT | apache.workers_total.busy Preprocessing: - JSONPATH: |
Apache | Apache: Total workers idle | Total number of idle worker threads/processes |
DEPENDENT | apache.workers_total.idle Preprocessing: - JSONPATH: |
Apache | Apache: Workers closing connection | Number of workers in closing state |
DEPENDENT | apache.workers.closing Preprocessing: - JSONPATH: |
Apache | Apache: Workers DNS lookup | Number of workers in dnslookup state |
DEPENDENT | apache.workers.dnslookup Preprocessing: - JSONPATH: |
Apache | Apache: Workers finishing | Number of workers in finishing state |
DEPENDENT | apache.workers.finishing Preprocessing: - JSONPATH: |
Apache | Apache: Workers idle cleanup | Number of workers in cleanup state |
DEPENDENT | apache.workers.cleanup Preprocessing: - JSONPATH: |
Apache | Apache: Workers keepalive (read) | Number of workers in keepalive state |
DEPENDENT | apache.workers.keepalive Preprocessing: - JSONPATH: |
Apache | Apache: Workers logging | Number of workers in logging state |
DEPENDENT | apache.workers.logging Preprocessing: - JSONPATH: |
Apache | Apache: Workers reading request | Number of workers in reading state |
DEPENDENT | apache.workers.reading Preprocessing: - JSONPATH: |
Apache | Apache: Workers sending reply | Number of workers in sending state |
DEPENDENT | apache.workers.sending Preprocessing: - JSONPATH: |
Apache | Apache: Workers slot with no current process | Number of slots with no current process |
DEPENDENT | apache.workers.slot Preprocessing: - JSONPATH: |
Apache | Apache: Workers starting up | Number of workers in starting state |
DEPENDENT | apache.workers.starting Preprocessing: - JSONPATH: |
Apache | Apache: Workers waiting for connection | Number of workers in waiting state |
DEPENDENT | apache.workers.waiting Preprocessing: - JSONPATH: |
Apache | Apache: Number of processes running | - |
ZABBIX_PASSIVE | proc.num["{$APACHE.PROCESS_NAME}"] |
Apache | Apache: Memory usage (rss) | Resident set size memory used by process in bytes. |
ZABBIX_PASSIVE | proc.mem["{$APACHE.PROCESS_NAME}",,,,rss] |
Apache | Apache: Memory usage (vsize) | Virtual memory size used by process in bytes. |
ZABBIX_PASSIVE | proc.mem["{$APACHE.PROCESS_NAME}",,,,vsize] |
Apache | Apache: CPU utilization | Process CPU utilization percentage. |
ZABBIX_PASSIVE | proc.cpu.util["{$APACHE.PROCESS_NAME}"] |
Apache | Apache: Connections async closing | Number of async connections in closing state (only applicable to event MPM) |
DEPENDENT | apache.connections[async_closing{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Connections async keep alive | Number of async connections in keep-alive state (only applicable to event MPM) |
DEPENDENT | apache.connections[async_keep_alive{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Connections async writing | Number of async connections in writing state (only applicable to event MPM) |
DEPENDENT | apache.connections[async_writing{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Connections total | Number of total connections |
DEPENDENT | apache.connections[total{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Bytes per request | Average number of client requests per second |
DEPENDENT | apache.bytes[per_request{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Number of async processes | Number of async processes |
DEPENDENT | apache.process[num{#SINGLETON}] Preprocessing: - JSONPATH: |
Zabbix_raw_items | Apache: Get status | Getting data from a machine-readable version of the Apache status page. https://httpd.apache.org/docs/current/mod/mod_status.html |
ZABBIX_PASSIVE | web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"] Preprocessing: - JAVASCRIPT: |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Service is down | - |
last(/Apache by Zabbix agent/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0 |
AVERAGE | Manual close: YES Depends on: - Apache: Process is not running |
Apache: Service response time is too high (over {$APACHE.RESPONSE_TIME.MAX.WARN}s for 5m) | - |
min(/Apache by Zabbix agent/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN} |
WARNING | Manual close: YES Depends on: - Apache: Process is not running - Apache: Service is down |
Apache: has been restarted (uptime < 10m) | Uptime is less than 10 minutes |
last(/Apache by Zabbix agent/apache.uptime)<10m |
INFO | Manual close: YES |
Apache: Version has changed (new version: {ITEM.VALUE}) | Apache version has changed. Ack to close. |
last(/Apache by Zabbix agent/apache.version,#1)<>last(/Apache by Zabbix agent/apache.version,#2) and length(last(/Apache by Zabbix agent/apache.version))>0 |
INFO | Manual close: YES |
Apache: Process is not running | - |
last(/Apache by Zabbix agent/proc.num["{$APACHE.PROCESS_NAME}"])=0 |
HIGH | |
Apache: Failed to fetch status page (or no data for 30m) | Zabbix has not received data for items for the last 30 minutes. |
nodata(/Apache by Zabbix agent/web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"],30m)=1 |
WARNING | Manual close: YES Depends on: - Apache: Process is not running - Apache: 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/apache_agent?at=release/5.0
Template App Apache by Zabbix agent
Overview
For Zabbix version: 5.0 and higher
The template to monitor Apache HTTPD by Zabbix that work without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
Template Apache by Zabbix agent
- collects metrics by polling mod_status locally with Zabbix agent:
127.0.0.1
ServerVersion: Apache/2.4.41 (Unix)
ServerMPM: event
Server Built: Aug 14 2019 00:35:10
CurrentTime: Friday, 16-Aug-2019 12:38:40 UTC
RestartTime: Wednesday, 14-Aug-2019 07:58:26 UTC
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 189613
ServerUptime: 2 days 4 hours 40 minutes 13 seconds
Load1: 4.60
Load5: 1.20
Load15: 0.47
Total Accesses: 27860
Total kBytes: 33011
Total Duration: 54118
CPUUser: 18.02
CPUSystem: 31.76
CPUChildrenUser: 0
CPUChildrenSystem: 0
CPULoad: .0262535
Uptime: 189613
ReqPerSec: .146931
BytesPerSec: 178.275
BytesPerReq: 1213.33
DurationPerReq: 1.9425
BusyWorkers: 7
IdleWorkers: 93
Processes: 4
Stopping: 0
BusyWorkers: 7
IdleWorkers: 93
ConnsTotal: 13
ConnsAsyncWriting: 0
ConnsAsyncKeepAlive: 5
ConnsAsyncClosing: 0
Scoreboard: __________________________________________W_____________W___________________LW_____W______W_W_______............................................................................................................................................................................................................................................................................................................
It also uses Zabbix agent to collect Apache
Linux process stats like CPU usage, memory usage and whether process is running or not.
This template was tested on:
- Apache, version 2.4.41
Setup
See Zabbix template operation for basic instructions.
Setup mod_status
Check module availability: httpd -M 2>/dev/null | grep status_module
Example configuration of Apache:
<Location "/server-status">
SetHandler server-status
Require host example.com
</Location>
If you use another path, then don't forget to change {$APACHE.STATUS.PATH}
macro.
Install and setup Zabbix agent.
Zabbix configuration
No specific Zabbix configuration is required.
Macros used
Name | Description | Default |
---|---|---|
{$APACHE.PROCESS_NAME} | Apache server process name |
httpd |
{$APACHE.RESPONSE_TIME.MAX.WARN} | Maximum Apache response time in seconds for trigger expression |
10 |
{$APACHE.STATUS.HOST} | Hostname or IP address of the Apache status page |
127.0.0.1 |
{$APACHE.STATUS.PATH} | The URL path |
server-status?auto |
{$APACHE.STATUS.PORT} | The port of Apache status page |
80 |
{$APACHE.STATUS.SCHEME} | Request scheme which may be http or https |
http |
Template links
There are no template links in this template.
Discovery rules
Name | Description | Type | Key and additional info |
---|---|---|---|
Event MPM discovery | Additional metrics if event MPM is used https://httpd.apache.org/docs/current/mod/event.html |
DEPENDENT | apache.mpm.event.discovery Preprocessing: - JAVASCRIPT: - DISCARD_UNCHANGED_HEARTBEAT: |
Items collected
Group | Name | Description | Type | Key and additional info |
---|---|---|---|---|
Apache | Apache: Service ping | - |
ZABBIX_PASSIVE | net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] Preprocessing: - DISCARD_UNCHANGED_HEARTBEAT: |
Apache | Apache: Service response time | - |
ZABBIX_PASSIVE | net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] |
Apache | Apache: Total bytes | Total bytes served |
DEPENDENT | apache.bytes Preprocessing: - JSONPATH: - MULTIPLIER: |
Apache | Apache: Bytes per second | Calculated as change rate for 'Total bytes' stat. BytesPerSec is not used, as it counts average since last Apache server start. |
DEPENDENT | apache.bytes.rate Preprocessing: - JSONPATH: - MULTIPLIER: - CHANGE_PER_SECOND |
Apache | Apache: Requests per second | Calculated as change rate for 'Total requests' stat. ReqPerSec is not used, as it counts average since last Apache server start. |
DEPENDENT | apache.requests.rate Preprocessing: - JSONPATH: - CHANGE_PER_SECOND |
Apache | Apache: Total requests | A total number of accesses |
DEPENDENT | apache.requests Preprocessing: - JSONPATH: |
Apache | Apache: Uptime | Service uptime in seconds |
DEPENDENT | apache.uptime Preprocessing: - JSONPATH: |
Apache | Apache: Version | Service version |
DEPENDENT | apache.version Preprocessing: - JSONPATH: - DISCARD_UNCHANGED_HEARTBEAT: |
Apache | Apache: Total workers busy | Total number of busy worker threads/processes |
DEPENDENT | apache.workers_total.busy Preprocessing: - JSONPATH: |
Apache | Apache: Total workers idle | Total number of idle worker threads/processes |
DEPENDENT | apache.workers_total.idle Preprocessing: - JSONPATH: |
Apache | Apache: Workers closing connection | Number of workers in closing state |
DEPENDENT | apache.workers.closing Preprocessing: - JSONPATH: |
Apache | Apache: Workers DNS lookup | Number of workers in dnslookup state |
DEPENDENT | apache.workers.dnslookup Preprocessing: - JSONPATH: |
Apache | Apache: Workers finishing | Number of workers in finishing state |
DEPENDENT | apache.workers.finishing Preprocessing: - JSONPATH: |
Apache | Apache: Workers idle cleanup | Number of workers in cleanup state |
DEPENDENT | apache.workers.cleanup Preprocessing: - JSONPATH: |
Apache | Apache: Workers keepalive (read) | Number of workers in keepalive state |
DEPENDENT | apache.workers.keepalive Preprocessing: - JSONPATH: |
Apache | Apache: Workers logging | Number of workers in logging state |
DEPENDENT | apache.workers.logging Preprocessing: - JSONPATH: |
Apache | Apache: Workers reading request | Number of workers in reading state |
DEPENDENT | apache.workers.reading Preprocessing: - JSONPATH: |
Apache | Apache: Workers sending reply | Number of workers in sending state |
DEPENDENT | apache.workers.sending Preprocessing: - JSONPATH: |
Apache | Apache: Workers slot with no current process | Number of slots with no current process |
DEPENDENT | apache.workers.slot Preprocessing: - JSONPATH: |
Apache | Apache: Workers starting up | Number of workers in starting state |
DEPENDENT | apache.workers.starting Preprocessing: - JSONPATH: |
Apache | Apache: Workers waiting for connection | Number of workers in waiting state |
DEPENDENT | apache.workers.waiting Preprocessing: - JSONPATH: |
Apache | Apache: Number of processes running | - |
ZABBIX_PASSIVE | proc.num["{$APACHE.PROCESS_NAME}"] |
Apache | Apache: Memory usage (rss) | Resident set size memory used by process in bytes. |
ZABBIX_PASSIVE | proc.mem["{$APACHE.PROCESS_NAME}",,,,rss] |
Apache | Apache: Memory usage (vsize) | Virtual memory size used by process in bytes. |
ZABBIX_PASSIVE | proc.mem["{$APACHE.PROCESS_NAME}",,,,vsize] |
Apache | Apache: CPU utilization | Process CPU utilization percentage. |
ZABBIX_PASSIVE | proc.cpu.util["{$APACHE.PROCESS_NAME}"] |
Apache | Apache: Connections async closing | Number of async connections in closing state (only applicable to event MPM) |
DEPENDENT | apache.connections[async_closing{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Connections async keep alive | Number of async connections in keep-alive state (only applicable to event MPM) |
DEPENDENT | apache.connections[async_keep_alive{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Connections async writing | Number of async connections in writing state (only applicable to event MPM) |
DEPENDENT | apache.connections[async_writing{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Connections total | Number of total connections |
DEPENDENT | apache.connections[total{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Bytes per request | Average number of client requests per second |
DEPENDENT | apache.bytes[per_request{#SINGLETON}] Preprocessing: - JSONPATH: |
Apache | Apache: Number of async processes | Number of async processes |
DEPENDENT | apache.process[num{#SINGLETON}] Preprocessing: - JSONPATH: |
Zabbix_raw_items | Apache: Get status | Getting data from a machine-readable version of the Apache status page. https://httpd.apache.org/docs/current/mod/mod_status.html |
ZABBIX_PASSIVE | web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"] Preprocessing: - JAVASCRIPT: |
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Apache: Service is down | - |
{TEMPLATE_NAME:net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"].last()}=0 |
AVERAGE | Manual close: YES Depends on: - Apache: Process is not running |
Apache: Service response time is too high (over {$APACHE.RESPONSE_TIME.MAX.WARN}s for 5m) | - |
{TEMPLATE_NAME:net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"].min(5m)}>{$APACHE.RESPONSE_TIME.MAX.WARN} |
WARNING | Manual close: YES Depends on: - Apache: Process is not running - Apache: Service is down |
Apache: has been restarted (uptime < 10m) | Uptime is less than 10 minutes. |
{TEMPLATE_NAME:apache.uptime.last()}<10m |
INFO | Manual close: YES |
Apache: Version has changed (new version: {ITEM.VALUE}) | Apache version has changed. Ack to close. |
{TEMPLATE_NAME:apache.version.diff()}=1 and {TEMPLATE_NAME:apache.version.strlen()}>0 |
INFO | Manual close: YES |
Apache: Process is not running | - |
{TEMPLATE_NAME:proc.num["{$APACHE.PROCESS_NAME}"].last()}=0 |
HIGH | |
Apache: Failed to fetch status page (or no data for 30m) | Zabbix has not received data for items for the last 30 minutes. |
{TEMPLATE_NAME:web.page.get["{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}"].nodata(30m)}=1 |
WARNING | Manual close: YES Depends on: - Apache: Process is not running - Apache: 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.