Skip to content

Commit

Permalink
Set prometheus alert repeat interval to 24h
Browse files Browse the repository at this point in the history
  • Loading branch information
pinpox committed Nov 3, 2022
1 parent 8c4e84b commit 67e6ba4
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 15 deletions.
45 changes: 36 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@
flake-utils.follows = "flake-utils";
};

alertmanager-ntfy = {
url = "github:pinpox/alertmanager-ntfy";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
flake-compat.follows = "flake-compat";
};
};

matrix-hook.url = "github:pinpox/matrix-hook";
matrix-hook.inputs = {
nixpkgs.follows = "nixpkgs";
Expand Down
13 changes: 12 additions & 1 deletion machines/porree/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{ matrix-hook, config, retiolum, ... }: {
{ matrix-hook, config, retiolum, alertmanager-ntfy, ... }: {

imports = [
./hardware-configuration.nix
matrix-hook.nixosModule
alertmanager-ntfy.nixosModules.default
retiolum.nixosModules.retiolum
# ./retiolum.nix
];
Expand All @@ -25,6 +26,7 @@

lollypops.secrets.files = {
"matrix-hook/envfile" = { };
"alertmanager-ntfy/envfile" = { };
"bitwarden_rs/envfile" = { };
"wireguard/private" = { };
"nginx/blog.passwd" = {
Expand Down Expand Up @@ -344,6 +346,15 @@

services.ntfy-sh.enable = true;

services.alertmanager-ntfy = {
enable = true;
httpAddress = "localhost";
httpPort = "9099";
ntfyTopic = "https://push.pablo.tools/pinpox_alertmanager";
ntfyPriority = "default";
envFile = "${config.lollypops.secrets.files."alertmanager-ntfy/envfile".path}";
};

services.matrix-hook = {
enable = true;
httpAddress = "localhost";
Expand Down
19 changes: 14 additions & 5 deletions modules/monitoring/prometheus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,22 @@ in
group_by = [ "instance" ];
group_wait = "30s";
group_interval = "2m";
repeat_interval = "2h";
repeat_interval = "24h";
};

receivers = [{
name = "all";
webhook_configs = [{ url = "http://127.0.0.1:11000/alert"; }];
}];

receivers = [
{
name = "all";
webhook_configs = [
{ url = "http://127.0.0.1:11000/alert"; } # matrix-hook
{
url = with config.pinpox.services.alertmanager-ntfy;
"http://${httpAddress}:${httpPort}";
} # alertmanger-ntfy
];
}
];
};
};
};
Expand Down

0 comments on commit 67e6ba4

Please sign in to comment.