shinken / nagios在警告警报和严重警报之间有区别

时间:2014-08-25 03:53:47

标签: linux monitoring nagios

我使用shinken作为我的监控系统。现在,我在配置shinken通知时遇到问题。我的目的是区分警告状态通知和检查服务的临界状态:

有警告状态:
+从8h发送警报的时间=>每天18小时,通过电子邮件和短信 + notification_interval是60分钟(每小时重新通知服务问题)

处于危急状态:
+发送提醒的时间:所有时间(24 x 7),通过电子邮件和短信
+ notification_interval是30分钟

请告诉我如何解决我的问题!

我尝试了以下内容:

我配置了:

+ contact templates:


            define contact{
                    name                            warning-contact         ; The name of this contact template
                    register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
                    host_notifications_enabled      1
                    define contact{
                service_notifications_enabled   1
                    email                           shinken@localhost
                    can_submit_commands             1
                    notificationways                email_warning, sms_warning
                    }


            define contact{
                    name                            critical-contact         ; The name of this contact template
                    register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
                    host_notifications_enabled      1
                    service_notifications_enabled   1
                    email                           shinken@localhost
                    can_submit_commands             1
                    notificationways                email_critical, sms_critical
                    }

+ time poriod templates:           
define timeperiod{
        timeperiod_name warning
        alias           Normal Work Hours
        monday          08:00-18:00
        tuesday         08:00-18:00
        wednesday       08:00-18:00
        thursday        08:00-18:00
        friday          08:00-18:00
        saturday        08:00-18:00
        sunday          08:00-18:00
        #exclude                24x7
        }

define timeperiod{
        timeperiod_name                 24x7
        alias                           24_Hours_A_Day,_7_Days_A_Week
        sunday                          00:00-24:00
        monday                          00:00-24:00
        tuesday                         00:00-24:00
        wednesday                       00:00-24:00
        thursday                        00:00-24:00
        friday                          00:00-24:00
        saturday                        00:00-24:00
        #exclude                        workhours
}


+ notification way templates:
        define notificationway{
                   notificationway_name            email_warning
                   service_notification_period     warning
                   host_notification_period        warning
                   service_notification_options    w
                   host_notification_options       d,u,r,f,s
                   notification_interval           60               ; Resend notifications every 30 minutes
                   service_notification_commands   notify-service-by-email ; send service notifications via email
                   host_notification_commands      notify-host-by-email    ; send host notifications via email
            }

                define notificationway{
                       notificationway_name            email_critical
                       service_notification_period     24x7
                       host_notification_period        24x7
                       service_notification_options    c,r
                       host_notification_options       d,u,r,f,s
                       notification_interval           30               ; Resend notifications every 30 minutes
                       service_notification_commands   notify-service-by-email ; send service notifications via email
                       host_notification_commands      notify-host-by-email    ; send host notifications via email
                }


                define notificationway{
                       notificationway_name            sms_warning
                       service_notification_period     warning
                       host_notification_period        warning
                       service_notification_options    w
                       host_notification_options       d,u,r,f,s
                       notification_interval           60               ; Resend notifications every 30 minutes
                       service_notification_commands   notify-service-by-sms ; send service notifications via sms
                       host_notification_commands      notify-host-by-sms    ; send host notifications via sms
                }

            define notificationway{
                   notificationway_name            sms_critical
                   service_notification_period     24x7
                   host_notification_period        24x7
                   service_notification_options    c,r
                   host_notification_options       d,u,r,f,s
                   notification_interval           30               ; Resend notifications every 30 minutes
                   service_notification_commands   notify-service-by-sms ; send service notifications via sms
                   host_notification_commands      notify-host-by-sms    ; send host notifications via sms
            }

+ my contacts
            define contact{
                use             warning-contact
                contact_name    thanhwarn
                email           xxxx
                pager           xxxx  ; contact phone number
            }

            define contact{
                use             critical-contact
                contact_name    thanhcritical
                email           xxxxx
                pager           01689xxxx   ; contact phone number


            }

+ and  define service:  
            define service{
                    use                             generic-service
                    service_description             check_ram
                    host_name                        graphite
                    contacts                        thanhcritical, thanhwarn
                    check_command                   check_nrpe!check_ram
    }

但是我的shinken系统没有发送警报。我不明白这一点。 请告诉我哪里出错了!谢谢大家!

0 个答案:

没有答案