diff --git a/exporter/postfix_exporter/install.sh b/exporter/postfix_exporter/install.sh new file mode 100644 index 0000000..f8b5767 --- /dev/null +++ b/exporter/postfix_exporter/install.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + +SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" + +if service --status-all | grep -Fq 'postfix_exporter'; then + service postfix_exporter stop +fi + +echo "Copying exporter" + +mkdir -p /usr/prometheus + +echo "Checking/Creating systemd configuration" + +cp $SCRIPTPATH/postfix_exporter /usr/prometheus/postfix_exporter +chmod +x /usr/prometheus/postfix_exporter + +cp $SCRIPTPATH/postfix_exporter.service /etc/systemd/system/ + +echo "Starting exporter" + +systemctl enable postfix_exporter.service +service postfix_exporter start + +echo "Exporter available at :9154" diff --git a/exporter/postfix_exporter/postfix_exporter b/exporter/postfix_exporter/postfix_exporter new file mode 100644 index 0000000..ebafe47 Binary files /dev/null and b/exporter/postfix_exporter/postfix_exporter differ diff --git a/exporter/postfix_exporter/postfix_exporter.service b/exporter/postfix_exporter/postfix_exporter.service new file mode 100644 index 0000000..8e192ed --- /dev/null +++ b/exporter/postfix_exporter/postfix_exporter.service @@ -0,0 +1,11 @@ +[Unit] +Description=Postfix Exporter + +[Service] +User=root +ExecStart=/usr/prometheus/postfix_exporter +ProtectHome=true +ProtectSystem=full + +[Install] +WantedBy=multi-user.target