From: Michael Friedrich Date: Tue, 16 Jul 2013 12:56:32 +0000 (+0200) Subject: livestatus: contacts table fixes (ignore special custom attr) X-Git-Tag: v0.0.3~835 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32a1f50116daffea922a643a4a9a7ac3483de924;p=icinga2 livestatus: contacts table fixes (ignore special custom attr) refs #4372 --- diff --git a/components/livestatus/contactstable.cpp b/components/livestatus/contactstable.cpp index b19ba6899..f224c42f7 100644 --- a/components/livestatus/contactstable.cpp +++ b/components/livestatus/contactstable.cpp @@ -141,7 +141,7 @@ Value ContactsTable::InHostNotificationPeriodAccessor(const Value& row) if (!timeperiod) return Empty; - return timeperiod->IsInside(Utility::GetTime()); + return (timeperiod->IsInside(Utility::GetTime()) ? 1 : 0); } Value ContactsTable::InServiceNotificationPeriodAccessor(const Value& row) @@ -151,7 +151,7 @@ Value ContactsTable::InServiceNotificationPeriodAccessor(const Value& row) if (!timeperiod) return Empty; - return timeperiod->IsInside(Utility::GetTime()); + return (timeperiod->IsInside(Utility::GetTime()) ? 1 : 0); } Value ContactsTable::CustomVariableNamesAccessor(const Value& row) @@ -167,6 +167,15 @@ Value ContactsTable::CustomVariableNamesAccessor(const Value& row) String key; Value value; BOOST_FOREACH(boost::tie(key, value), custom) { + if (key == "notes" || + key == "action_url" || + key == "notes_url" || + key == "icon_image" || + key == "icon_image_alt" || + key == "statusmap_image" || + key == "2d_coords") + continue; + cv->Add(key); } @@ -186,6 +195,15 @@ Value ContactsTable::CustomVariableValuesAccessor(const Value& row) String key; Value value; BOOST_FOREACH(boost::tie(key, value), custom) { + if (key == "notes" || + key == "action_url" || + key == "notes_url" || + key == "icon_image" || + key == "icon_image_alt" || + key == "statusmap_image" || + key == "2d_coords") + continue; + cv->Add(value); } @@ -205,6 +223,15 @@ Value ContactsTable::CustomVariablesAccessor(const Value& row) String key; Value value; BOOST_FOREACH(boost::tie(key, value), custom) { + if (key == "notes" || + key == "action_url" || + key == "notes_url" || + key == "icon_image" || + key == "icon_image_alt" || + key == "statusmap_image" || + key == "2d_coords") + continue; + Array::Ptr key_val = boost::make_shared(); key_val->Add(key); key_val->Add(value);