mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
Add alert and log for redundant router state change
This commit is contained in:
parent
e59c14a758
commit
12a49668d7
@ -758,6 +758,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
||||
if (!router.getIsRedundantRouter()) {
|
||||
continue;
|
||||
}
|
||||
RedundantState prevState = router.getRedundantState();
|
||||
if (router.getState() != State.Running) {
|
||||
router.setRedundantState(RedundantState.UNKNOWN);
|
||||
updated = true;
|
||||
@ -805,6 +806,18 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
||||
txn.close();
|
||||
}
|
||||
}
|
||||
RedundantState currState = router.getRedundantState();
|
||||
if (prevState != currState) {
|
||||
String title = "Redundant virtual router " + router.getInstanceName() +
|
||||
" just switch from " + prevState + " to " + currState;
|
||||
String context = "Redundant virtual router (name: " + router.getHostName() + ", id: " + router.getId() + ") " +
|
||||
" just switch from " + prevState + " to " + currState;
|
||||
s_logger.info(context);
|
||||
if (currState == RedundantState.MASTER) {
|
||||
_alertMgr.sendAlert(AlertManager.ALERT_TYPE_DOMAIN_ROUTER,
|
||||
router.getDataCenterIdToDeployIn(), router.getPodIdToDeployIn(), title, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user