Skip to main content
Version: NG-3.1

Apache

Introduction

The Apache HTTP Server, commonly referred to as Apache, is an open-source web server software that serves as the foundation for the majority of websites on the internet.

Getting Started

Compatibility

The Apache O11ySource supports monitoring Apache HTTP Server versions 2.4.16 and later.

Data Collection Method

vuSmartMaps collects health metrics and logs through OmniAgent’s health and log collection probes.

Prerequisites

Inputs for Configuring Data Source

  • Apache Server: The IP address or FQDN of the Apache server. This value uniquely identifies each server instance you add.
nan
  • Period [in seconds]: How frequently data is gathered. The period should be between 60 and 3000 seconds.
  • URL: The base URL of the Apache server hosting /server-status (for example, http://<host>:<port>).
  • Access Log Path: Enter the full path to the Apache access log file.
  • Error Log Path: Enter the full path to the Apache error log file.

Firewall Requirement

To collect data from this O11ySource, ensure the following ports are opened:

Source IPDestination IPDestination PortProtocolDirection
IP address of the Apache servervuSmartMaps Collection/Ingress node IP443*TCPInbound

*Before providing the firewall requirements, please update the port based on the customer environment.

Configuring the Target

Configure metrics collection from Apache Apache metrics are collected by querying the server-status endpoint provided by mod_status.

Check whether mod_status is enabled:

apachectl -M | grep -i status

(For Debian/Ubuntu, you can also use:)

apache2ctl -M | grep -i status

Enable the status module (Debian/Ubuntu):

sudo a2enmod status

Configure /server-status access and enable ExtendedStatus.

Update the Apache configuration file as per your OS, for example:

    • Debian/Ubuntu: /etc/apache2/mods-enabled/status.conf
    • RHEL/CentOS: /etc/httpd/conf.modules.d/* and /etc/httpd/conf/httpd.conf

Recommended for Apache 2.4+ (use Require):

<IfModule mod_status.c>
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Require ip <DATA_COLLECTOR_IP>
</Location>
</IfModule>
<IfModule mod_status.c>
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from <DATA_COLLECTOR_IP>
</Location>
</IfModule>

Reload Apache to apply changes:

apachectl -k graceful

(Or systemd)

sudo systemctl reload apache2
sudo systemctl reload httpd

From the collector/agent host (whose IP is included in the Require ip \<DATA_COLLECTOR_IP> rule), validate the endpoint:

curl -s http://<APACHE_HOST>:<PORT>/server-status?auto

Use https:// if your Apache status endpoint is TLS-enabled.

Configure log collection from Apache Apache logs are collected from access and error logs. Ensure Apache access/error logs are enabled and readable.

Common log locations:

    • Debian/Ubuntu: /var/log/apache2/access.log, /var/log/apache2/error.log
    • RHEL/CentOS: /var/log/httpd/access_log, /var/log/httpd/error_log

Optional: If you need to customize log format, update the LogFormat section in the Apache configuration:

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

Example: Add request time (microseconds) using %D:

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %D" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %D" combined

Configuration Steps

Metrics Collected

NameDescriptionData Type
@timestampThe original string timestamp from the source log.String
timestampThe timestamp for the data point with high precision (64-bit).DateTime64
targetThe target for the metrics, typically identifying the specific system or service being monitored.String
hostHostname of the server where the metrics were collected.String
tenant_idTenant identifier for multi-tenant environments.LowCardinality(String)
bu_idBusiness Unit identifier for organizational grouping.LowCardinality(String)
TypeType of service being monitored (e.g., Apache, Nginx, etc.).String
UptimeAlias of uptime_server_uptime (backward compatibility).Float64
StatusCurrent status of the server or service (e.g., "Running", "Stopped").LowCardinality(String)
service_typeThe type of service provided (e.g., HTTP, HTTPS).String
source_idUnique identifier for the source from which the metrics are collected.String
service_addressThe address of the service (e.g., IP address or URL).String
vublock_nameBlock name or virtual unit block within a larger system.String
metricset_nameThe name of the specific metric set (group of related metrics).String
typeType of data point being recorded (e.g., gauge, counter).String
periodTime period for which the metrics are being collected (in seconds).Float64
topic_nameName of the topic related to the metric, such as a specific service or function.LowCardinality(String)
requests_per_secNumber of HTTP requests per second.Float64
hostnameThe hostname of the server where Apache is running.String
uptime_uptimeUptime of the current Apache process in seconds.Float64
uptime_server_uptimeServer uptime since the last restart in seconds.Float64
cpu_loadThe current CPU load (the average amount of work the CPU has to do).Float64
cpu_userThe percentage of CPU time spent in user space.Float64
cpu_systemThe percentage of CPU time spent in kernel space.Float64
cpu_children_userCPU time spent by child processes in user mode.Float64
cpu_children_systemCPU time spent by child processes in kernel mode.Float64
cpu_system_diffDifference in system CPU usage between the last two metric collections.Float64
cpu_system_rateRate of system CPU usage.Float64
cpu_user_diffDifference in user CPU usage between the last two metric collections.Float64
cpu_user_rateRate of user CPU usage.Float64
scoreboard_waiting_for_connectionNumber of workers waiting for a connection.UInt64
scoreboard_reading_requestNumber of workers reading requests.UInt64
scoreboard_dns_lookupNumber of workers performing DNS lookups.UInt64
scoreboard_closing_connectionNumber of workers closing connections.UInt64
scoreboard_gracefully_finishingNumber of workers gracefully finishing connections.UInt64
scoreboard_idle_cleanupNumber of workers cleaning up idle connections.UInt64
scoreboard_keepaliveNumber of workers handling keep-alive connections.UInt64
scoreboard_totalTotal number of scoreboard slots used.UInt64
scoreboard_loggingNumber of workers writing log entries.UInt64
scoreboard_open_slotNumber of open slots in the scoreboard.UInt64
scoreboard_starting_upNumber of workers in the process of starting up.UInt64
scoreboard_sending_replyNumber of workers sending replies to clients.UInt64
load_15System load average over the last 15 minutes.Float64
load_1System load average over the last 1 minute.Float64
load_5System load average over the last 5 minutes.Float64
bytes_per_secThe number of bytes served per second.Float64
connections_totalTotal number of connections handled.Float64
connections_async_writingNumber of asynchronous writing connections.Float64
connections_async_keep_aliveNumber of asynchronous keep-alive connections.Float64
connections_async_closingNumber of asynchronous closing connections.Float64
workers_busyNumber of busy workers at the time of data collection.Float64
workers_idleNumber of idle workers at the time of data collection.Float64
total_accessesTotal number of accesses (requests) made to the server.Float64
bytes_per_requestAverage number of bytes per request.Float64
total_kbytesTotal number of kilobytes served.Float64
total_accesses_diffDifference in the number of total accesses since the last metric collection.UInt32
total_kbytes_diffDifference in total kilobytes served since the last metric collection.UInt64
total_kbytes_rateRate at which kilobytes are being served.Float64
total_cpuTotal CPU time used by the server.Float64
total_cpu_pctPercentage of total CPU utilization.Float64
busy_workers_pctPercentage of workers that are busy.Float64
idle_workers_pctPercentage of workers that are idle.Float64
timestampThe timestamp when the log entry was recorded with high precision (64-bit).DateTime64
targetThe target for the log or metrics, usually the application or server.String
hostThe hostname of the server where the log was generated.String
apache2_access_referrerThe URL of the referring page from where the request originated.String
apache2_access_response_codeHTTP response code returned by the server (e.g., 200 for success, 404 for not found).UInt64
apache2_access_body_sent_bytesNumber of bytes sent in the response body.UInt64
apache2_access_urlThe URL that was accessed by the client.String
apache2_access_user_nameThe username of the authenticated user (if available).String
apache2_access_remote_ipThe IP address of the client making the request.String
apache2_access_methodThe HTTP method used for the request (e.g., GET, POST).LowCardinality(String)
apache2_access_user_agent_nameName of the user's browser or client application (user-agent).String
apache2_access_user_agent_minorMinor version number of the user-agent.UInt64
apache2_access_user_agent_os_nameOperating system of the client accessing the server.String
apache2_access_tatTurnaround time for the request (time taken to process the request, in seconds).Float64
apache2_access_user_agent_deviceThe type of device making the request (e.g., mobile, desktop).LowCardinality(String)
httpCodeAlias of apache2_access_response_code (backward compatibility).UInt64
responseThe response body or message returned by the server, if applicable.String
geo_country_nameGeographical location of the client, specifically the country name.String
geo_timezoneTimezone of the client’s geographical location.String
geo_city_nameGeographical location of the client, specifically the city name.String
doc_typeType of document or log entry (e.g., access log, error log).LowCardinality(String)
source_idUnique identifier for the source of the log entry.LowCardinality(String)
vublock_nameName of the virtual block or unit block within the system.LowCardinality(String)
o11ysource_nameName of the observability source or platform collecting the logs (e.g., a monitoring tool or service).LowCardinality(String)
tenant_idIdentifier for the tenant in multi-tenant environments.LowCardinality(String)
bu_idBusiness Unit identifier, typically for organizational purposes.LowCardinality(String)
typeType of log entry, representing different kinds of data points (e.g., access logs, error logs).LowCardinality(String)
messageThe full log message or entry.String