]> granicus.if.org Git - icinga2/commitdiff
livestatus: add last_time_* to host and service table
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 18 Jul 2013 16:17:25 +0000 (18:17 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 18 Jul 2013 16:17:25 +0000 (18:17 +0200)
refs #4372

components/livestatus/hoststable.cpp
components/livestatus/servicestable.cpp

index 819802d67f27b2408b319fcc42b93e41c2f9c001..4a9de43935e21539bb07aef3a1aaf92d0d22c1f2 100644 (file)
@@ -800,20 +800,17 @@ Value HostsTable::LastStateChangeAccessor(const Value& row)
 
 Value HostsTable::LastTimeUpAccessor(const Value& row)
 {
-       /* TODO */
-       return Empty;
+       return static_cast<int>(static_cast<Host::Ptr>(row)->GetLastStateUp());
 }
 
 Value HostsTable::LastTimeDownAccessor(const Value& row)
 {
-       /* TODO */
-       return Empty;
+       return static_cast<int>(static_cast<Host::Ptr>(row)->GetLastStateDown());
 }
 
 Value HostsTable::LastTimeUnreachableAccessor(const Value& row)
 {
-       /* TODO */
-       return Empty;
+       return static_cast<int>(static_cast<Host::Ptr>(row)->GetLastStateUnreachable());
 }
 
 Value HostsTable::IsFlappingAccessor(const Value& row)
index b914ad4e340d02ddf8abadbef15ca51faf553b62..e99f4ab5869dafb7fb10ce6f16b0e80ba256fbda 100644 (file)
@@ -481,26 +481,22 @@ Value ServicesTable::NoMoreNotificationsAccessor(const Value& row)
 
 Value ServicesTable::LastTimeOkAccessor(const Value& row)
 {
-       /* TODO */
-       return Empty;
+       return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastStateOK());
 }
 
 Value ServicesTable::LastTimeWarningAccessor(const Value& row)
 {
-       /* TODO */
-       return Empty;
+       return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastStateWarning());
 }
 
 Value ServicesTable::LastTimeCriticalAccessor(const Value& row)
 {
-       /* TODO */
-       return Empty;
+       return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastStateCritical());
 }
 
 Value ServicesTable::LastTimeUnknownAccessor(const Value& row)
 {
-       /* TODO */
-       return Empty;
+       return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastStateUnknown());
 }
 
 Value ServicesTable::LastCheckAccessor(const Value& row)