From d64e4a6e5d06cd69b90597c390c6d5324f7ee0a7 Mon Sep 17 00:00:00 2001 From: Tim Kuhlman Date: Tue, 27 Jan 2015 10:32:08 -0700 Subject: [PATCH] Moved to setting up alarms with a role so they can be used more widely Change-Id: Iafbf59b744785f1a368b75ec7ab1510f36670f60 --- mini-mon.yml | 63 ++---------------------------------------------- requirements.yml | 4 ++- 2 files changed, 5 insertions(+), 62 deletions(-) diff --git a/mini-mon.yml b/mini-mon.yml index 9b981fc..6b05cf8 100644 --- a/mini-mon.yml +++ b/mini-mon.yml @@ -116,64 +116,5 @@ keystone_url: http://192.168.10.5:35357/v3/ keystone_user: mini-mon keystone_password: password - tasks: - - name: Setup root email notification method - monasca_notification_method: - name: "Email Root" - type: 'EMAIL' - address: 'root@localhost' - keystone_url: "{{keystone_url}}" - keystone_user: "{{keystone_user}}" - keystone_password: "{{keystone_password}}" - tags: - - alarms - - system_alarms - - monasca_alarms - register: out - - name: Create System Alarm Definitions - monasca_alarm_definition: - name: "{{item.name}}" - expression: "{{item.expression}}" - keystone_token: "{{out.keystone_token}}" - match_by: "{{item.match_by | default(['hostname']) }}" - monasca_api_url: "{{out.monasca_api_url}}" - alarm_actions: - - "{{out.notification_method_id}}" - ok_actions: - - "{{out.notification_method_id}}" - undetermined_actions: - - "{{out.notification_method_id}}" - with_items: - - { name: "Host Alive Alarm", expression: "host_alive_status > 0"} - - { name: "Http Status Alarm", expression: "http_status > 0", match_by: ["service", "hostname"] } - - { name: "High CPU usage", expression: "avg(cpu.idle_perc) < 10 times 3" } - - { name: "Disk Inode Usage", expression: "disk.inode_used_perc > 90" } - - { name: "Disk Usage", expression: "disk.space_used_perc > 90" } - - { name: "Memory usage", expression: "avg(mem.usable_perc) < 10 times 3" } - - { name: "Network Errors", expression: "net.in_errors >5 or net.out_errors > 5" } - tags: - - alarms - - system_alarms - - name: Create Monasca Alarm Definitions - monasca_alarm_definition: - name: "{{item.name}}" - expression: "{{item.expression}}" - keystone_token: "{{out.keystone_token}}" - match_by: "{{item.match_by | default(['hostname']) }}" - monasca_api_url: "{{out.monasca_api_url}}" - alarm_actions: - - "{{out.notification_method_id}}" - ok_actions: - - "{{out.notification_method_id}}" - undetermined_actions: - - "{{out.notification_method_id}}" - with_items: - - { name: "Kafka Consumer Lag", expression: "avg(kafka.consumer_lag) > 100 times 3", match_by: ["consumer_group", "hostname"] } - - { name: "Monasca Agent emit time", expression: "avg(monasca.emit_time_sec) > 2 times 3" } - - { name: "Monasca Agent collection time", expression: "avg(monasca.collection_time_sec) > 5 times 3" } - - { name: "Monasca Notification Configuration DB query time", expression: "avg(monasca.config_db_time.95percentile) > 5 times 3" } - - { name: "Monasca Notification email time", expression: "avg(monasca.email_time.95percentile) > 2 times 3" } - - { name: "Zookeeper Average Latency", expression: "avg(zookeeper.avg_latency_sec) > 1 times 3" } - tags: - - alarms - - monasca_alarms + roles: + - {role: monasca-default-alarms, tags: [alarms]} diff --git a/requirements.yml b/requirements.yml index 1f85edd..87d4abe 100644 --- a/requirements.yml +++ b/requirements.yml @@ -4,6 +4,8 @@ name: monasca-agent - src: tkuhlman.monasca-api name: monasca-api +- src: https://github.com/hpcloud-mon/ansible-monasca-default-alarms + name: monasca-default-alarms - src: tkuhlman.monasca-keystone name: monasca-keystone - src: tkuhlman.monasca-notification @@ -22,5 +24,5 @@ name: storm - src: tkuhlman.zookeeper name: zookeeper -- src: https://github.com/tkuhlman/ansible-influxdb +- src: https://github.com/hpcloud-mon/ansible-influxdb name: influxdb