This exporter gathers basic Wazuh manager and agent metrics using the Wazuh REST API and exposes them for Prometheus scraping.
Set the following variables to configure the exporter:
| Variable | Description | Required | Default |
|---|---|---|---|
WAZUH_API_URL |
Base URL to the Wazuh API | Yes | — |
WAZUH_USER |
API username | Yes | — |
WAZUH_PASS |
API password | Yes | — |
PORT |
Port to expose Prometheus metrics | No | 9115 |
SCRAPE_INTERVAL |
API scrape interval in seconds | No | 30 |
Example:
export WAZUH_API_URL="https://wazuh.example.com:55000"
export WAZUH_USER="monitor"
export WAZUH_PASS="secret"
export PORT=9115
export SCRAPE_INTERVAL=20
Start the exporter:
python wazuh_exporter.py
Metrics will be available at:
http://localhost:<PORT>/metrics
A Dockerfile is included in the repository, you can build and run the exporter as a container:
# Build the Docker image
docker build -t wazuh-exporter .
# Run the container with environment variables
docker run -d \
-e WAZUH_API_URL="https://wazuh.example.com:55000" \
-e WAZUH_USER="monitor" \
-e WAZUH_PASS="secret" \
-e PORT=9115 \
-e SCRAPE_INTERVAL=30 \
-p 9115:9115 \
wazuh-exporterMetrics will then be available at http://localhost:9115/metrics.
The code was generated by an AI model and may contain errors, omissions, or non-optimal patterns. Review and test thoroughly before deploying in production.