[icinga-checkins] icinga.org: icinga2/feature/ido: livestatus: finish commentstable attributes

git at icinga.org git at icinga.org
Mon Jul 15 09:26:15 CEST 2013


Module: icinga2
Branch: feature/ido
Commit: 45db7e08a2320ee92b4e153532e3ea088195194a
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=45db7e08a2320ee92b4e153532e3ea088195194a

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Fri Jul 12 18:10:27 2013 +0200

livestatus: finish commentstable attributes

refs #4372

---

 components/livestatus/commentstable.cpp |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/components/livestatus/commentstable.cpp b/components/livestatus/commentstable.cpp
index f820de2..ec289ff 100644
--- a/components/livestatus/commentstable.cpp
+++ b/components/livestatus/commentstable.cpp
@@ -122,8 +122,12 @@ Value CommentsTable::EntryTimeAccessor(const Value& row)
 
 Value CommentsTable::TypeAccessor(const Value& row)
 {
-	/* TODO */
-	return Value();
+	Service::Ptr svc = Service::GetOwnerByCommentID(row);
+
+	if (!svc)
+		return Value();
+
+	return (svc->IsHostCheck() ? 1 : 2);
 }
 
 Value CommentsTable::IsServiceAccessor(const Value& row)
@@ -138,14 +142,14 @@ Value CommentsTable::IsServiceAccessor(const Value& row)
 
 Value CommentsTable::PersistentAccessor(const Value& row)
 {
-	/* TODO - always 1 */
+	/* always 1 */
 	return 1;
 }
 
 Value CommentsTable::SourceAccessor(const Value& row)
 {
-	/* TODO */
-	return Value();
+	/* always external */
+	return 1;
 }
 
 Value CommentsTable::EntryTypeAccessor(const Value& row)





More information about the icinga-checkins mailing list