6
0
Fork 0

Add VEEAM file age exporter.

This commit is contained in:
Joachim Desroches 2021-11-16 13:47:02 +01:00
parent 0175a771b9
commit 47d5dd3e9c
Signed by untrusted user who does not match committer: jdesroches
GPG Key ID: 6778C9C29C02D691
5 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#!/bin/sh
BACKUPDIR=$(cat "${__object:?}/parameter/backupdir")
cat << EOF
[Unit]
Description=e-Durable's VEEAM upload date exporter
After=network.target
[Service]
Type=simple
User=veeam
ExecStart=/opt/prometheus-veeam-exporter/venv/bin/python /opt/prometheus-veeam-exporter/prometheus-veeam-exporter ${BACKUPDIR:?}
[Install]
WantedBy=multi-user.target
EOF

View File

@ -0,0 +1,20 @@
#!/bin/sh
VCS_TAG=$(cat "${__object:?}/parameter/version")
VCS_URL="https://code.recycled.cloud/RecycledCloud/prometheus-veeam-exporter/raw/tag/${VCS_TAG:?}/prometheus-veeam-exporter"
cat << EOF
cd /opt/prometheus-veeam-exporter
# Fetch sources
curl "$VCS_URL" -o prometheus-veeam-exporter
# Install virtualenv and dependencies
python3 -m venv venv
. venv/bin/activate
pip3 install prometheus_client datetime
# Start service
systemctl restart prometheus-veeam-exporter
EOF

View File

@ -0,0 +1,23 @@
#!/bin/sh
os=$(cat "${__global:?}/explorer/os")
mkdir -p "${__object:?}/files"
case "$os" in
debian | ubuntu)
__package python3-venv
__package curl
"${__type:?}/files/prometheus-veeam-exporter.service.sh" \
>"${__object:?}/files/prometheus-veeam-exporter.service"
__systemd_unit prometheus-veeam-exporter.service \
--source "${__object:?}/files/prometheus-veeam-exporter.service" \
--enablement-state enabled
;;
*)
echo "$os is not supported by this type. Exiting" >&2
exit 1
;;
esac
__directory /opt/prometheus-veeam-exporter

View File

@ -0,0 +1,2 @@
backupdir
version