germanodlf / bacula-zabbix

Script and template to monitor backup jobs from Bacula in Zabbix.
Other
28 stars 32 forks source link

Zabbix monitoring of Bacula's backup jobs and its processes

This project is mainly composed by a bash script and a Zabbix template. The bash script reads values from Bacula Catalog and sends it to Zabbix Server. While the Zabbix template has items and other configurations that receive this values, start alerts and generate graphs and screens. This material was created using Bacula at 7.0.5 version and Zabbix at 2.4.5 version in a GNU/Linux CentOS 7 operational system.

Abilities

Features

Data collected by script and sent to Zabbix
Zabbix template configuration

Link this Zabbix template to each host that has a Bacula's backup job implemented. Each host configured in Zabbix with this template linked needs to have its name equals to the name configured in Bacula's Client resource. Otherwise the data collected by the bash script will not be received by Zabbix server.

Requirements

Installation

  1. Create the configuration file /etc/bacula/bacula-zabbix.conf as the sample in this repository, customize it for your infrastructure environment, and set the permissions as below:

    chown root:bacula /etc/bacula/bacula-zabbix.conf
    chmod 640 /etc/bacula/bacula-zabbix.conf
  2. Create the bash script file /var/spool/bacula/bacula-zabbix.bash by copying it from this repository and set the permissions as below:

    chown bacula:bacula /var/spool/bacula/bacula-zabbix.bash
    chmod 700 /var/spool/bacula/bacula-zabbix.bash
  3. Edit the Bacula Director configuration file /etc/bacula/bacula-dir.conf to start the script at the finish of each job. To do this you need to change the lines described below in the Messages resource that is used by all the configured jobs:

    Messages {
    ...
    mailcommand = "/var/spool/bacula/bacula-zabbix.bash %i"
    mail = 127.0.0.1 = all, !skipped
    ...
    }
  4. Now restart the Bacula Director service. In my case I used this command:

    systemctl restart bacula-dir
  5. Make a copy of the Zabbix template from this repository and import it to your Zabbix server.

  6. Edit your hosts that have configured backup jobs to use this template. Don't forget to edit the variables with the Bacula's processes names, and to disable in hosts that are only Bacula's clients the items that check the Bacula Director and Storage processes.

References

Feedback

Feel free to send bug reports and feature requests here:

If you are using this solution in production, please write me about it. It's very important for me to know that my work is not meaningless.