From: Michael Friedrich Date: Mon, 1 Apr 2019 07:31:03 +0000 (+0200) Subject: ido Check: Add last failover timestamp to output when HA enabled IDO is running X-Git-Tag: v2.11.0-rc1~178^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2913291a178439ff79a321b9c81723b562e797d6;p=icinga2 ido Check: Add last failover timestamp to output when HA enabled IDO is running --- diff --git a/lib/db_ido/idochecktask.cpp b/lib/db_ido/idochecktask.cpp index 33d20657e..8a9536dc3 100644 --- a/lib/db_ido/idochecktask.cpp +++ b/lib/db_ido/idochecktask.cpp @@ -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).";