ansible/roles/prometheus-node-exporter-po.../files/postfix.sh

12 lines
318 B
Bash
Executable File

#!/bin/bash
#
# Description: Expose metrics from postfix.
#
# Author: Alexandre Iooss <erdnaxe@crans.org>
mailq_length="$(/usr/bin/mailq | grep "[^ ]*@crans.org" | wc -l)"
echo '# HELP postfix_mailq_length Pending mails in mailq.'
echo '# TYPE postfix_mailq_length gauge'
echo "postfix_mailq_length ${mailq_length}"