]> granicus.if.org Git - icinga2/commitdiff
ido Check: Add last failover timestamp to output when HA enabled IDO is running
authorMichael Friedrich <michael.friedrich@icinga.com>
Mon, 1 Apr 2019 07:31:03 +0000 (09:31 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 1 Apr 2019 07:31:03 +0000 (09:31 +0200)
lib/db_ido/idochecktask.cpp

index 33d20657e771ceaf79329bd735087630b9c08f19..8a9536dc3a8bea90950c61457bbb50dceae387cf 100644 (file)
@@ -139,6 +139,12 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
                cr->SetState(ServiceOK);
        }
 
+       if (conn->GetEnableHa()) {
+               double failoverTs = conn->GetLastFailover();
+
+               msgbuf << " Last failover: " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", failoverTs) << ".";
+       }
+
        /* Check whether the thresholds have been defined and match. */
        if (missingQueriesCritical.IsEmpty() && qps < queriesCritical) {
                msgbuf << " " << qps << " queries/s lower than critical threshold (" << queriesCritical << " queries/s).";