Add alerttonotify to monitoring host
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Run nix flake check / flake-check (push) Has been cancelled
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Run nix flake check / flake-check (push) Has been cancelled
				
			This commit is contained in:
		
							
								
								
									
										21
									
								
								services/monitoring/alerttonotify.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								services/monitoring/alerttonotify.nix
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| { pkgs, config, ... }: | ||||
| { | ||||
|   sops.secrets."nats_nkey" = { }; | ||||
|   systemd.services."alerttonotify" = { | ||||
|     wants = [ "network-online.target" ]; | ||||
|     after = [ | ||||
|       "network-online.target" | ||||
|       "sops-nix.service" | ||||
|     ]; | ||||
|  | ||||
|     environment = { | ||||
|       NATS_URL = "nats://nats1.home.2rjus.net:4222"; | ||||
|       NATS_NKEY_FILE = "${config.sops.secrets.nats_nkey.path}"; | ||||
|     }; | ||||
|  | ||||
|     serviceConfig = { | ||||
|       Type = "exec"; | ||||
|       ExecStart = "${pkgs.alerttonotify}/bin/alerttonotify"; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
| @@ -5,5 +5,6 @@ | ||||
|     ./grafana.nix | ||||
|     ./prometheus.nix | ||||
|     ./pve.nix | ||||
|     ./alerttonotify.nix | ||||
|   ]; | ||||
| } | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|         global = { | ||||
|         }; | ||||
|         route = { | ||||
|           receiver = "webhook_gunter"; | ||||
|           receiver = "webhook_natstonotify"; | ||||
|           group_wait = "30s"; | ||||
|           group_interval = "5m"; | ||||
|           repeat_interval = "12h"; | ||||
| @@ -16,10 +16,10 @@ | ||||
|         }; | ||||
|         receivers = [ | ||||
|           { | ||||
|             name = "webhook_gunter"; | ||||
|             name = "webhook_natstonotify"; | ||||
|             webhook_configs = [ | ||||
|               { | ||||
|                 url = "http://gunter.home.2rjus.net:5001/alert"; | ||||
|                 url = "http://localhost:5001/alert"; | ||||
|               } | ||||
|             ]; | ||||
|           } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user