简体   繁体   English

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

[英]How to configure email notifications for specific services only in nagios or icinga?

I am getting critical and warning email notifications of all services. 我收到所有服务的关键警告电子邮件通知。 I want to get the email notifications only of specific services like Disk Usage, Windows Update. 我只想获取特定服务的电子邮件通知,例如磁盘使用情况,Windows Update。

These are my services: 这些是我的服务:

define service{ 定义服务{

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

} }

define service{ 定义服务{

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

} }

define service{ 定义服务{

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

} }

define service{ 定义服务{

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

} define service{ }定义服务{

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

} }

And my contact.cfg is: 我的contact.cfg是:

define contact{ 定义联系人{

    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

} }

Any suggestion to get only critical notification from selected services? 有什么建议只从选定的服务获得关键通知吗?

Thanks. 谢谢。

See service definition . 请参阅服务定义

Just add 只需添加

notification_options    c

to the service definitions. 服务定义。

If you do not want to get any emails at all from the other services, add 如果您根本不想从其他服务获得任何电子邮件,请添加

notifications_enabled   0

to those services you don't want to get emails from. 那些您不想收到电子邮件的服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM