-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdm.sh
More file actions
executable file
·31 lines (22 loc) · 867 Bytes
/
dm.sh
File metadata and controls
executable file
·31 lines (22 loc) · 867 Bytes
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
30
#!/bin/bash
# This script is basically a wrapper for the main python script
# It ensures to be called via the venv which was created
DMPATH=/opt/ZabbixDomainMonitor
cd $DMPATH
# uncomment following lines for debug to log file
#TS=$(date)
#WD=`pwd`
#echo "----- $TS -----" >> log/dm-bash.log
#echo "WD: $WD | DMPATH: $DMPATH" >> log/dm-bash.log
#echo "Received parameters: $1 $2 $3 $4 $5 $6" >> log/dm-bash.log
# Execute python script, handing over Parameters from Zabbix
#$DMPATH/.dmvenv/bin/python3 $DMPATH/dm.py -f "$1" -a "$2" -s "$3" -d "$4" --psk "$5" --psk-id "$6"
# Use this for enable debug logs in script
$DMPATH/.dmvenv/bin/python3 $DMPATH/dm.py -f "$1" -a "$2" -s "$3" -d "$4" --psk "$5" --psk-id "$6" -v
# Print Return result -> displayed in Zabbix Item
RET=$?
if [ $RET -ne 0 ]; then
echo "Error"
else
echo "DM executed successfully"
fi