]> granicus.if.org Git - icinga2/commitdiff
livestatus: contacts table fixes (ignore special custom attr)
authorMichael Friedrich <michael.friedrich@netways.de>
Tue, 16 Jul 2013 12:56:32 +0000 (14:56 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Tue, 16 Jul 2013 12:56:32 +0000 (14:56 +0200)
refs #4372

components/livestatus/contactstable.cpp

index b19ba6899680b3b87563bb10136d7a3a69e4a9d1..f224c42f766c5dbc9ba7fcdb10e9e39f5ed2d4fe 100644 (file)
@@ -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<Array>();
                key_val->Add(key);
                key_val->Add(value);