Oblik Backup Monitoring on Zabbix
Zabbix 2.4
1. Zabbix Template
[zabbix_template_oblik_backup.xml] FIXFILE
2. Network Host in Zabbix
Host name = oblikbackup.[HOSTNAME] Our Oblik server HOSTNAME. Ideally, it should include the domain suffix.
3. Agent
Agent on the Oblik server
/etc/zabbix/zabbix-oblikbackup-getbases.sh:
#!/bin/bash
echo '{ "data":[ '
echo '{"HEADER":"DOLL" }'
while read LINE
do
echo ',{"{#BASENAME}":"'$LINE'"}'
done < /usr/pro_backup/bases_to_archive
echo '] }'
Problem: The database list is not being generated, meaning zabbix-oblikbackup-getbases.sh runs without the expected result, I see in the log:
7920:20141105:171205 Requested [oblikbackup-getbases]
cp: cannot stat `/usr/pro_backup/bases_to_archive': Permission denied
7920:20141105:171206 Before
7920:20141105:171206 Run remote command [/etc/zabbix/zabbix-oblikbackup-getbases.sh] Result [34] [{ "data":[
{"HEADER]...
7920:20141105:171206 Sending back [{ "data":[
{"HEADER":"DOLL" }
] }]
Solution: Set execute permissions ("+x") on the directory containing zabbix-oblikbackup-getbases.sh.
4. Data Collection via Trappers
In the backup creation script /usr/pro_backup/backup_base.sh, add the following line at the end: