mirror of
https://github.com/eosswedenorg/haproxy-exporter-systemd
synced 2026-06-16 05:04:56 +02:00
install.sh: adding some output.
This commit is contained in:
parent
137d80eebc
commit
bd93622015
1 changed files with 6 additions and 0 deletions
|
|
@ -8,17 +8,21 @@ CONFIGDIR=/etc/prometheus
|
|||
SRC_URL=https://github.com/prometheus/haproxy_exporter/releases/download/v${VERSION}/haproxy_exporter-${VERSION}.linux-${ARCH}.tar.gz
|
||||
|
||||
# Download and install the binary.
|
||||
echo " - Download source from: ${SRC_URL}"
|
||||
wget -q --show-progress -O- ${SRC_URL} | tar zxf -
|
||||
sudo mv haproxy_exporter-${VERSION}.linux-${ARCH}/haproxy_exporter ${INSTALLDIR}/haproxy_exporter-${VERSION}
|
||||
|
||||
# Create User/Group
|
||||
echo " - Adding user: haproxy_exporter"
|
||||
sudo useradd -M -s /bin/false haproxy_exporter
|
||||
|
||||
# Write config
|
||||
echo " - Write config: ${CONFIGDIR}/haproxy_exporter.conf"
|
||||
sudo mkdir -p ${CONFIGDIR}
|
||||
sudo cp ./haproxy_exporter.conf ${CONFIGDIR}/
|
||||
|
||||
# Write system service file.
|
||||
echo " - Write systemd service file: /etc/systemd/system/haproxy_exporter.service"
|
||||
echo "[Unit]
|
||||
Description=HAProxy Prometheus Exporter
|
||||
Wants=network-online.target
|
||||
|
|
@ -33,3 +37,5 @@ ExecStart=/usr/local/bin/haproxy_exporter-${VERSION} \$HAPROXY_EXPORTER_OPTS
|
|||
|
||||
[Install]
|
||||
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/haproxy_exporter.service > /dev/null
|
||||
|
||||
echo " - Done"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue