ido: add notify_on_* to host/service config

refs #4378
This commit is contained in:
Michael Friedrich 2013-08-01 10:44:15 +02:00
parent 2ea75203ce
commit cd4ebf1bf2
3 changed files with 16 additions and 14 deletions

View File

@ -196,8 +196,11 @@ Dictionary::Ptr CompatUtility::GetServiceConfigAttributes(const Service::Ptr& se
if (notification->GetNotificationStateFilter()) if (notification->GetNotificationStateFilter())
notification_state_filter = notification->GetNotificationStateFilter(); notification_state_filter = notification->GetNotificationStateFilter();
Log(LogDebug, "compatutility", "notification_type_filter: " + Convert::ToString(notification_type_filter) + " notification_state_filter: " + Convert::ToString(notification_state_filter));
} }
if (notification_interval == -1) if (notification_interval == -1)
notification_interval = 60; notification_interval = 60;
@ -228,7 +231,7 @@ Dictionary::Ptr CompatUtility::GetServiceConfigAttributes(const Service::Ptr& se
else else
attr->Set("alias", host->GetDisplayName()); attr->Set("alias", host->GetDisplayName());
/* notification filters */ /* notification state filters */
if (notification_state_filter & (1<<StateWarning) || if (notification_state_filter & (1<<StateWarning) ||
notification_state_filter & (1<<StateCritical)) { notification_state_filter & (1<<StateCritical)) {
attr->Set("notify_on_down", 1); attr->Set("notify_on_down", 1);
@ -244,7 +247,7 @@ Dictionary::Ptr CompatUtility::GetServiceConfigAttributes(const Service::Ptr& se
custom = service->GetCustom(); custom = service->GetCustom();
macros = service->GetMacros(); macros = service->GetMacros();
/* notification filters */ /* notification state filters */
if (notification_state_filter & (1<<StateWarning)) { if (notification_state_filter & (1<<StateWarning)) {
attr->Set("notify_on_warning", 1); attr->Set("notify_on_warning", 1);
notification_options.push_back("w"); notification_options.push_back("w");
@ -306,7 +309,6 @@ Dictionary::Ptr CompatUtility::GetServiceConfigAttributes(const Service::Ptr& se
} }
/* custom attr */ /* custom attr */
/* TODO resolve all static macros */
if (custom) { if (custom) {
attr->Set("notes", custom->Get("notes")); attr->Set("notes", custom->Get("notes"));
attr->Set("notes_url", custom->Get("notes_url")); attr->Set("notes_url", custom->Get("notes_url"));

View File

@ -74,11 +74,11 @@ Dictionary::Ptr HostDbObject::GetConfigFields(void) const
fields->Set("first_notification_delay", Empty); fields->Set("first_notification_delay", Empty);
fields->Set("notification_interval", attrs->Get("notification_interval")); fields->Set("notification_interval", attrs->Get("notification_interval"));
fields->Set("notify_on_down", Empty); fields->Set("notify_on_down", attrs->Get("notify_on_down"));
fields->Set("notify_on_unreachable", Empty); fields->Set("notify_on_unreachable", attrs->Get("notify_on_unreachable"));
fields->Set("notify_on_recovery", Empty); fields->Set("notify_on_recovery", attrs->Get("notify_on_recovery"));
fields->Set("notify_on_flapping", Empty); fields->Set("notify_on_flapping", attrs->Get("notify_on_flapping"));
fields->Set("notify_on_downtime", Empty); fields->Set("notify_on_downtime", attrs->Get("notify_on_downtime"));
fields->Set("stalk_on_up", Empty); fields->Set("stalk_on_up", Empty);
fields->Set("stalk_on_down", Empty); fields->Set("stalk_on_down", Empty);

View File

@ -66,12 +66,12 @@ Dictionary::Ptr ServiceDbObject::GetConfigFields(void) const
fields->Set("max_check_attempts", attrs->Get("max_check_attempts")); fields->Set("max_check_attempts", attrs->Get("max_check_attempts"));
fields->Set("first_notification_delay", Empty); fields->Set("first_notification_delay", Empty);
fields->Set("notification_interval", attrs->Get("notification_interval")); fields->Set("notification_interval", attrs->Get("notification_interval"));
fields->Set("notify_on_warning", Empty); fields->Set("notify_on_warning", attrs->Get("notify_on_warning"));
fields->Set("notify_on_unknown", Empty); fields->Set("notify_on_unknown", attrs->Get("notify_on_unknown"));
fields->Set("notify_on_critical", Empty); fields->Set("notify_on_critical", attrs->Get("notify_on_critical"));
fields->Set("notify_on_recovery", Empty); fields->Set("notify_on_recovery", attrs->Get("notify_on_recovery"));
fields->Set("notify_on_flapping", Empty); fields->Set("notify_on_flapping", attrs->Get("notify_on_flapping"));
fields->Set("notify_on_downtime", Empty); fields->Set("notify_on_downtime", attrs->Get("notify_on_downtime"));
fields->Set("stalk_on_ok", 0); fields->Set("stalk_on_ok", 0);
fields->Set("stalk_on_warning", 0); fields->Set("stalk_on_warning", 0);
fields->Set("stalk_on_unknown", 0); fields->Set("stalk_on_unknown", 0);