feat: add alerting for amz ebs server and websites blackbox
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
grafanaAlertRuleDefinitions = [
|
||||
{
|
||||
uid = "amzebs-nginx-service-down-alert-uid";
|
||||
title = "Nginx Service Down on amzebs-01";
|
||||
condition = "C";
|
||||
data = [
|
||||
{
|
||||
refId = "A";
|
||||
relativeTimeRange = {
|
||||
from = 300;
|
||||
to = 0;
|
||||
};
|
||||
datasourceUid = "vm-datasource-uid";
|
||||
model = {
|
||||
editorMode = "code";
|
||||
expr = "node_systemd_unit_state{state=\"active\", name=\"nginx.service\", instance=\"amzebs-01:9100\"} OR on() vector(0)";
|
||||
hide = false;
|
||||
intervalMs = 1000;
|
||||
legendFormat = "__auto";
|
||||
maxDataPoints = 43200;
|
||||
range = true;
|
||||
refId = "A";
|
||||
};
|
||||
}
|
||||
{
|
||||
refId = "B";
|
||||
datasourceUid = "__expr__";
|
||||
model = {
|
||||
type = "reduce";
|
||||
expression = "A";
|
||||
reducer = "last";
|
||||
};
|
||||
}
|
||||
{
|
||||
refId = "C";
|
||||
datasourceUid = "__expr__";
|
||||
model = {
|
||||
type = "math";
|
||||
expression = "$B < 1";
|
||||
};
|
||||
}
|
||||
];
|
||||
noDataState = "Alerting";
|
||||
execErrState = "Alerting";
|
||||
for = "5m";
|
||||
annotations = {
|
||||
description = "Nginx service is down on amzebs-01";
|
||||
summary = "Nginx Service Down on amzebs-01";
|
||||
};
|
||||
labels = {
|
||||
severity = "critical";
|
||||
host = "amzebs-01";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user