mirror of https://github.com/Icinga/icinga2.git
parent
8573636cc9
commit
52b33f560f
|
@ -18,7 +18,7 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
template CheckCommand "ido-check-command" {
|
template CheckCommand "ido-check-command" {
|
||||||
execute = IdoCheck
|
execute = IdoCheck
|
||||||
}
|
}
|
||||||
|
|
||||||
object CheckCommand "ido" {
|
object CheckCommand "ido" {
|
||||||
|
|
|
@ -58,6 +58,13 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
|
||||||
if (resolvedMacros && !useResolvedMacros)
|
if (resolvedMacros && !useResolvedMacros)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (idoType.IsEmpty()) {
|
||||||
|
cr->SetOutput("Macro 'ido_type' must be set.");
|
||||||
|
cr->SetState(ServiceUnknown);
|
||||||
|
checkable->ProcessCheckResult(cr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String idoName = MacroProcessor::ResolveMacros("$ido_name$", resolvers, checkable->GetLastCheckResult(),
|
String idoName = MacroProcessor::ResolveMacros("$ido_name$", resolvers, checkable->GetLastCheckResult(),
|
||||||
NULL, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros);
|
NULL, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros);
|
||||||
|
|
||||||
|
@ -87,9 +94,14 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
|
||||||
|
|
||||||
double qps = conn->GetQueryCount(60) / 60.0;
|
double qps = conn->GetQueryCount(60) / 60.0;
|
||||||
|
|
||||||
if (!conn->GetConnected() && conn->GetShouldConnect()) {
|
if (!conn->GetConnected()) {
|
||||||
cr->SetOutput("Could not connect to the database server.");
|
if (conn->GetShouldConnect()) {
|
||||||
cr->SetState(ServiceCritical);
|
cr->SetOutput("Could not connect to the database server.");
|
||||||
|
cr->SetState(ServiceCritical);
|
||||||
|
} else {
|
||||||
|
cr->SetOutput("Not currently enabled: Another cluster instance is responsible for the IDO database.");
|
||||||
|
cr->SetState(ServciceOK);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
String schema_version = conn->GetSchemaVersion();
|
String schema_version = conn->GetSchemaVersion();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue