icinga2对特定服务设置专门发邮件策略
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了icinga2对特定服务设置专门发邮件策略相关的知识,希望对你有一定的参考价值。
icinga2对特定服务设置专门发邮件策略(如mysql、web等):
# vi /etc/icinga2/conf.d/timeperiods.conf (也可以新建个TimePeriod)
object TimePeriod "9to5" {
import "legacy-timeperiod"
display_name = "Icinga 2 9to5 TimePeriod"
ranges = {
"monday" = "08:00-20:00"
"tuesday" = "08:00-20:00"
"wednesday" = "08:00-20:00"
"thursday" = "08:00-20:00"
"friday" = "08:00-20:00"
}
}
:wq
# vi /etc/icinga2/conf.d/services.conf
apply Service "check_hudson" {
import "generic-service"
check_command = "check-http"
vars.url="http://$address$:8080/jenkins"
vars.port="8080"
vars.perf = true
assign where host.vars.os == "hudson"
}
apply Notification "mail" to Service {
import "mail-service-notification-2"
command = "mail-service-notification"
users = [ "webicinga" ]
assign where service.name == "check_hudson"
}
:wq
# service icinga2 restart
本文出自 “linux” 博客,请务必保留此出处http://yangzhiming.blog.51cto.com/4849999/1960088
以上是关于icinga2对特定服务设置专门发邮件策略的主要内容,如果未能解决你的问题,请参考以下文章
增值税发票开票软件(税务UKey版) 发邮件提示连接邮件服务器失败