template documentation

Change-Id: I64d1356255539fa87ee366a4d5bb400bb30dbc21
This commit is contained in:
Ifat Afek 2016-04-26 08:28:42 +00:00
parent a98b5cd20e
commit 5feaa307ef
2 changed files with 76 additions and 3 deletions

View File

@ -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

View File

@ -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