如何仅在 nagios 或 icinga 中为特定服务配置电子邮件通知



我收到所有服务的严重和警告电子邮件通知。我只想接收特定服务(如磁盘使用情况,Windows更新)的电子邮件通知。

这些是我的服务:

定义服务{

    hostgroup                       windows
    use                             generic-service         ; Name of service template to use
    service_description             CPU Load
    check_command                   check_windows_cpu!60,90,95

}

定义服务{

    hostgroup                       windows
    use                             generic-service         ; Name of service template to use
    service_description             Memory Usage
    check_command                   check_windows!MEMUSE

}

定义服务{

    hostgroup                       windows
    use                             generic-service         ; Name of service template to use
    service_description             C: Disk Space
    check_command                   check_windows_disk

}

定义服务{

    hostgroup                       windows
    use                             generic-service         ; Name of service template to use
    service_description             Windows Essential Updates
    check_command                   check_win_essential_updates

}定义服务{

    hostgroup                       windows
    use                             generic-service         ; Name of service template to use
    service_description             Windows Updates
    check_command                   check_available_updates

}

我的联系方式.cfg是:

定义联系人{

    contact_name                    root
    alias                           Root
    service_notification_period     24x7
    host_notification_period        24x7
    service_notification_options    c
    host_notification_options       d,r
    service_notification_commands   notify-service-by-email
    host_notification_commands      notify-host-by-email
    email                           sysadmin@example.com

}

有什么建议只从选定的服务中获取关键通知吗?

谢谢。

请参阅服务定义。

只需添加

notification_options    c

到服务定义。

如果您根本不想从其他服务收到任何电子邮件,请添加

notifications_enabled   0

到那些您不想从中接收电子邮件的服务。

最新更新