]> granicus.if.org Git - icinga2/commitdiff
livestatus: time values must be integer seconds
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 11 Jul 2013 08:57:21 +0000 (10:57 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 11 Jul 2013 08:57:21 +0000 (10:57 +0200)
fixes #4406

components/livestatus/commentstable.cpp
components/livestatus/downtimestable.cpp
components/livestatus/hoststable.cpp
components/livestatus/servicestable.cpp
components/livestatus/statustable.cpp

index f551d180e84df3cf7cfc62117366beba51f0a704..088f926331d07f8a507365846f38c51109028e62 100644 (file)
@@ -117,7 +117,7 @@ Value CommentsTable::EntryTimeAccessor(const Value& row)
        if (!comment)
                return Value();
 
-       return comment->Get("entry_time");
+       return static_cast<int>(comment->Get("entry_time"));
 }
 
 Value CommentsTable::TypeAccessor(const Value& row)
@@ -175,5 +175,5 @@ Value CommentsTable::ExpireTimeAccessor(const Value& row)
        if (!comment)
                return Value();
 
-       return comment->Get("expire_time");
+       return static_cast<int>(comment->Get("expire_time"));
 }
index 2222f647b5b1e8ed8d890a20e2db647d2e0f2760..880798de98efdf1c080a1814f68f339de219a690 100644 (file)
@@ -105,7 +105,7 @@ Value DowntimesTable::EntryTimeAccessor(const Value& row)
 {
        Dictionary::Ptr downtime = Service::GetDowntimeByID(row);
 
-       return downtime->Get("entry_time");
+       return static_cast<int>(downtime->Get("entry_time"));
 }
 
 Value DowntimesTable::TypeAccessor(const Value& row)
@@ -126,14 +126,14 @@ Value DowntimesTable::StartTimeAccessor(const Value& row)
 {
        Dictionary::Ptr downtime = Service::GetDowntimeByID(row);
 
-       return downtime->Get("start_time");
+       return static_cast<int>(downtime->Get("start_time"));
 }
 
 Value DowntimesTable::EndTimeAccessor(const Value& row)
 {
        Dictionary::Ptr downtime = Service::GetDowntimeByID(row);
 
-       return downtime->Get("end_time");
+       return static_cast<int>(downtime->Get("end_time"));
 }
 
 Value DowntimesTable::FixedAccessor(const Value& row)
index 0333362c5a9af1901457e26b7e15210d2212b7b7..a701924ee0a3f0f1254d5eae49eeb51dca315668 100644 (file)
@@ -509,7 +509,7 @@ Value HostsTable::NextCheckAccessor(const Value& row)
        if (!hc)
                return Value();
 
-       return hc->GetNextCheck();
+       return static_cast<int>(hc->GetNextCheck());
 }
 
 Value HostsTable::LastHardStateChangeAccessor(const Value& row)
@@ -520,7 +520,7 @@ Value HostsTable::LastHardStateChangeAccessor(const Value& row)
        if (!hc)
                return Value();
 
-       return hc->GetLastHardStateChange();
+       return static_cast<int>(hc->GetLastHardStateChange());
 }
 
 Value HostsTable::HasBeenCheckedAccessor(const Value& row)
@@ -617,12 +617,12 @@ Value HostsTable::LastCheckAccessor(const Value& row)
        if (!hc)
                return Value();
 
-       return hc->GetLastCheck();
+       return static_cast<int>(hc->GetLastCheck());
 }
 
 Value HostsTable::LastStateChangeAccessor(const Value& row)
 {
-       return static_cast<Host::Ptr>(row)->GetLastStateChange();
+       return static_cast<int>(static_cast<Host::Ptr>(row)->GetLastStateChange());
 }
 
 Value HostsTable::LastTimeUpAccessor(const Value& row)
index afafcfcecb68e1bad02efc072c682bb8131512d0..c47788e8468f75889f87554a7d3918e3d4e155d8 100644 (file)
@@ -389,12 +389,12 @@ Value ServicesTable::LastTimeUnknownAccessor(const Value& row)
 
 Value ServicesTable::LastCheckAccessor(const Value& row)
 {
-       return static_cast<Service::Ptr>(row)->GetLastCheck();
+       return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastCheck());
 }
 
 Value ServicesTable::NextCheckAccessor(const Value& row)
 {
-       return static_cast<Service::Ptr>(row)->GetNextCheck();
+       return static_cast<int>(static_cast<Service::Ptr>(row)->GetNextCheck());
 }
 
 Value ServicesTable::LastNotificationAccessor(const Value& row)
@@ -417,12 +417,12 @@ Value ServicesTable::CurrentNotificationNumberAccessor(const Value& row)
 
 Value ServicesTable::LastStateChangeAccessor(const Value& row)
 {
-       return static_cast<Service::Ptr>(row)->GetLastStateChange();
+       return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastStateChange());
 }
 
 Value ServicesTable::LastHardStateChangeAccessor(const Value& row)
 {
-       return static_cast<Service::Ptr>(row)->GetLastHardStateChange();
+       return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastHardStateChange());
 }
 
 Value ServicesTable::ScheduledDowntimeDepthAccessor(const Value& row)
index ff4dc4543793fab176b72fd004a7673ad49f1c5d..65e6dd1e669f553f8bf8fd1aa285f624e9f9e428 100644 (file)
@@ -312,7 +312,7 @@ Value StatusTable::CheckExternalCommandsAccessor(const Value& row)
 
 Value StatusTable::ProgramStartAccessor(const Value& row)
 {
-       return IcingaApplication::GetInstance()->GetStartTime();
+       return static_cast<int>(IcingaApplication::GetInstance()->GetStartTime());
 }
 
 Value StatusTable::LastCommandCheckAccessor(const Value& row)