Directory structure and documentation updates
[osm/MON.git] / osm_mon / plugins / OpenStack / Aodh / alarming.py
index 2343372..b7978fb 100644 (file)
@@ -25,12 +25,10 @@ import json
 
 import logging
 
-from core.message_bus.producer import KafkaProducer
+from osm_mon.core.message_bus.producer import KafkaProducer
 
-from plugins.OpenStack.response import OpenStack_Response
-from plugins.OpenStack.settings import Config
-
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack.response import OpenStack_Response
+from osm_mon.plugins.OpenStack.settings import Config
 
 log = logging.getLogger(__name__)
 
@@ -120,7 +118,7 @@ class Alarming(object):
                     cor_id=alarm_details['correlation_id'])
                 log.info("Response Message: %s", resp_message)
                 self._producer.create_alarm_response(
-                    'create_alarm_resonse', resp_message,
+                    'create_alarm_response', resp_message,
                     'alarm_response')
             except Exception as exc:
                 log.warn("Response creation failed: %s", exc)
@@ -405,12 +403,13 @@ class Alarming(object):
                     'metric': metric_name,
                     'resource_id': resource_id,
                     'resource_type': 'generic',
-                    'aggregation_method': STATISTICS[statistic]}
+                    'aggregation_method': STATISTICS[statistic]}
             payload = json.dumps({'state': alarm_state,
                                   'name': alarm_name,
                                   'severity': SEVERITIES[severity],
                                   'type': 'gnocchi_resources_threshold',
-                                  'gnocchi_resources_threshold_rule': rule, })
+                                  'gnocchi_resources_threshold_rule': rule,
+                                  'alarm_actions': ['http://localhost:8662'], })
             return payload
         except KeyError as exc:
             log.warn("Alarm is not configured correctly: %s", exc)