summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2018-08-24 09:53:02 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2018-08-24 09:53:02 +0800
commit78f3a322be51b30674968ad241a00d566e1fc179 (patch)
tree5ef73414456172028e9ea74a3bd40c93e49caace
parent448a62b47b193dd8a658b6d7c0ddf52dbfe2589b (diff)
Optimized CCVPN Rules
Change-Id: I397a1d32acf35b4279b4e9a9434646c1317ea579 Issue-ID: HOLMES-162 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
-rw-r--r--rules/ccvnp-rule.drl65
1 files changed, 37 insertions, 28 deletions
diff --git a/rules/ccvnp-rule.drl b/rules/ccvnp-rule.drl
index afc4c06..e1bfc8a 100644
--- a/rules/ccvnp-rule.drl
+++ b/rules/ccvnp-rule.drl
@@ -115,33 +115,40 @@ rule "Update AAI Information"
when
$a: VesAlarm(eventName.indexOf("Fault_Route_Status") != -1)
then
- updateAaiStatus (
- getAdditionalField($a, "networkId"),
- getAdditionalField($a, "node"),
- getAdditionalField($a, "tp-id"),
- getLogicLink($a),
- getAdditionalField($a, "oper-status")
- );
+ updateAaiStatus (
+ getAdditionalField($a, "networkId"),
+ getAdditionalField($a, "node"),
+ getAdditionalField($a, "tp-id"),
+ getLogicLink($a),
+ getAdditionalField($a, "oper-status")
+ );
end
rule "Set Up Correlation"
no-loop true
salience 200
when
- $a: VesAlarm($id: eventId, $start: startEpochMicrosec, eventName.indexOf("Fault_Route_Status") != -1)
- $b: VesAlarm(eventId != $id, eventName.indexOf("Fault_Route_Status") != -1, Math.abs(startEpochMicrosec - $start) < 60000)
+ $a: VesAlarm($id: eventId,
+ $start: startEpochMicrosec,
+ eventName.indexOf("Fault_Route_Status") != -1)
+ $b: VesAlarm(eventId != $id,
+ eventName.indexOf("Fault_Route_Status") != -1,
+ Math.abs(startEpochMicrosec - $start) < 60000)
then
- if (isCorrelated($a, $b)){
- // If any of the alarms have been marked as root, a policy message has ever been created and sent. Do NOT send it again.
- if ($a.getRootFlag() != 1 && $b.getRootFlag() != 1) {
- PolicyMsg msg = createPolicyMsg($a);
- DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
- dmaapService.publishPolicyMsg(msg, "unauthenticated.DCAE_CL_OUTPUT");
- }
- $a.setRootFlag(1);
- $b.setRootFlag(1);
- update($a);
- update($b);
+ if ("down".equalsIgnoreCase(getAdditionalField($a, "oper-status"))
+ && "down".equalsIgnoreCase(getAdditionalField($b, "oper-status"))) {
+ if (isCorrelated($a, $b)){
+ // If any of the alarms have been marked as root, a policy message has ever been created and sent. Do NOT send it again.
+ if ($a.getRootFlag() != 1 && $b.getRootFlag() != 1) {
+ PolicyMsg msg = createPolicyMsg($a);
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ dmaapService.publishPolicyMsg(msg, "unauthenticated.DCAE_CL_OUTPUT");
+ }
+ $a.setRootFlag(1);
+ $b.setRootFlag(1);
+ update($a);
+ update($b);
+ }
}
end
@@ -149,14 +156,16 @@ rule "Clear Alarms"
no-loop true
salience 100
when
- $a: VesAlarm(alarmIsCleared == 1, eventName.indexOf("Fault_Route_Status") != -1)
+ $a: VesAlarm(eventName.indexOf("Fault_Route_Status") != -1)
then
- if (DmaapService.alarmUniqueRequestID.containsKey($a.getEventId())) {
- DmaapService.alarmUniqueRequestID.remove($a.getEventId());
+ if ("up".equalsIgnoreCase(getAdditionalField($a, "oper-status"))) {
+ if (DmaapService.alarmUniqueRequestID.containsKey($a.getEventId())) {
+ DmaapService.alarmUniqueRequestID.remove($a.getEventId());
+ }
+
+ //TODO: send alarm clearing message to Policy - for now it's not needed.
+ //...
+
+ retract($a);
}
-
- //TODO: send alarm clearing message to Policy - for now it's not needed.
- //...
-
- retract($a);
end \ No newline at end of file