Hi all
I use bacula to back up and verify lots of servers. After I had found zabbix to monitor these, I now was tired of checking all those silly "Backup OK ..." mails every day. Moreover, I needed a simple way to monitor the size of each server's backup.
So I made bacula work with zabbix using a self-made perl script. I use bacula 2.0.3, but the procedure should work with other versions as well; perhaps the text strings in the script need some adjustment. Here is my cookbook contribution:
1) On your server hosting the bacula director, create a perl script /etc/zabbix/bin/custom_bacula (see attachment, remove .txt extension), chmod 0755
(sorry, this is my first perl script: not very elegant, but it works for me. Improvements are welcome!)
2) in /etc/bacula/bacula-dir.conf, replace the mailcommand line by:
mailcommand = "/etc/zabbix/bin/custom.bacula %r %c"
and modify the mail line as follows (of course, replace my.zabbixserver.fqdn by your server's dns name):
mail = my.zabbixserver.fqdn = all, !skipped
...this way, the bacula result messages go through the zabbix_sender process instead of being mailed through bsmtp.
3) create zabbix trapper items with the names given in the custom.bacula script, e.g.
bacula.backup.result
bacula.fd.fileswritten (Units: Bytes)
bacula.fd.byteswritten (Units: Bytes)
(etc.)
4) ensure that the FD names in the bacula-dir.conf file correspond to the hostnames used in zabbix.
5) Enjoy! Add triggers for bacula.backup.result >1 or bacula.verify.result >0 to report errors; add thresholds to monitor backup size etc. etc.
Regards
--Marcel
I use bacula to back up and verify lots of servers. After I had found zabbix to monitor these, I now was tired of checking all those silly "Backup OK ..." mails every day. Moreover, I needed a simple way to monitor the size of each server's backup.
So I made bacula work with zabbix using a self-made perl script. I use bacula 2.0.3, but the procedure should work with other versions as well; perhaps the text strings in the script need some adjustment. Here is my cookbook contribution:
1) On your server hosting the bacula director, create a perl script /etc/zabbix/bin/custom_bacula (see attachment, remove .txt extension), chmod 0755
(sorry, this is my first perl script: not very elegant, but it works for me. Improvements are welcome!)
2) in /etc/bacula/bacula-dir.conf, replace the mailcommand line by:
mailcommand = "/etc/zabbix/bin/custom.bacula %r %c"
and modify the mail line as follows (of course, replace my.zabbixserver.fqdn by your server's dns name):
mail = my.zabbixserver.fqdn = all, !skipped
...this way, the bacula result messages go through the zabbix_sender process instead of being mailed through bsmtp.
3) create zabbix trapper items with the names given in the custom.bacula script, e.g.
bacula.backup.result
bacula.fd.fileswritten (Units: Bytes)
bacula.fd.byteswritten (Units: Bytes)
(etc.)
4) ensure that the FD names in the bacula-dir.conf file correspond to the hostnames used in zabbix.
5) Enjoy! Add triggers for bacula.backup.result >1 or bacula.verify.result >0 to report errors; add thresholds to monitor backup size etc. etc.
Regards
--Marcel

Comment