Integration with DIR Messages Resource
EnterpriseBacula Enterprise Only
This solution is only available for Bacula Enterprise. For subscription inquiries, please reach out to sales@baculasystems.com.
Identify the configuration that defines the Messages for the Jobs that should trigger SNMP INFORMs to be sent.
Modify the Messages Resuource so that the
bsnmp.pyscript call is added as a new Mail message destination. In a fairly default installation, this could beMessages { Name = "Default" MailCommand = "/opt/bacula/bin/bsmtp -h localhost -f \"(Bacula) <%r>\" -s \"Bacula: %t %e of %c %l\" %r" OperatorCommand = "/opt/bacula/bin/bsmtp -h localhost -f \"(Bacula) <%r>\" -s \"Bacula: Intervention needed for %j\" %r" Mail = "root@localhost" = All,!Skipped MailCommand = "/opt/bacula/scripts/bsnmp.py -c /opt/bacula/etc/bsnmp.conf" Mail = snmp-dummy = All,!Debug,!Saved,!Skipped Append = "/opt/bacula/log/bacula.log" = All,!Skipped Console = All,!Skipped Operator = "root@localhost" = Mount Catalog = All,Events }The key points to observe are
The original Mail sending can be left as is, but all the entries for the new delivery method must follow the existing ones. So,
MailCommandandMaillines are added after the existing mail related entries.The actual address used with the
bsnmpscript is ignored, but needs to be provided per syntax definition. Put whatever you like.The actual message types used are not critical, but make sure that final Job reports get delivered. File lists, debug output, events and any other message types are, currently, ignored.
Verify configuration syntax as usual (
bacula-dir -t)Reload configuration. In bconsole,
reloadcommand.Run a Job. After finishing, an SNMP INFORM should be delivered. When testing with
snmptrapd(see above), information like2025-06-18 11:31:28 bacula-dir.supportlab.lan [UDP: [10.0.98.116]:38413->[10.0.99.40]:162]: DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.21267.8.1.0.1 SNMPv2-SMI::enterprises.21267.8.1.1.1 = STRING: "LinuxHome" SNMPv2-SMI::enterprises.21267.8.1.1.2 = INTEGER: 0
should be logged.
See also
Previous articles:
Next articles:
Go back to: Bacula Simple Network Management Protocol (bsnmp).