]> granicus.if.org Git - icinga2/commitdiff
Drop CompatUtility::GetCheckableHasBeenChecked() and use Checkable::HasBeenChecked()
authorMichael Friedrich <michael.friedrich@icinga.com>
Tue, 5 Dec 2017 13:23:15 +0000 (14:23 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 15 Jan 2018 12:39:34 +0000 (13:39 +0100)
lib/compat/statusdatawriter.cpp
lib/db_ido/hostdbobject.cpp
lib/db_ido/servicedbobject.cpp
lib/icinga/compatutility.cpp
lib/icinga/compatutility.hpp
lib/livestatus/hoststable.cpp
lib/livestatus/servicestable.cpp

index fb1ac54633d9a9fcb960a26de2a6f9679e5cbbd5..eae647e4142a34d52951a28fde9652797aa77c91 100644 (file)
@@ -338,7 +338,7 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl
                "\t" "check_period=" << CompatUtility::GetCheckableCheckPeriod(checkable) << "\n"
                "\t" "check_interval=" << CompatUtility::GetCheckableCheckInterval(checkable) << "\n"
                "\t" "retry_interval=" << CompatUtility::GetCheckableRetryInterval(checkable) << "\n"
-               "\t" "has_been_checked=" << CompatUtility::GetCheckableHasBeenChecked(checkable) << "\n"
+               "\t" "has_been_checked=" << (checkable->HasBeenChecked() ? 1 : 0) << "\n"
                "\t" "should_be_scheduled=" << checkable->GetEnableActiveChecks() << "\n"
                "\t" "event_handler_enabled=" << CompatUtility::GetCheckableEventHandlerEnabled(checkable) << "\n";
 
index d7bf870d222636fd4961b6b5d678dde56c2cf67e..7749b275a36a7d4d47f5a667b1b7d625592eedfe 100644 (file)
@@ -132,7 +132,7 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
        }
 
        fields->Set("current_state", CompatUtility::GetHostCurrentState(host));
-       fields->Set("has_been_checked", CompatUtility::GetCheckableHasBeenChecked(host));
+       fields->Set("has_been_checked", host->HasBeenChecked());
        fields->Set("should_be_scheduled", host->GetEnableActiveChecks());
        fields->Set("current_check_attempt", host->GetCheckAttempt());
        fields->Set("max_check_attempts", host->GetMaxCheckAttempts());
index 74663ce6258a6b95d7716d24a1a1b454ecb685b2..eff6b71a84e66de678e5cbcf73236da348d74d9a 100644 (file)
@@ -119,7 +119,7 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
        }
 
        fields->Set("current_state", service->GetState());
-       fields->Set("has_been_checked", CompatUtility::GetCheckableHasBeenChecked(service));
+       fields->Set("has_been_checked", service->HasBeenChecked());
        fields->Set("should_be_scheduled", service->GetEnableActiveChecks());
        fields->Set("current_check_attempt", service->GetCheckAttempt());
        fields->Set("max_check_attempts", service->GetMaxCheckAttempts());
index 2d1531e8f1568a4f2a0892d95f353698ba87706b..3b5d8c756ccf5623407bc0e05a69fb6e54f05983 100644 (file)
@@ -202,11 +202,6 @@ String CompatUtility::GetCheckableCheckPeriod(const Checkable::Ptr& checkable)
                return "24x7";
 }
 
-int CompatUtility::GetCheckableHasBeenChecked(const Checkable::Ptr& checkable)
-{
-       return (checkable->GetLastCheckResult() ? 1 : 0);
-}
-
 int CompatUtility::GetCheckablePassiveChecksEnabled(const Checkable::Ptr& checkable)
 {
        return (checkable->GetEnablePassiveChecks() ? 1 : 0);
index 1daeefcf6088b5b079340ebd06af5b6d7e18d7fd..e5a9a89e1ee8d6f53c873e824c89f86fa5c3a137 100644 (file)
@@ -54,7 +54,6 @@ public:
        static double GetCheckableCheckInterval(const Checkable::Ptr& checkable);
        static double GetCheckableRetryInterval(const Checkable::Ptr& checkable);
        static String GetCheckableCheckPeriod(const Checkable::Ptr& checkable);
-       static int GetCheckableHasBeenChecked(const Checkable::Ptr& checkable);
        static int GetCheckablePassiveChecksEnabled(const Checkable::Ptr& checkable);
        static int GetCheckableActiveChecksEnabled(const Checkable::Ptr& checkable);
        static int GetCheckableEventHandlerEnabled(const Checkable::Ptr& checkable);
index 6d79a8c87ac56d86acd2815b12d99c4f115fdf70..49dd9fac6b8ad713f23befb82ffdcc0593f05a91 100644 (file)
@@ -602,7 +602,7 @@ Value HostsTable::HasBeenCheckedAccessor(const Value& row)
        if (!host)
                return Empty;
 
-       return CompatUtility::GetCheckableHasBeenChecked(host);
+       return Convert::ToLong(host->HasBeenChecked());
 }
 
 Value HostsTable::CurrentNotificationNumberAccessor(const Value& row)
index d9a303b4b14528306f7952215d413b01f530a055..072535ca9fec81b24f6d4f2575eec0af72a6da1a 100644 (file)
@@ -509,7 +509,7 @@ Value ServicesTable::HasBeenCheckedAccessor(const Value& row)
        if (!service)
                return Empty;
 
-       return CompatUtility::GetCheckableHasBeenChecked(service);
+       return Convert::ToLong(service->HasBeenChecked());
 }
 
 Value ServicesTable::LastStateAccessor(const Value& row)