IdoCheckTask: Don't override checkable critical with warn state

This commit is contained in:
Yonas Habteab 2021-01-27 13:27:14 +01:00
parent 9219f68c83
commit 3e5dfa9607

View File

@ -165,7 +165,7 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
if (missingQueriesCritical.IsEmpty() && qps < queriesCritical) { if (missingQueriesCritical.IsEmpty() && qps < queriesCritical) {
msgbuf << " " << qps << " queries/s lower than critical threshold (" << queriesCritical << " queries/s)."; msgbuf << " " << qps << " queries/s lower than critical threshold (" << queriesCritical << " queries/s).";
state= ServiceCritical; state = ServiceCritical;
} else if (missingQueriesWarning.IsEmpty() && qps < queriesWarning) { } else if (missingQueriesWarning.IsEmpty() && qps < queriesWarning) {
msgbuf << " " << qps << " queries/s lower than warning threshold (" << queriesWarning << " queries/s)."; msgbuf << " " << qps << " queries/s lower than warning threshold (" << queriesWarning << " queries/s).";
@ -181,8 +181,10 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
msgbuf << " " << pendingQueries << " pending queries greater than warning threshold (" msgbuf << " " << pendingQueries << " pending queries greater than warning threshold ("
<< pendingQueriesWarning << " queries)."; << pendingQueriesWarning << " queries).";
if (state == ServiceOK) {
state = ServiceWarning; state = ServiceWarning;
} }
}
cr->SetPerformanceData(new Array({ cr->SetPerformanceData(new Array({
{ new PerfdataValue("queries", qps, false, "", queriesWarning, queriesCritical) }, { new PerfdataValue("queries", qps, false, "", queriesWarning, queriesCritical) },