This role will setup a default alarm definition configuration for Monasca. It also provides an Ansible module for creation of Monasca alarm definitions and notifications. More details on alarm definitions can be found at the Monasca API documentation
##Requirements It is assumed the service endpoint for Monasca is properly registered in keystone.
##Role Variables
These variables must be defined.
- keystone_url
- keystone_user
- keystone_password
By default the configured alarm definitions will be setup with a notification to root@localhost change the default_email
variable to modify.
- name: Define default alarm definitions
hosts: mini-mon
gather_facts: no
vars:
keystone_url: http://192.168.10.5:35357/v3/
keystone_user: mini-mon
keystone_password: password
roles:
- {role: monasca-default-alarms, tags: [alarms]}
There are two modules available in the library subdirectory, one for Monasca notifications and the other for alarm definitions. For example:
- name: Setup default email notification method
monasca_notification_method:
name: "Default Email"
type: 'EMAIL'
address: "root@localhost"
keystone_url: "{{keystone_url}}"
keystone_user: "{{keystone_user}}"
keystone_password: "{{keystone_password}}"
keystone_project: "{{keystone_project}}"
register: default_notification
- name: Host Alive Alarm
monasca_alarm_definition:
name: "Host Alive Alarm"
description: "Trigger when a host alive check fails"
expression: "host_alive_status > 0"
keystone_token: "{{default_notification.keystone_token}}"
monasca_api_url: "{{default_notification.monasca_api_url}}"
severity: "HIGH"
alarm_actions:
- "{{default_notification.notification_method_id}}"
ok_actions:
- "{{default_notification.notification_method_id}}"
undetermined_actions:
- "{{default_notification.notification_method_id}}"
Refer to the documentation within the module for full detail
##License Apache
##Author Information Tim Kuhlman Monasca Team email [email protected]