From 2913291a178439ff79a321b9c81723b562e797d6 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Mon, 1 Apr 2019 09:31:03 +0200 Subject: [PATCH] ido Check: Add last failover timestamp to output when HA enabled IDO is running --- lib/db_ido/idochecktask.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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).";