From 5feaa307efd7d41bba14d1479e9b6a4f69edae87 Mon Sep 17 00:00:00 2001 From: Ifat Afek Date: Tue, 26 Apr 2016 08:28:42 +0000 Subject: [PATCH] template documentation Change-Id: I64d1356255539fa87ee366a4d5bb400bb30dbc21 --- doc/source/host_high_memory_consumption.yaml | 72 ++++++++++++++++++++ doc/source/vitrage-first_steps.rst | 7 +- 2 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 doc/source/host_high_memory_consumption.yaml diff --git a/doc/source/host_high_memory_consumption.yaml b/doc/source/host_high_memory_consumption.yaml new file mode 100644 index 000000000..cd7a5cc75 --- /dev/null +++ b/doc/source/host_high_memory_consumption.yaml @@ -0,0 +1,72 @@ +metadata: + id: host_high_memory_consumption +definitions: + entities: + - entity: + category: ALARM + type: nagios + name: 'Memory used' + template_id: host_alarm + - entity: + category: RESOURCE + type: nova.host + template_id: host + - entity: + category: RESOURCE + type: nova.instance + template_id: instance + - entity: + category: ALARM + type: vitrage + name: instance_memory_suboptimal + template_id: instance_alarm + relationships: + - relationship: + source: host_alarm + target: host + relationship_type: on + template_id : alarm_on_host + - relationship: + source: instance_alarm + target: instance + relationship_type: on + template_id : alarm_on_instance + - relationship: + source: host + target: instance + relationship_type: contains + template_id: host_contains_instance +scenarios: + - scenario: + condition: alarm_on_host + actions: + - action: + action_type: set_state + action_target: + target: host + properties: + state: ERROR + - scenario: + condition: alarm_on_host and host_contains_instance + actions: + - action: + action_type: raise_alarm + action_target: + target: instance + properties: + alarm_name: instance_memory_suboptimal + severity: WARNING + - action: + action_type: set_state + action_target: + target: instance + properties: + state: SUBOPTIMAL + - scenario: + condition: alarm_on_host and host_contains_instance and alarm_on_instance + actions: + - action: + action_type: add_causal_relationship + action_target: + source: host_alarm + target: instance_alarm diff --git a/doc/source/vitrage-first_steps.rst b/doc/source/vitrage-first_steps.rst index ff71278c0..211c204dc 100644 --- a/doc/source/vitrage-first_steps.rst +++ b/doc/source/vitrage-first_steps.rst @@ -34,9 +34,10 @@ as the trigger for deduced alarms, states and RCA templates in Vitrage. Vitrage in action ================= -In order to see Vitrage in action, it comes prepackaged with a sample template -that demonstrate its functionality. This can be found (with default config) at -*/etc/vitrage/templates*. +In order to see Vitrage in action, you should place your templates under +*/etc/vitrage/templates*. You can find a template example here2_. + +.. _here2: https://github.com/openstack/vitrage/blob/master/doc/source/host_high_memory_consumption.yaml In the example shown here, we will cause Nagios to report high memory usage on the devstack host. As a result and as defined in our sample template, Vitrage