[英]Icinga2: Re-notification interval per service basis
默認的重新通知間隔是30m,可以通過Notification對象進行更改。 但這會影響所有服務。
我想將關鍵服務的重新通知間隔設置為5m,並為低優先級禁用重新通知,其余服務的默認間隔為30m。
在這里找到了類似的討論,但還沒有解決方案: https : //www.reddit.com/r/icinga/comments/73uc8s/setting_notification_interval_icingaweb2/
找到了一個間接方法來實現此目的,方法是使用Service對象下定義的自定義變量,並通過Notification對象訪問它們。
下面是一個示例配置:
apply Service "service1" {
# service conf goes here
vars.notification.interval = 5m
}
apply Service "service2" {
# service conf goes here
vars.notification.interval = 2h
}
apply Service "service3" {
# service conf goes here
vars.notification.interval = 0
}
apply Service "service4" {
# service conf goes here
}
apply Notification "notifications1" to Service {
# notification conf goes here
interval = (service.vars.notification.interval) || 20m
}
在上面的示例中,重新通知間隔如下:
service1: 5 minutes
service2: 2 hours
service3: Notify once, no re-notificaiton
service4: 20 minutes (System default is 30m, here we modified the default to 20 minutes)
說明:
interval = (service.vars.notification.interval) || 20m
可變interval
的值將設置為service.vars.notification.interval
如果存在),否則設置為20m
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.