zoukankan      html  css  js  c++  java
  • Bacula监控设置邮件告警Message篇

    配置环境:

    CentOS-7 bacula-9.0.6

    官方参考文档:

    http://www.bacula.org/9.0.x-manuals/en/main/Messages_Resource.html
    
    邮件参数:
    %b = Job Bytes
    %c = Client's name
    %d = Daemon's name (Such as host-dir or host-fd)
    %D = Director's name (Also valid on file daemon)
    %e = Job Exit Status
    %f = Job FileSet (Only on director side)
    %F = Job Files
    %h = Client address
    %i = JobId
    %j = Unique Job id
    %l = Job Level
    %n = Job name
    %p = Pool name (Only on director side)
    %P = Current PID process
    %r = Recipients
    %s = Since time
    %t = Job type (Backup, ...)
    %v = Volume name (Only on director side)
    %w = Storage name (Only on director side)
    %x = Spooling enabled? ("yes" or "no")
    

    案例:

    官方要求安装sendmail才能正常对外发送日志邮件,我们其实只需要在原有配置上做修改,改为mail发送并添加官方的参数即可

    mailcommand = "mail -s "Bacula: %t %e of %c %l JobId: %i" 123@mail.com"
    

    日志邮件标题样式:

    Bacula: Backup OK of bacula2-fd Full JobId: 41
    

    如果只需要job出错才发告警邮件 可把mail = 修改为MailOnError =

    例如:

    mail = root@localhost = all, !skipped
    

    修改为

    MailOnError = root@localhost = all, !skipped
  • 相关阅读:
    通用Excel导入设计
    批量执行SQL文件
    ExtJS之对话框及窗口篇
    Windows Phone 7完整版模拟器
    C#迭代器
    XNA游戏开发之速度调整
    ExtJs之Panel篇
    Table锁定行列
    PB调用WebService示例(含源码)
    调用CodeSmith类库实现代码生成(含源码)
  • 原文地址:https://www.cnblogs.com/ogrecn/p/8056681.html
Copyright © 2011-2022 走看看