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__)
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)
'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)