Quick overview
This workflow runs a manual health assessment of a Wazuh deployment by querying the Wazuh Manager API, Wazuh Indexer API, and host metrics over SSH, then scores the results, generates prioritized recommendations, stores a baseline in an n8n Data Table, and emails an HTML report.
How it works
- Runs when you manually trigger the workflow.
- Authenticates to the Wazuh Manager API and collects manager info, process status, manager statistics, daemon statistics, agent connectivity summary, and cluster health.
- Queries the Wazuh Indexer API to collect cluster health, shard/allocation status, disk allocation, and node pressure (CPU/load, heap, and RAM usage).
- Connects over SSH to the Wazuh host to sample Linux CPU, memory, disk, inode, uptime, and (when present) Docker container state and health.
- Loads the most recent stored run from an n8n Data Table and evaluates all collected evidence against configurable thresholds to compute an overall Green/Yellow/Red status, a weighted health score, and prioritized recommendations.
- Stores the current run’s metrics and comparison data in the Data Table and emails the formatted HTML health report via SMTP.
Setup
- Create and select a Wazuh Manager API HTTP Basic Auth credential with permission to call the manager, agents, daemons, and cluster endpoints.
- Create and select a Wazuh Indexer HTTP Basic Auth credential with access to cluster health and cat APIs (for example, a role including cluster_monitor).
- Create and select an SSH private key credential for a least-privilege Linux account that can run the provided read-only metrics commands on the target host.
- Create an n8n Data Table named “Wazuh Health Runs” (or update the table selection) and ensure it includes fields for runId, runAt, assessmentLabel, overallStatus, healthScore, criticalCount, warningCount, metrics_object, recommendations_object, comparison_object, and reportSent.
- Add an SMTP credential, then update the Wazuh Manager/Indexer URLs, organization label, sender/recipient addresses, deploymentType, and threshold values in the configuration step before running the workflow.