Monitoring with Prometheus
The Halon MTA can be easily monitored using Prometheus with the help of their Node Exporter.
Exporting the metrics
Below is an example on how you can use the halonctl process-stats
command to export the values in their text-based format.
halonctl process-stats --openmetrics > /halon-stats/process-stats.prom.$$
mv /halon-stats/process-stats.prom.$$ /halon-stats/process-stats.prom
This command can then easily be ran in a cronjob and then you can have the output be parsed by Node Exporter like this:
node_exporter --collector.disable-defaults \
--collector.textfile \
--collector.textfile.directory=/halon-stats
tip
You can use http://localhost:9100/metrics to verify that the metrics are populated correctly.
Fetching the metrics
Finally you can configure Prometheus to fetch the data from Node Exporter like this:
/etc/prometheus/prometheus.yml
global:
scrape_interval: 1m
scrape_configs:
- job_name: halon
static_configs:
- targets: ["localhost:9100"]
tip
You can use http://localhost:9090/graph to verify that the metrics are populated correctly.