|
2 | 2 |
|
3 | 3 | ## Overview |
4 | 4 |
|
5 | | -This check "allows a server administrator to find out how well their server is performing". For the check plugin to work you have to enable `mod_status` and set `ExtendedStatus` to `On`. Have a look at <https://httpd.apache.org/docs/2.4/mod/mod_status.html>. |
| 5 | +Monitors Apache httpd performance via the mod_status endpoint (server-status?auto). Alerts when worker usage exceeds the configured thresholds. Reports busy and idle workers, request rates, bytes served, CPU load, connection states, and system load averages. Requires "ExtendedStatus On" in the Apache configuration for full metrics. Uses a local SQLite database to calculate per-second rates from cumulative counters. |
| 6 | + |
| 7 | +**Data Collection:** |
| 8 | + |
| 9 | +* Fetches data from the Apache `mod_status` machine-readable endpoint (`server-status?auto`) |
| 10 | +* Parses the scoreboard to count workers in each state (reading, replying, keepalive, DNS lookup, closing, logging, starting, finishing, waiting, free slots) |
| 11 | +* Uses a local SQLite database to store previous values and calculate per-interval deltas for accesses, bytes, and duration |
| 12 | +* On the first run (or after a restart), returns "Waiting for more data." until at least two measurements are available |
| 13 | + |
| 14 | +**Compatibility:** |
| 15 | + |
| 16 | +* Works with any Apache httpd version that provides `mod_status` |
| 17 | +* Some metrics (connection stats, load averages, processes) are only available in newer versions of `mod_status` |
| 18 | + |
| 19 | +**Important Notes:** |
| 20 | + |
| 21 | +* `mod_status` must be loaded and `ExtendedStatus On` must be set in the Apache configuration for full metrics. Without `ExtendedStatus`, only worker counts and scoreboard data are reported. |
| 22 | +* The check alerts on the percentage of busy workers relative to the total number of worker slots (busy + idle + free) |
| 23 | +* Workers in the "Gracefully finishing" (G) state are counted as idle workers, not busy workers |
6 | 24 |
|
7 | 25 | Busy workers (workers serving requests) are: |
8 | 26 |
|
@@ -72,11 +90,11 @@ If you want to configure `/server-status` in a virtual host: |
72 | 90 | | Fact | Value | |
73 | 91 | |----|----| |
74 | 92 | | Check Plugin Download | <https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/apache-httpd-status> | |
75 | | -| Check Interval Recommendation | Once a minute | |
| 93 | +| Nagios/Icinga Check Name | `check_apache_httpd_status` | |
| 94 | +| Check Interval Recommendation | Every minute | |
76 | 95 | | Can be called without parameters | Yes | |
77 | 96 | | Compiled for Windows | No | |
78 | | -| Requirements | Enable `mod_status` and set `ExtendedStatus` to `On` | |
79 | | -| Uses SQLite DBs | `$TEMP/linuxfabrik-monitoring-plugins-apache-httpd-status.db` | |
| 97 | +| Uses State File | `$TEMP/linuxfabrik-monitoring-plugins-apache-httpd-status.db` | |
80 | 98 |
|
81 | 99 |
|
82 | 100 | ## Help |
@@ -149,44 +167,48 @@ Server Built ! Jun 2 2021 00:00:00 |
149 | 167 |
|
150 | 168 | ## States |
151 | 169 |
|
152 | | -* WARN or CRIT if more than 80% or 95% busy workers compared to the total possible number of workers found. |
| 170 | +* OK if the percentage of busy workers is below the warning threshold. |
| 171 | +* OK with "Waiting for more data." on the first run or after an Apache restart. |
| 172 | +* WARN if the percentage of busy workers is >= `--warning` (default: 80). |
| 173 | +* CRIT if the percentage of busy workers is >= `--critical` (default: 95). |
| 174 | +* `--always-ok` suppresses all alerts and always returns OK. |
153 | 175 |
|
154 | 176 |
|
155 | 177 | ## Perfdata / Metrics |
156 | 178 |
|
157 | 179 | | Name | Type | Description | |
158 | 180 | |----|----|----| |
159 | | -| Accesses | Number | A total number of accesses and byte count served | |
160 | | -| BusyWorkers | Number | workers_closing + workers_dns + workers_idle + workers_keepalive + workers_logging + workers_reading + workers_replying + workers_starting | |
161 | | -| Bytes | Number | Bytes sent | |
162 | | -| ConnsAsyncClosing | Number | | |
163 | | -| ConnsAsyncKeepAlive | Number | | |
164 | | -| ConnsAsyncWriting | Number | | |
165 | | -| ConnsTotal | Number | | |
166 | | -| CPULoad | Number | | |
167 | | -| IdleWorkers | Number | workers_finishing + workers_waiting | |
168 | | -| Load1 | Number | | |
169 | | -| Load15 | Number | | |
170 | | -| Load5 | Number | | |
171 | | -| ParentServerConfigGeneration | Number | | |
172 | | -| ParentServerMPMGeneration | Number | | |
173 | | -| Processes | Number | | |
174 | | -| Stopping | Number | | |
175 | | -| Total Duration | Seconds | | |
176 | | -| TotalWorkers | Number | | |
177 | | -| Uptime | Seconds | The time the server has been running for | |
178 | | -| WorkerUsagePercentage | Percentage | | |
179 | | -| workers_closing | Number | BusyWorkers; Closing connection, 'C' in Apache Scoreboard (SERVER_CLOSING) | |
180 | | -| workers_dns | Number | BusyWorkers; DNS Lookup,'D' in Apache Scoreboard (SERVER_BUSY_DNS) | |
181 | | -| workers_finishing | Number | IdleWorkers; Gracefully finishing, 'G' in Apache Scoreboard (SERVER_GRACEFUL) | |
182 | | -| workers_free | Number | Open slot with no current process, '.' in Apache Scoreboard (SERVER_DEAD) | |
183 | | -| workers_idle | Number | BusyWorkers; Idle cleanup of worker, 'I' in Apache Scoreboard (SERVER_IDLE_KILL) | |
184 | | -| workers_keepalive | Number | BusyWorkers; Keepalive (read), 'K' in Apache Scoreboard (SERVER_BUSY_KEEPALIVE) | |
185 | | -| workers_logging | Number | BusyWorkers; Logging, 'L' in Apache Scoreboard (SERVER_BUSY_LOG) | |
186 | | -| workers_reading | Number | BusyWorkers; Reading Request, 'R' in Apache Scoreboard (SERVER_BUSY_READ) | |
187 | | -| workers_replying | Number | BusyWorkers; Sending Reply, 'W' in Apache Scoreboard (SERVER_BUSY_WRITE) | |
188 | | -| workers_starting | Number | BusyWorkers; Starting up, 'S' in Apache Scoreboard (SERVER_STARTING) | |
189 | | -| workers_waiting | Number | IdleWorkers; Waiting for Connection, '\_' in Apache Scoreboard (SERVER_READY) | |
| 181 | +| Accesses | Number | Total number of accesses during the check interval. | |
| 182 | +| BusyWorkers | Number | Number of workers currently processing requests. | |
| 183 | +| Bytes | Bytes | Total bytes served during the check interval. | |
| 184 | +| ConnsAsyncClosing | Number | Number of async connections in closing state. | |
| 185 | +| ConnsAsyncKeepAlive | Number | Number of async connections in keep-alive state. | |
| 186 | +| ConnsAsyncWriting | Number | Number of async connections in writing state. | |
| 187 | +| ConnsTotal | Number | Total number of connections. | |
| 188 | +| CPULoad | Number | CPU load of the Apache process. | |
| 189 | +| IdleWorkers | Number | Number of idle workers (finishing + waiting). | |
| 190 | +| Load1 | Number | System load average, 1 minute. | |
| 191 | +| Load15 | Number | System load average, 15 minutes. | |
| 192 | +| Load5 | Number | System load average, 5 minutes. | |
| 193 | +| ParentServerConfigGeneration | Number | Apache configuration generation counter. | |
| 194 | +| ParentServerMPMGeneration | Number | Apache MPM generation counter. | |
| 195 | +| Processes | Number | Number of Apache processes. | |
| 196 | +| Stopping | Number | Number of stopping processes. | |
| 197 | +| Total Duration | Seconds | Total duration of all requests during the check interval. | |
| 198 | +| TotalWorkers | Number | Total number of worker slots (busy + idle + free). | |
| 199 | +| Uptime | Seconds | Time the server has been running. | |
| 200 | +| WorkerUsagePercentage | Percentage | Percentage of workers currently processing requests. | |
| 201 | +| workers_closing | Number | Workers closing connections ("C" in scoreboard). | |
| 202 | +| workers_dns | Number | Workers performing DNS lookup ("D" in scoreboard). | |
| 203 | +| workers_finishing | Number | Workers gracefully finishing ("G" in scoreboard). | |
| 204 | +| workers_free | Number | Open slots with no current process ("." in scoreboard). | |
| 205 | +| workers_idle | Number | Workers in idle cleanup ("I" in scoreboard). | |
| 206 | +| workers_keepalive | Number | Workers in keepalive read ("K" in scoreboard). | |
| 207 | +| workers_logging | Number | Workers logging ("L" in scoreboard). | |
| 208 | +| workers_reading | Number | Workers reading request ("R" in scoreboard). | |
| 209 | +| workers_replying | Number | Workers sending reply ("W" in scoreboard). | |
| 210 | +| workers_starting | Number | Workers starting up ("S" in scoreboard). | |
| 211 | +| workers_waiting | Number | Workers waiting for connection ("_" in scoreboard). | |
190 | 212 |
|
191 | 213 |
|
192 | 214 | ## Troubleshooting |
|
0 commit comments