test_backup - wrk version
This commit is contained in:
parent
0c5c4c4415
commit
bb0587f73e
3
test_backup/test_backup.conf
Normal file
3
test_backup/test_backup.conf
Normal file
@ -0,0 +1,3 @@
|
||||
#test log and state file
|
||||
UserParameter=test_backup[*],sudo /etc/zabbix/scripts/test_backup.sh $1
|
||||
|
||||
21
test_backup/test_backup.sh
Executable file
21
test_backup/test_backup.sh
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
case $1 in
|
||||
log)
|
||||
STATUS=$(tail -n 2 /var/log/backup.log | head -n 1 | grep $(date +%Y-%m-%d) | cut -f 3 -d " ")
|
||||
if [[ $STATUS == "SUCCESS_BACKUP" ]]
|
||||
then echo "1";
|
||||
else echo "0";
|
||||
fi
|
||||
;;
|
||||
state)
|
||||
test -f /var/tmp/backuper.state
|
||||
if [[ $? == "0" ]]
|
||||
then
|
||||
cat /var/tmp/backuper.state
|
||||
else
|
||||
echo "none"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user