mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-18 18:49:05 +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>
74 lines
3.3 KiB
Jsonnet
74 lines
3.3 KiB
Jsonnet
// Every cluster node reports the state of the whole cluster, so these
|
|
// alerts fire once per node; group them by cluster labels in Alertmanager.
|
|
{
|
|
local c = self._config,
|
|
local a = (import '../lib/alerts.libsonnet')(c),
|
|
prometheusAlerts+:: {
|
|
groups+: a.group('windows-cluster', collectors=['mscluster'], rules=[
|
|
{
|
|
alert: 'WindowsClusterNodeDown',
|
|
expr: |||
|
|
windows_mscluster_node_state{%(windowsExporterSelector)s} == 1
|
|
||| % c,
|
|
'for': '5m',
|
|
labels: { severity: c.criticalSeverity },
|
|
annotations: {
|
|
summary: 'Failover cluster node is down',
|
|
description: 'Cluster node {{ $labels.node }} has been down for 5 minutes, as reported by {{ $labels.instance }}.',
|
|
},
|
|
state:: true,
|
|
},
|
|
{
|
|
alert: 'WindowsClusterResourceFailed',
|
|
expr: |||
|
|
windows_mscluster_resource_state{%(windowsExporterSelector)s} == 4
|
|
||| % c,
|
|
'for': '5m',
|
|
labels: { severity: c.criticalSeverity },
|
|
annotations: {
|
|
summary: 'Failover cluster resource has failed',
|
|
description: 'Cluster resource {{ $labels.resource }} ({{ $labels.type }}) in group {{ $labels.resource_group }} has been in the failed state for 5 minutes, as reported by {{ $labels.instance }}.',
|
|
},
|
|
state:: true,
|
|
},
|
|
{
|
|
alert: 'WindowsClusterResourceGroupFailed',
|
|
expr: |||
|
|
windows_mscluster_resourcegroup_state{%(windowsExporterSelector)s} == 2
|
|
||| % c,
|
|
'for': '5m',
|
|
labels: { severity: c.criticalSeverity },
|
|
annotations: {
|
|
summary: 'Failover cluster resource group has failed',
|
|
description: 'Cluster resource group {{ $labels.resource_group }} has been in the failed state for 5 minutes, as reported by {{ $labels.instance }}.',
|
|
},
|
|
state:: true,
|
|
},
|
|
{
|
|
alert: 'WindowsClusterSharedVolumeAlmostFull',
|
|
expr: |||
|
|
(windows_mscluster_shared_volumes_free_bytes{%(windowsExporterSelector)s, %(sharedVolumeSelector)s} / (windows_mscluster_shared_volumes_total_bytes{%(windowsExporterSelector)s, %(sharedVolumeSelector)s} > 0)) * 100 < %(diskFreeWarningThreshold)s
|
|
||| % c,
|
|
'for': '15m',
|
|
labels: { severity: 'warning' },
|
|
annotations: {
|
|
summary: 'Cluster shared volume is almost full',
|
|
description: 'Cluster shared volume {{ $labels.shared_volume }} has had less than %(diskFreeWarningThreshold)s%% free space for 15 minutes, as reported by {{ $labels.instance }}.' % c,
|
|
},
|
|
},
|
|
{
|
|
alert: 'WindowsClusterSharedVolumeAlmostFull',
|
|
expr: |||
|
|
(windows_mscluster_shared_volumes_free_bytes{%(windowsExporterSelector)s, %(sharedVolumeSelector)s} / (windows_mscluster_shared_volumes_total_bytes{%(windowsExporterSelector)s, %(sharedVolumeSelector)s} > 0)) * 100 < %(diskFreeCriticalThreshold)s
|
|
||| % c,
|
|
'for': '15m',
|
|
labels: { severity: c.criticalSeverity },
|
|
annotations: {
|
|
summary: 'Cluster shared volume is almost full',
|
|
description: 'Cluster shared volume {{ $labels.shared_volume }} has had less than %(diskFreeCriticalThreshold)s%% free space for 15 minutes, as reported by {{ $labels.instance }}.' % c,
|
|
},
|
|
},
|
|
]),
|
|
},
|
|
}
|