This is the Apache httpd monitoring Agent for Sematext Monitoring
Preparation
-
Get a free account at sematext.com/spm
-
Create a Monitoring App of type "Apache" and copy the Application Token - or execute the commands displayed in the Sematext UI (which are described here as well)
-
Install Node.js on your Apache httpd server
-
Activate Apache
mod_status
module withsudo a2enmod status
and configure it in the file/etc/apache2/mods-enabled/status.conf
:
<Location /server-status>
SetHandler server-status
</Location>
Optional preparation for PHP FastCGI Process Manager (FPM): To add monitoring for PHP-FPM follow this instructions.
Setup
# Install sematext-agent-httpd npm i sematext/sematext-agent-httpd -g# If you use Sematext Cloud EU, set region for API endpoints # sematext-httpd-setup -r EU # Install systemd or upstart service file for sematext-agent-httpd sematext-httpd-setup -t YOUR_SPM_TOKEN_HERE -u http://localhost/server-status
Configuration
The setup script stores the configuration in /etc/sematext/sematext-agent-httpd.config
In case you want to change settings later edit /etc/sematext/sematext-agent-httpd.config
. Restart the Sematext Apache Agent after config changes, depending on the init system:
- Upstart (Ubuntu):
sudo service sematext-agent-httpd restart
- Systemd (Linux others):
sudo systemctl stop sematext-agent-httpd
sudo systemctl start sematext-agent-httpd
- Launchd (Mac OS X):
sudo launchctl stop com.sematext.sematext-agent-httpd
sudo launchctl stop com.sematext.sematext-agent-httpd
For tests you can just run the agent from command line:
sematext-agent-httpd --config /etc/sematext/sematext-agent-httpd.config
Results
Apache Metrics in SPM:
Docker
Sematext Agent for Apache includes a docker file and startup script to build a Docker image.
git clone https://github.com/sematext/sematext-agent-apache.git
cd sematext-agent-apache
docker build -t sematext/sematext-agent-apache .
The Sematext Apache Agent supports following parameters on Docker:
Environment Variable | Description |
---|---|
Required parameters | |
SPM_TOKEN | your SPM Token for the Apache SPM App |
HTTPD_STATUS_URL | the URL to httpd server, delivering the stats (see httpd configuration above). Please note the servername/ip must be reachable from the agent container. You might need to use --link Apache container-name to create the network link. |
Optional parameters | |
PHP_FPM_STATUS_URL | PHP FastCGI status url |
HTTPS_PROXY | Url to HTTPS proxy if the agent runs behind a firewall |
SPM_RECEIVER_URL | Optional for SPM On-Premises, default value: https://spm-receiver.sematext.com:443/receiver/v1/_bulk |
EVENTS_RECEIVER_URL | Optional for SPM On-Premises, default value: https://event-receiver.sematext.com |
Example:
docker run --name sematext-agent-httpd -e SPM_TOKEN=YOUR_SPM_APACHE_TOKEN_HERE \
-e HTTPD_STATUS_URL=http://httpd-server/server-status \
-d sematext/sematext-agent-httpd
Support
- Twitter: @sematext
- Blog: blog.sematext.com
- Homepage: www.sematext.com