define contact{
contact_name guicj ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email 18251100000@139.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
pager 18251100000;cellphone number
}
四、修改用户模板,使之默认调用新增命令。
vim templates.cfg
define contact{
name generic-contact ; The name of this contact template
service_notification_period 24x7 ; service notifications can be sent anytime
host_notification_period 24x7 ; host notifications can be sent anytime
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
service_notification_commands notify-service-by-email,notify-service-by-sms ; send service notifications via email
host_notification_commands notify-host-by-email,notify-host-by-sms ; send host notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}
五、重启nagios,进行测试。