Adds more alarm parameters to alarm notification log 80/6180/1
authordiazb <bdiaz@whitestack.com>
Fri, 18 May 2018 22:25:51 +0000 (19:25 -0300)
committerdiazb <bdiaz@whitestack.com>
Fri, 18 May 2018 22:25:51 +0000 (19:25 -0300)
Signed-off-by: diazb <bdiaz@whitestack.com>
policy_module/osm_policy_module/core/agent.py

index 60da337..a38feeb 100644 (file)
@@ -95,7 +95,21 @@ class PolicyModuleAgent:
                 if message.key == 'notify_alarm':
                     content = json.loads(message.value)
                     alarm_id = content['notify_details']['alarm_uuid']
-                    log.info("Received alarm notification for alarm %s", alarm_id)
+                    metric_name = content['notify_details']['metric_name']
+                    operation = content['notify_details']['operation']
+                    threshold = content['notify_details']['threshold_value']
+                    vdu_name = content['notify_details']['vdu_name']
+                    vnf_member_index = content['notify_details']['vnf_member_index']
+                    ns_id = content['notify_details']['ns_id']
+                    log.info(
+                        "Received alarm notification for alarm %s, \
+                        metric %s, \
+                        operation %s, \
+                        threshold %s, \
+                        vdu_name %s, \
+                        vnf_member_index %s, \
+                        ns_id %s ",
+                        alarm_id, metric_name, operation, threshold, vdu_name, vnf_member_index, ns_id)
                     try:
                         alarm = ScalingAlarm.select().where(ScalingAlarm.alarm_id == alarm_id).get()
                         lcm_client = LcmClient()