-
Notifications
You must be signed in to change notification settings - Fork 0
/
Zabbix-Sender.sh
29 lines (23 loc) · 1.03 KB
/
Zabbix-Sender.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# JM - https://github.com/JXGA/Duplicati-ZabbixSender
# This can be used to push a notification to Zabbix when a Duplicati state changes.
# Refer to Duplicati docs. This is based upon their run-script-example.sh
# You'll need to change the IP, Server ID & Duplicati field from the zabbix-sender script.
#Defines EVENTNAME and OPERATIONNAME from Duplicati variables.
EVENTNAME=$DUPLICATI__EVENTNAME
OPERATIONNAME=$DUPLICATI__OPERATIONNAME
OPERATIONRESULT=$DUPLICATI__PARSED_RESULT
# If this script runs BEFORE the backup begins:
if [ "$EVENTNAME" == "BEFORE" ]
then
/usr/bin/zabbix_sender -z 192.168.1.60 -s "SRV - ML110" -k duplicati.check -o "$OPERATIONNAME"
elif [ "$EVENTNAME" == "AFTER" ]
then
if [ "$OPERATIONNAME" == "Backup" ]
then
/usr/bin/zabbix_sender -z 192.168.1.60 -s "SRV - ML110" -k duplicati.check -o "$OPERATIONRESULT"
else
/usr/bin/zabbix_sender -z 192.168.1.60 -s "SRV - ML110" -k duplicati.check -o "Problem! Unexpected event completed."
fi
fi
exit 0