*/
object Host "localhost" {
services["ping4"] = { templates = [ "ping4" ] },
- services["ping4"] = { templates = [ "ping4" ] },
+ services["ping6"] = { templates = [ "ping6" ] },
services["http"] = { templates = [ "http_ip" ] },
services["ssh"] = { templates = [ "ssh" ] },
services["load"] = { templates = [ "load" ] },
keys.insert("servicegroups");
keys.insert("checkers");
keys.insert("notification_interval");
+ keys.insert("notification_type_filter");
+ keys.insert("notification_state_filter");
keys.insert("check_period");
keys.insert("servicedependencies");
keys.insert("hostdependencies");
%attribute number "begin",
%attribute number "end",
},
+
+ %attribute number "notification_type_filter",
+ %attribute number "notification_state_filter"
}
},
}
%attribute number "begin",
%attribute number "end",
},
+
+ %attribute number "notification_type_filter",
+ %attribute number "notification_state_filter"
}
},
%attribute number "notification_interval",
%attribute name(TimePeriod) "notification_period",
+ %attribute number "notification_type_filter",
+ %attribute number "notification_state_filter"
+
%attribute dictionary "macros" {
%attribute string "*"
},
%attribute number "end",
},
- %attribute number "type_filter",
- %attribute number "state_filter"
+ %attribute number "notification_type_filter",
+ %attribute number "notification_state_filter"
}
}
}
%attribute number "notification_interval",
%attribute name(TimePeriod) "notification_period",
- %attribute number "type_filter",
- %attribute number "state_filter"
+ %attribute number "notification_type_filter",
+ %attribute number "notification_state_filter"
}
type User {
%attribute name(UserGroup) "*"
},
- %attribute number "type_filter",
- %attribute number "state_filter"
+ %attribute number "notification_type_filter",
+ %attribute number "notification_state_filter"
}
RegisterAttribute("users", Attribute_Config, &m_Users);
RegisterAttribute("groups", Attribute_Config, &m_Groups);
RegisterAttribute("times", Attribute_Config, &m_Times);
- RegisterAttribute("type_filter", Attribute_Config, &m_TypeFilter);
- RegisterAttribute("state_filter", Attribute_Config, &m_StateFilter);
+ RegisterAttribute("notification_type_filter", Attribute_Config, &m_NotificationTypeFilter);
+ RegisterAttribute("notification_state_filter", Attribute_Config, &m_NotificationStateFilter);
RegisterAttribute("host_name", Attribute_Config, &m_HostName);
RegisterAttribute("service", Attribute_Config, &m_Service);
RegisterAttribute("export_macros", Attribute_Config, &m_ExportMacros);
return m_Times;
}
-unsigned long Notification::GetTypeFilter(void) const
+unsigned long Notification::GetNotificationTypeFilter(void) const
{
- if (m_TypeFilter.IsEmpty())
+ if (m_NotificationTypeFilter.IsEmpty())
return ~(unsigned long)0; /* All states. */
else
- return m_TypeFilter;
+ return m_NotificationTypeFilter;
}
-unsigned long Notification::GetStateFilter(void) const
+unsigned long Notification::GetNotificationStateFilter(void) const
{
- if (m_StateFilter.IsEmpty())
+ if (m_NotificationStateFilter.IsEmpty())
return ~(unsigned long)0; /* All states. */
else
- return m_StateFilter;
+ return m_NotificationStateFilter;
}
double Notification::GetNotificationInterval(void) const
unsigned long ftype = 1 << type;
- Log(LogDebug, "icinga", "FType=" + Convert::ToString(ftype) + ", TypeFilter=" + Convert::ToString(GetTypeFilter()));
+ Log(LogDebug, "icinga", "FType=" + Convert::ToString(ftype) + ", TypeFilter=" + Convert::ToString(GetNotificationTypeFilter()));
- if (!(ftype & GetTypeFilter())) {
+ if (!(ftype & GetNotificationTypeFilter())) {
Log(LogInformation, "icinga", "Not sending notifications for notification object '" + GetName() + "': type filter does not match");
return;
}
unsigned long fstate = 1 << GetService()->GetState();
- Log(LogDebug, "icinga", "FState=" + Convert::ToString(fstate) + ", StateFilter=" + Convert::ToString(GetStateFilter()));
-
- if (!(fstate & GetStateFilter())) {
+ if (!(fstate & GetNotificationStateFilter())) {
Log(LogInformation, "icinga", "Not sending notifications for notification object '" + GetName() + "': state filter does not match");
return;
}
unsigned long ftype = 1 << type;
- if (!(ftype & user->GetTypeFilter())) {
+ if (!(ftype & user->GetNotificationTypeFilter())) {
Log(LogInformation, "icinga", "Not sending notifications for notification object '" +
GetName() + " and user '" + user->GetName() + "': type filter does not match");
return;
unsigned long fstate = 1 << GetService()->GetState();
- if (!(fstate & user->GetStateFilter())) {
+ if (!(fstate & user->GetNotificationStateFilter())) {
Log(LogInformation, "icinga", "Not sending notifications for notification object '" +
GetName() + " and user '" + user->GetName() + "': state filter does not match");
return;
std::set<User::Ptr> GetUsers(void) const;
std::set<UserGroup::Ptr> GetGroups(void) const;
Dictionary::Ptr GetTimes(void) const;
- unsigned long GetTypeFilter(void) const;
- unsigned long GetStateFilter(void) const;
+ unsigned long GetNotificationTypeFilter(void) const;
+ unsigned long GetNotificationStateFilter(void) const;
double GetLastNotification(void) const;
void SetLastNotification(double time);
Attribute<Array::Ptr> m_Users;
Attribute<Array::Ptr> m_Groups;
Attribute<Dictionary::Ptr> m_Times;
- Attribute<long> m_TypeFilter;
- Attribute<long> m_StateFilter;
+ Attribute<long> m_NotificationTypeFilter;
+ Attribute<long> m_NotificationStateFilter;
Attribute<String> m_HostName;
Attribute<String> m_Service;
keys.insert("groups");
keys.insert("notification_interval");
keys.insert("notification_period");
+ keys.insert("notification_type_filter");
+ keys.insert("notification_state_filter");
keys.insert("export_macros");
ExpressionList::Ptr svc_exprl = boost::make_shared<ExpressionList>();
RegisterAttribute("macros", Attribute_Config, &m_Macros);
RegisterAttribute("groups", Attribute_Config, &m_Groups);
RegisterAttribute("notification_period", Attribute_Config, &m_NotificationPeriod);
- RegisterAttribute("type_filter", Attribute_Config, &m_TypeFilter);
- RegisterAttribute("state_filter", Attribute_Config, &m_StateFilter);
+ RegisterAttribute("notification_type_filter", Attribute_Config, &m_NotificationTypeFilter);
+ RegisterAttribute("notification_state_filter", Attribute_Config, &m_NotificationStateFilter);
}
User::~User(void)
return TimePeriod::GetByName(m_NotificationPeriod);
}
-unsigned long User::GetTypeFilter(void) const
+unsigned long User::GetNotificationTypeFilter(void) const
{
- if (m_TypeFilter.IsEmpty())
+ if (m_NotificationTypeFilter.IsEmpty())
return ~(unsigned long)0; /* All states. */
else
- return m_TypeFilter;
+ return m_NotificationTypeFilter;
}
-unsigned long User::GetStateFilter(void) const
+unsigned long User::GetNotificationStateFilter(void) const
{
- if (m_StateFilter.IsEmpty())
+ if (m_NotificationStateFilter.IsEmpty())
return ~(unsigned long)0; /* All states. */
else
- return m_StateFilter;
+ return m_NotificationStateFilter;
}
bool User::ResolveMacro(const String& macro, const Dictionary::Ptr& cr, String *result) const
String GetDisplayName(void) const;
Array::Ptr GetGroups(void) const;
TimePeriod::Ptr GetNotificationPeriod(void) const;
- unsigned long GetTypeFilter(void) const;
- unsigned long GetStateFilter(void) const;
+ unsigned long GetNotificationTypeFilter(void) const;
+ unsigned long GetNotificationStateFilter(void) const;
Dictionary::Ptr GetMacros(void) const;
Attribute<Dictionary::Ptr> m_Macros;
Attribute<String> m_NotificationPeriod;
Attribute<Array::Ptr> m_Groups;
- Attribute<long> m_TypeFilter;
- Attribute<long> m_StateFilter;
+ Attribute<long> m_NotificationTypeFilter;
+ Attribute<long> m_NotificationStateFilter;
};
}