Integration with DIR Messages Resource
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
script call is added as a new Mail message destination. In a fairly default installation, this could beMessages { Name = "Standard" MailCommand = "/opt/bacula/bin/bsmtp -h <hidden> -f \"(Bacula) <%r>\" -s \"Bacula: %t %e of %n %l\" %r" OperatorCommand = "/opt/bacula/bin/bsmtp -h <hidden> -f \"(Bacula) <%r>\" -s \"Bacula: Intervention needed for %j\" %r" Mail = "admin" = All,!Debug,!Saved,!Skipped MailCommand = "/opt/bacula/scripts/bsnmp -c /opt/bacula/etc/bsnmp.conf" Mail = snmp-dummy = All,!Debug,!Saved,!Skipped Append = "/opt/bacula/log/bacula.log" = All,!Debug,!Saved,!Skipped Console = All,!Debug,!Saved,!Skipped Operator = "admin" = Mount Catalog = All,Events,!Debug,!Saved }
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,
MailCommand
andMail
lines are added after the existing mail related entries.The actual address used with the
bsnmp
script 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,
reload
command.Run a Job. After finishing, an SNMP INFORM should be delivered. When testing with
snmptrapd
(see above), information likeJul 17 23:06:58 bsys-docdev snmptrapd[23559]: 2022-07-17 23:06:58 gnom.os.its-lehmann.de [UDP: [192.168.0.55]:45198->[192.168.0.44]:162]: DISMAN-EXPRESSION-MIB::sysUpTimeInstance = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::snmpTrapOID.0 = OID: ITS-Bacula-MIB::baculaNotifyJob ITS-Bacula-MIB::baculaJobName = STRING: moria-home ITS-Bacula-MIB::baculaJobResult = INTEGER: ok(0)
should be logged.
See also
Go back to:
Go back to the Bacula Simple Network Management Protocol (bsnmp) chapter.
Go back to the Jobs Monitoring chapter.
Go back to the main Bacula Enterprise Management page.