Router health check notification mail to show router name next to UUID (#6130)

* alerrt message altered

* review feedback and format

Co-authored-by: Daan Hoogland <dahn@onecht.net>
This commit is contained in:
dahn 2022-03-21 03:44:06 +01:00 committed by GitHub
parent 3e4e417389
commit 13efa59097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1215,7 +1215,7 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
return;
}
String alertMessage = "Health checks failed: " + failingChecks.size() + " failing checks on router " + router.getUuid();
String alertMessage = String.format("Health checks failed: %d failing checks on router %s / %s", failingChecks.size(), router.getName(), router.getUuid());
_alertMgr.sendAlert(AlertType.ALERT_TYPE_DOMAIN_ROUTER, router.getDataCenterId(), router.getPodIdToDeployIn(),
alertMessage, alertMessage);
s_logger.warn(alertMessage + ". Checking failed health checks to see if router needs recreate");
@ -1227,6 +1227,8 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
String failedCheck = failingChecks.get(i);
if (i == 0) {
failingChecksEvent.append("Router ")
.append(router.getName())
.append(" / ")
.append(router.getUuid())
.append(" has failing checks: ");
}