Add basic postfix_exporter
This commit is contained in:
parent
72f45aef33
commit
b39ca12566
30
exporter/postfix_exporter/install.sh
Normal file
30
exporter/postfix_exporter/install.sh
Normal file
@ -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"
|
BIN
exporter/postfix_exporter/postfix_exporter
Normal file
BIN
exporter/postfix_exporter/postfix_exporter
Normal file
Binary file not shown.
11
exporter/postfix_exporter/postfix_exporter.service
Normal file
11
exporter/postfix_exporter/postfix_exporter.service
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user