Add VEEAM file age exporter.
This commit is contained in:
parent
0175a771b9
commit
47d5dd3e9c
5 changed files with 62 additions and 0 deletions
17
type/__prometheus_veeam_exporter/files/prometheus-veeam-exporter.service.sh
Executable file
17
type/__prometheus_veeam_exporter/files/prometheus-veeam-exporter.service.sh
Executable 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
|
20
type/__prometheus_veeam_exporter/gencode-remote
Executable file
20
type/__prometheus_veeam_exporter/gencode-remote
Executable 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
|
23
type/__prometheus_veeam_exporter/manifest
Executable file
23
type/__prometheus_veeam_exporter/manifest
Executable 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
|
2
type/__prometheus_veeam_exporter/parameter/required
Normal file
2
type/__prometheus_veeam_exporter/parameter/required
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
backupdir
|
||||||
|
version
|
0
type/__prometheus_veeam_exporter/singleton
Normal file
0
type/__prometheus_veeam_exporter/singleton
Normal file
Reference in a new issue