icinga2对特定服务设置专门发邮件策略
2017-08-28 16:02
302 查看
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
# 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
相关文章推荐
- WSUS服务设置中组策略刷新时间,手动刷新方法,客户端检测频率,手动检测方法
- iis6应用程序池被自动禁用问题 Service Unavailable 应用程序池 'DefaultAppPool' 被自动禁用,原因是为此应用程序池提供服务的进程中出现一系列错误。应用程序-特定 权限设置未将 COM 服务器应用程序(CLSID 为
- 配置组策略以设置系统服务安全
- windows server 2008 R2 NPS(网络连接策略服务)设置radius,实现telent登陆交换机路由器权限分配
- Solaris下Oracle服务开机自启设置和一些安全策略
- 配置组策略以设置系统服务安全
- Windows 无法设置xxx的密码,原因是:工作站服务没有启动 或 密码不满足密码策略的要求
- WSUS服务设置中组策略刷新时间,手动刷新方法,客户端检测频率,手动检测方法
- tomcat安装为服务service.bat设置,启动服务时出错,提示“...特定代码0”
- 设置Office 365移动设备管理MDM服务——创建设备安全策略
- Windows 无法设置xxx的密码,原因是:工作站服务没有启动 或 密码不满足密码策略的要求
- Windows 无法设置xxx的密码,原因是:工作站服务没有启动 或 密码不满足密码策略的要求
- CentOS下添加程序到服务并且设置服务自动启动
- RMAN正确地删除Archivelog以及设置有备库的归档删除策略
- http://xx.xxx.xxx.xx:8080/把路径设置成http服务访问的形式
- Linux下设置Apache支持Https服务
- Python针对特定服务定制的代理工具V2.0------(zipdeal.py)
- Linux时间设置与NTP服务配置
- WCF跨域 这可能是由于试图以跨域方式访问服务而又没有正确的跨域策略,或策略不适用于 SOAP
- 查看文件服务器修改写删除文件的记录设置方法------通过设置文件夹审核策略