mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-19 11:09:03 +02:00
Split alerts/alerts.libsonnet into one file per collector under alerts/, like kubernetes-mixin. Each rule is a plain Prometheus alerting rule with the PromQL written out in an expr block and %(name)s placeholders for the _config values; lib/alerts.libsonnet keeps the collector and per-alert gating and keep_firing_for. The pagefile, diskdrive and license alerts get groups of their own so that one file is one group. The rendered default rules are unchanged apart from expr block scalars. Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
22 lines
661 B
Jsonnet
22 lines
661 B
Jsonnet
{
|
|
local c = self._config,
|
|
local a = (import '../lib/alerts.libsonnet')(c),
|
|
prometheusAlerts+:: {
|
|
groups+: a.group('windows-license', collectors=['license'], rules=[
|
|
{
|
|
alert: 'WindowsLicenseNotGenuine',
|
|
expr: |||
|
|
windows_license_status{%(windowsExporterSelector)s, state!="genuine"} == 1
|
|
||| % c,
|
|
'for': '1h',
|
|
labels: { severity: 'warning' },
|
|
annotations: {
|
|
summary: 'Windows license is not genuine',
|
|
description: 'Windows on {{ $labels.instance }} has reported license status {{ $labels.state }} for 1 hour.',
|
|
},
|
|
state:: true,
|
|
},
|
|
]),
|
|
},
|
|
}
|