]> granicus.if.org Git - icinga2/commitdiff
DB IDO: Enhance ido check with schema info
authorMichael Friedrich <michael.friedrich@netways.de>
Fri, 17 Jun 2016 10:43:05 +0000 (12:43 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 17 Jun 2016 10:43:05 +0000 (12:43 +0200)
fixes #11968

lib/db_ido/idochecktask.cpp

index a2cce81722d604b3c01c3423517f72eab8806c97..519262f49c2fb867e877fcbce577b96b32335f7d 100644 (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();