Files
alexandre.pires 429a94332e feat: add disk exporter module and related configurations
- Introduced a new disk exporter module to monitor disk health using SMART data.
- Updated `apps.tf` to include the disk exporter module with necessary parameters.
- Added local variables for smartctl version and checksum in `config.tf`.
- Enhanced `alertmanager.yml` to handle DiskUnhealthy alerts with specific grouping and dispatch settings.
- Created new Prometheus rules for monitoring disk health, including alerts for unhealthy disks.
- Updated Prometheus configuration to scrape metrics from the new disk exporter.
- Enhanced Telegram notification template to include resolved alerts and improved formatting.
- Updated the auth-exporter module to specify the Python image tag correctly.
- Created the disk-exporter module with Kubernetes resources, including deployment, service account, and config map.
- Added necessary Python scripts and requirements for the disk exporter functionality.
2025-10-06 18:41:01 +02:00

33 lines
1.3 KiB
Smarty

{{/* Template enhanced to include resolved alerts while using annotations. */}}
{{ $firingCount := len .Alerts.Firing -}}
{{ $resolvedCount := len .Alerts.Resolved -}}
{{ if or (gt $firingCount 0) (gt $resolvedCount 0) -}}
{{ if and (gt $firingCount 0) (gt $resolvedCount 0) -}}
<b>{{ $firingCount }} firing</b> / <b>{{ $resolvedCount }} resolved</b>
{{ if gt $firingCount 0 -}}
<b>Firing:</b>
{{- range .Alerts.Firing }}
• <b>{{ or .Annotations.summary "No summary" }}</b>{{ with .Annotations.description }}{{ . }}{{ end }}
{{- end }}
{{ end -}}
{{ if gt $resolvedCount 0 -}}
<b>Resolved:</b>
{{- range .Alerts.Resolved }}
• <b>{{ or .Annotations.summary "No summary" }}</b>{{ with .Annotations.description }}{{ . }}{{ end }}
{{- end }}
{{ end -}}
{{ else if gt $firingCount 0 -}}
<b>{{ $firingCount }} alert{{ if ne $firingCount 1 }}s{{ end }} firing</b>:
{{- range .Alerts.Firing }}
• <b>{{ or .Annotations.summary "No summary" }}</b>{{ with .Annotations.description }}{{ . }}{{ end }}
{{- end }}
{{ else -}}
<b>{{ $resolvedCount }} alert{{ if ne $resolvedCount 1 }}s{{ end }} resolved</b>:
{{- range .Alerts.Resolved }}
• <b>{{ or .Annotations.summary "No summary" }}</b>{{ with .Annotations.description }}{{ . }}{{ end }}
{{- end }}
{{ end -}}
{{ else -}}
<b>No alert data</b> — nothing firing or recently resolved.
{{ end -}}