Apache HTTP
Apache HTTP Server is the most widely deployed open-source web server.
Auto-Detection
Section titled “Auto-Detection”Glouton detects Apache by its process and listening port (default: 80).
To enable metrics gathering, ensure Glouton can access the Apache status page at http://server-address/server-status?auto. This is enabled by default on Ubuntu and Debian. If not, add the following to your default virtual host (e.g. the first file in /etc/apache2/sites-enabled/):
LoadModule status_module /usr/lib/apache2/modules/mod_status.so
<Location /server-status> SetHandler server-status # You may want to limit access only to Bleemeo agent # require ip IP-OF-BLEEMEO-AGENT/32</Location>ExtendedStatus OnWhen using Docker, you can set http_path and http_host via labels:
docker run --label glouton.http_path="/readiness" --label glouton.http_host="my-host" [...]If auto-detected parameters are incorrect, override them manually:
sudo tee /etc/glouton/conf.d/99-apache.conf > /dev/null << 'EOF'service: # For an Apache running outside a container - type: "apache" address: "127.0.0.1" port: 80 # HTTP listener, agent does not support HTTPS here http_path: "/" # Path used for availability check, not metrics gathering http_host: "127.0.0.1:80" # Host header sent
# For an additional Apache running outside a container - type: "apache" instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE" address: "127.0.0.1" port: 81 http_path: "/" http_host: "127.0.0.1:80"
# For an Apache running in a Docker container - type: "apache" instance: "CONTAINER_NAME" address: "172.17.0.2" port: 80 http_path: "/" http_host: "127.0.0.1:80"EOFCreate or edit C:\ProgramData\glouton\conf.d\99-apache.conf:
service: # For an Apache running outside a container - type: "apache" address: "127.0.0.1" port: 80 # HTTP listener, agent does not support HTTPS here http_path: "/" # Path used for availability check, not metrics gathering http_host: "127.0.0.1:80" # Host header sent
# For an additional Apache running outside a container - type: "apache" instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE" address: "127.0.0.1" port: 81 http_path: "/" http_host: "127.0.0.1:80"Glouton automatically detects configuration changes.
Service Check
Section titled “Service Check”Glouton performs an HTTP check on the configured port and path to verify that Apache is responding.
Built-in Metrics
Section titled “Built-in Metrics”| Metric | Description |
|---|---|
service_status | Status of Apache |
apache_busy_workers | Number of busy Apache workers |
apache_busy_workers_perc | Percentage of busy Apache workers |
apache_bytes | Network traffic sent by Apache in bytes per second |
apache_connections | Number of client connections to the Apache server |
apache_idle_workers | Number of Apache workers waiting for an incoming request |
apache_max_workers | Maximum number of configured Apache workers |
apache_requests | Number of requests per second |
apache_uptime | Time since Apache server start in seconds |
Apache tracks server activity in a structure called the scoreboard. Each worker has a slot that holds its current status. The scoreboard size equals the maximum number of concurrent clients Apache can serve.
| Metric | Description |
|---|---|
apache_scoreboard_waiting | Number of workers waiting for an incoming request (same as apache_idle_workers) |
apache_scoreboard_starting | Number of workers starting up |
apache_scoreboard_reading | Number of workers reading an incoming request |
apache_scoreboard_sending | Number of workers processing a client request |
apache_scoreboard_keepalive | Number of workers waiting for another request via keepalive |
apache_scoreboard_dnslookup | Number of workers looking up a hostname |
apache_scoreboard_closing | Number of workers closing their connection |
apache_scoreboard_logging | Number of workers writing to log files |
apache_scoreboard_finishing | Number of workers gracefully finishing a request |
apache_scoreboard_idle_cleanup | Number of idle workers being killed |
apache_scoreboard_open | Number of empty slots with no worker in the scoreboard |
Apache does not start all workers when they are not needed – it reuses idle workers instead. The sum of all scoreboard items equals the maximum concurrent requests Apache can serve, stored in the apache_max_workers metric.
Glouton collects Apache HTTP access and error logs for analysis in Bleemeo.
Monitoring Troubleshooting
Section titled “Monitoring Troubleshooting”See Troubleshoot a Service Check or Missing Metrics for what applies to every service: finding the address and port Glouton really uses, what each check message means, and how to read the collection error — which does not appear in the agent logs at the default level.
The check and the metrics use two different URLs:
| URL | Configurable | |
|---|---|---|
| Service check | http://<address>:<port>/ |
Yes, with http_path and http_host |
| Metrics | http://<address>:<port>/server-status?auto |
No — the path is fixed |
The Service Check is not OK
Section titled “The Service Check is not OK”The check is an HTTP request, so its status text carries the HTTP code:
| Status text | Cause | Fix |
|---|---|---|
HTTP WARN - http_code=404 |
Apache serves nothing at / — typically name-based virtual hosts |
Point the check at an existing path with http_path, and set http_host to the virtual host name |
HTTP WARN - http_code=403 |
A Require directive, or a directory listing refused |
Use a http_path the agent is allowed to fetch |
HTTP CRITICAL - http_code=500 |
Apache is healthy but the application behind it is not | Set http_path to a static path served by Apache itself |
HTTP connection failed: ... |
Nothing listening on that port, or the listener is HTTPS-only | The check speaks plain HTTP: point it at the HTTP listener, or use an uptime monitor for an HTTPS endpoint |
Connection timed out after 10 seconds |
A firewall drops the packets, or all workers are busy | Open the port, or investigate the saturation |
Metrics are Missing
Section titled “Metrics are Missing”A passing check says nothing about the metrics: they are collected separately.
Metrics come from mod_status, which Glouton fetches at the fixed path
/server-status?auto. http_path does not move it.
Check the endpoint from the machine where the agent runs:
curl -i "http://<apache-address>/server-status?auto"It must return a Total Accesses: line.
| What the endpoint returns | Cause | Fix |
|---|---|---|
404 |
mod_status not loaded |
Load the module and add the Location block shown above |
404 |
The Location block is missing, or lives in another virtual host |
Declare it in the virtual host that answers on the port Glouton uses |
403 |
Access restricted to localhost while the agent connects from elsewhere | Add a Require ip line for the agent address |
the answer has no CPUUser line |
ExtendedStatus disabled |
Set ExtendedStatus On; without it the per-worker and CPU metrics are not published |
| a connection error | The listener is HTTPS-only | Expose server-status on a plain HTTP listener, even on 127.0.0.1 only |