Change config name in generic alerts

Signed-off-by: Brandon Myers <bmyers@mozilla.com>
This commit is contained in:
Brandon Myers 2017-03-30 19:28:12 -05:00
Родитель fb0ae880a1
Коммит b8399efbc2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 8AA79AD83045BBC7
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -78,13 +78,15 @@ class AlertGenericLoader(AlertTask):
required_fields = [
"search_string",
"filters",
"threshold",
"aggregation_key",
"time_window",
"num_samples",
"num_aggregations",
"alert_category",
"tags",
"alert_tags",
"alert_severity",
"summary",
"url",
"alert_summary",
"alert_url",
]
def validate_alert(self, alert):
@ -121,7 +123,7 @@ class AlertGenericLoader(AlertTask):
search_query.add_must(terms)
self.filtersManual(search_query)
self.searchEventsAggregated(alert_config.aggregation_key, samplesLimit=int(alert_config.num_samples))
self.walkAggregations(threshold=int(alert_config.num_aggregations), alert_config=alert_config)
self.walkAggregations(threshold=int(alert_config.num_aggregations), config=alert_config)
def main(self):
self.config_file = './generic_alert_loader.conf'
@ -156,7 +158,7 @@ class AlertGenericLoader(AlertTask):
hostnames.append(event_source['hostname'])
summary = '{} ({}): {}'.format(
aggreg['alert_config']['alert_summary'],
aggreg['config']['alert_summary'],
aggreg['count'],
aggreg['value'],
)