shinken/nagios discriminative between warning alert and critical alert
Posted
by
SWdream
on Server Fault
See other posts from Server Fault
or by SWdream
Published on 2014-08-25T03:43:17Z
Indexed on
2014/08/25
4:22 UTC
Read the original article
Hit count: 273
i using shinken for my monitoring system. Now, i have a problem when i configure shinken notification. My purpose is to discriminative between notification for warning state and critical state of check service:
with warning state:
+ time to send alert from 8h => 18 h everyday, via email and sms
+ notification_interval is 60 minutes (Re-notify about service problems every hour)
with critical state:
+ time to send alert : all time (24 x 7), via email and sms
+ notification_interval is 30 minutes
Please show me how to solve my problem!
I have tried the following:
i configured:
+ 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
}
but my shinken system don't send alert. i don't understand this. please show me where I went wrong! thanks all!
© Server Fault or respective owner