Skip to content

Commit

Permalink
[RFC] Allow MaaS alarms to be disabled
Browse files Browse the repository at this point in the history
Implements functionality to disable alarms rather than disabling the
entire check. This comes from a discussion in rcbops/u-suk-dev#948
where some of the checks are good to have, but the alarms aren't
needed.

Connects rcbops/u-suk-dev#1019
  • Loading branch information
major committed Jan 19, 2017
1 parent 80bc087 commit 1df8676
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rpcd/playbooks/roles/rpc_maas/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,20 @@ maas_pip_dependencies:
maas_plugin_dir: /opt/rpc-openstack/maas/plugins/

maas_rpc_scripts_dir: /opt/rpc-openstack/scripts

# The following two variables control which checks and alarms are excluded from
# MaaS. Here is explanation of what each variable does:
#
# 1) When you add a check to `maas_excluded_checks`, the check (and any
# associated alarms) are not provisioned. This disables graphing,
# monitoring, alarms and alerts for that particular check.
#
# maas_excluded_checks: List of checks and alarms to exclude from this deploy
# 2) When you add an alarm to `maas_excluded_alarms`, the alarm is not
# provisioned. However, the check itself (and any associated graphing) is
# maintained.
#
maas_excluded_checks: []

maas_excluded_alarms: []

#
# openrc definitions from OSA
Expand Down
2 changes: 2 additions & 0 deletions rpcd/playbooks/roles/rpc_maas/templates/cpu_check.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ disabled : false
period : "{{ maas_check_period }}"
timeout : "{{ maas_check_timeout }}"
alarms :
{% if 'idle_percent_average' not in maas_excluded_alarms %}
idle_percent_average :
label : idle_percent_average--{{ inventory_hostname|quote }}
notification_plan_id : "{{ maas_notification_plan }}"
Expand All @@ -12,3 +13,4 @@ alarms :
if (metric["idle_percent_average"] <= {{ cpu_idle_percent_avg_threshold }}) {
return new AlarmStatus(WARNING, "CPU time spent idle has dropped to <= {{ cpu_idle_percent_avg_threshold }}%");
}
{% endif %}

0 comments on commit 1df8676

Please sign in to comment.