DB IDO: Enhance ido check with schema info

fixes #11968
This commit is contained in:
Michael Friedrich 2016-06-17 12:43:05 +02:00
parent 6a46706668
commit f4241ba185
1 changed files with 7 additions and 4 deletions

View File

@ -111,16 +111,19 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
}
} else {
String schema_version = conn->GetSchemaVersion();
std::ostringstream msgbuf;
if (Utility::CompareVersion(IDO_CURRENT_SCHEMA_VERSION, schema_version) < 0) {
cr->SetOutput("Outdated schema version: " + schema_version + "; Latest version: " IDO_CURRENT_SCHEMA_VERSION);
msgbuf << "Outdated schema version: '" << schema_version << "'. Latest version: '" << IDO_CURRENT_SCHEMA_VERSION << "'.";
cr->SetState(ServiceWarning);
} else {
std::ostringstream msgbuf;
msgbuf << "Connected to the database server; queries per second: " << std::fixed << std::setprecision(3) << qps;
cr->SetOutput(msgbuf.str());
msgbuf << "Connected to the database server (Schema version: '" << schema_version << "').";
cr->SetState(ServiceOK);
}
msgbuf << " Queries per second: " << std::fixed << std::setprecision(3) << qps;
cr->SetOutput(msgbuf.str());
}
Array::Ptr perfdata = new Array();