mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-29 08:34:20 +02:00
Merge pull request #6505 from schinken/fix-clusterzonecheck-lag
Fix clusterzonecheck if not connected
This commit is contained in:
commit
9f4f930559
@ -122,23 +122,23 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che
|
|||||||
bytesReceivedPerSecond += endpoint->GetBytesReceivedPerSecond();
|
bytesReceivedPerSecond += endpoint->GetBytesReceivedPerSecond();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!connected) {
|
if (connected) {
|
||||||
cr->SetState(ServiceCritical);
|
|
||||||
cr->SetOutput("Zone '" + zoneName + "' is not connected. Log lag: " + Utility::FormatDuration(zoneLag));
|
|
||||||
} else {
|
|
||||||
cr->SetState(ServiceOK);
|
cr->SetState(ServiceOK);
|
||||||
cr->SetOutput("Zone '" + zoneName + "' is connected. Log lag: " + Utility::FormatDuration(zoneLag));
|
cr->SetOutput("Zone '" + zoneName + "' is connected. Log lag: " + Utility::FormatDuration(zoneLag));
|
||||||
}
|
|
||||||
|
|
||||||
/* Check whether the thresholds have been resolved and compare them */
|
/* Check whether the thresholds have been resolved and compare them */
|
||||||
if (missingLagCritical.IsEmpty() && zoneLag > lagCritical) {
|
if (missingLagCritical.IsEmpty() && zoneLag > lagCritical) {
|
||||||
|
cr->SetState(ServiceCritical);
|
||||||
|
cr->SetOutput("Zone '" + zoneName + "' is connected. Log lag: " + Utility::FormatDuration(zoneLag)
|
||||||
|
+ " greater than critical threshold: " + Utility::FormatDuration(lagCritical));
|
||||||
|
} else if (missingLagWarning.IsEmpty() && zoneLag > lagWarning) {
|
||||||
|
cr->SetState(ServiceWarning);
|
||||||
|
cr->SetOutput("Zone '" + zoneName + "' is connected. Log lag: " + Utility::FormatDuration(zoneLag)
|
||||||
|
+ " greater than warning threshold: " + Utility::FormatDuration(lagWarning));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
cr->SetState(ServiceCritical);
|
cr->SetState(ServiceCritical);
|
||||||
cr->SetOutput("Zone '" + zoneName + "' is connected. Log lag: " + Utility::FormatDuration(zoneLag)
|
cr->SetOutput("Zone '" + zoneName + "' is not connected. Log lag: " + Utility::FormatDuration(zoneLag));
|
||||||
+ " greater than critical threshold: " + Utility::FormatDuration(lagCritical));
|
|
||||||
} else if (missingLagWarning.IsEmpty() && zoneLag > lagWarning) {
|
|
||||||
cr->SetState(ServiceWarning);
|
|
||||||
cr->SetOutput("Zone '" + zoneName + "' is connected. Log lag: " + Utility::FormatDuration(zoneLag)
|
|
||||||
+ " greater than warning threshold: " + Utility::FormatDuration(lagWarning));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->SetPerformanceData(new Array({
|
cr->SetPerformanceData(new Array({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user