Rename GSE alerting attribute

Change-Id: I30b16d7ef159242f9984b54a8ae344fbf6560314
This commit is contained in:
Swann Croiset 2016-10-06 15:43:17 +02:00
parent 58f737e712
commit 8bc378c486
3 changed files with 25 additions and 16 deletions

View File

@ -115,8 +115,7 @@ lma_collector:
output_metric_name: cluster_service_status
interval: 10
warm_up_period: 20
enable_notification: false
activate_alerting: true
alerting: enabled
clusters:
nova-logs:
policy: highest_severity
@ -515,15 +514,11 @@ lma_collector:
members:
- check
nova-free-vcpu:
enable_notification: false
activate_alerting: true
policy: highest_severity
group_by: member
members:
- nova-free-vcpu
nova-free-memory:
enable_notification: false
activate_alerting: true
policy: highest_severity
group_by: member
members:
@ -541,8 +536,7 @@ lma_collector:
output_metric_name: cluster_node_status
interval: 10
warm_up_period: 80
enable_notification: false
activate_alerting: true
alerting: enabled
clusters:
controller:
policy: majority_of_members
@ -647,8 +641,7 @@ lma_collector:
output_metric_name: cluster_status
interval: 10
warm_up_period: 30
enable_notification: true
activate_alerting: true
alerting: enabled_with_notification
clusters:
mysql:
policy: highest_severity

View File

@ -1088,10 +1088,10 @@ in Heka.
* `warm_up_period`: *Optional*. Number of seconds after a (re)start that the
GSE plugin will wait before emitting its metric messages. Valid options: an
integer. Default: undef.
* `enable_notification`: *Optional*. Whether or not enable notifications in the
alerting system. Valid options: a boolean. Default: true.
* `activate_alerting`: *Optional*. Whether or not configure alerting system
for all clusters. Valid options: a boolean. Default: true.
* `alerting`: *Optional*. Whether or not the alerting is disabled or enabled
with or without notifications.
Valid options: one of the string 'disabled', 'enabled' or 'enabled_with_notification'.
Default: 'enabled_with_notification'.
#### Define `lma_collector::gse_nagios`

View File

@ -21,8 +21,7 @@ define lma_collector::gse_cluster_filter (
$cluster_field = undef,
$clusters = {},
$warm_up_period = undef,
$enable_notification = true,
$activate_alerting = true,
$alerting = 'enabled_with_notification',
$ensure = present,
) {
include lma_collector::params
@ -52,6 +51,23 @@ define lma_collector::gse_cluster_filter (
'))',
], '')
if $alerting and $alerting != 'disabled' and $alerting != 'enabled' and
$alerting != 'enabled_with_notification' {
fail("alerting parameter must be either 'disabled', 'enabled' or 'enabled_with_notification' instead of ${alerting}")
}
if $alerting != 'disabled' {
$activate_alerting = true
} else {
$activate_alerting = false
}
if $alerting != 'enabled_with_notification' {
$enable_notification = true
} else {
$enable_notification = false
}
heka::filter::sandbox { "gse_${title}":
config_dir => $lma_collector::params::metric_config_dir,
filename => "${lma_collector::params::plugins_dir}/filters/gse_cluster_filter.lua",