diff options
author | lassulus <lassulus@lassul.us> | 2018-04-28 09:43:51 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2018-04-28 09:43:51 +0200 |
commit | da44ae1115af80bb71f38de20b7421d08e435ea7 (patch) | |
tree | c76f25cee655ecf56e246da3a7dfb8fe047af126 /lass/2configs/monitoring/prometheus-server.nix | |
parent | a0862fa505ba8fb1d94c8bdac69a2077ba89bcdc (diff) |
l monitoring: print alarms to irc
Diffstat (limited to 'lass/2configs/monitoring/prometheus-server.nix')
-rw-r--r-- | lass/2configs/monitoring/prometheus-server.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lass/2configs/monitoring/prometheus-server.nix b/lass/2configs/monitoring/prometheus-server.nix index 92bb0519f..1f9419e1a 100644 --- a/lass/2configs/monitoring/prometheus-server.nix +++ b/lass/2configs/monitoring/prometheus-server.nix @@ -181,4 +181,37 @@ security = import <secrets/grafana_security.nix>; # { AdminUser = ""; adminPassword = ""} }; }; + services.logstash = { + enable = true; + inputConfig = '' + http { + port => 14813 + host => "127.0.0.1" + } + ''; + filterConfig = '' + if ([alerts]) { + ruby { + code => ' + lines = [] + event["alerts"].each {|p| + lines << "#{p["labels"]["instance"]}#{p["annotations"]["summary"]} #{p["status"]}" + } + event["output"] = lines.join("\n") + ' + } + } + ''; + outputConfig = '' + file { path => "/tmp/logs.json" codec => "json_lines" } + irc { + channels => [ "#noise" ] + host => "irc.r" + nick => "alarm" + codec => "json_lines" + format => "%{output}" + } + ''; + #plugins = [ ]; + }; } |