The Halon MTA can be easily monitored using Prometheus with the help of their Node Exporter.
Below is an example on how you can use the jq tool to format the output from the halonctl process-stats
command to their text-based format.
halonctl process-stats --json | jq -r '.servers |= map(del(.serverid)) | [leaf_paths as $path | {"key": $path | join("_"), "value": getpath($path)}] | from_entries | keys[] as $k | "halon_\($k) \(.[$k])"' > /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
You can use http://localhost:9100/metrics to verify that the metrics are populated correctly.
Finally you can configure Prometheus to fetch the data from Node Exporter like this:
global: scrape_interval: 15s scrape_configs: - job_name: halon static_configs: - targets: ['localhost:9100']
You can use http://localhost:9090/graph to verify that the metrics are populated correctly.
Comments
0 comments
Article is closed for comments.