
我在 nagios 上設定升級時遇到問題。我收到以下錯誤:
Error: Could not expand hostgroups and/or hosts specified in host escalation (config file '/usr/local/nagios/etc/objects/escalations.cfg', starting on line 11)
Error processing object config files!
escalations.cfg 檔案如下圖所示:
define hostescalation{
host_name *
contact_groups admins
first_notification 1
last_notification 3
notification_interval 30
escalation_period 24x7
escalation_options d,u
}
define hostescalation{
host_name *
contact_groups suppliers
first_notification 4
last_notification 6
notification_interval 60
escalation_period 24x7
escalation_options d,u
}
define serviceescalation{
host_name script.myprojects
service_description HTTP
first_notification 1
last_notification 3
notification_interval 30
contact_groups admins
}
define serviceescalation{
host_name script.myprojects
service_description HTTP
first_notification 4
last_notification 6
notification_interval 60
contact_groups suppliers
}
我想要的是,使用通配符 (*) 來取得所有主機群組及其成員。這是行不通的。任何人都可以提供任何解決方案嗎?我是否缺少任何定義?
謝謝!
答案1
目前尚不清楚是否可以在此物件定義中使用通配符。但假設你能,請確保您擁有use_regexp_matching=0
這個 Nagios 文件:
http://nagios.sourceforge.net/docs/3_0/configmain.html#use_regexp_matching