graylog: improve alerting

This commit is contained in:
Ingolf Wagner 2020-03-11 10:57:21 +08:00
parent 0cff3093d0
commit 67e746e425
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
7 changed files with 28 additions and 6 deletions

View file

@ -100,4 +100,27 @@ in {
'';
};
environment.etc."graylog/server/known_servers.csv" = {
enable = true;
text = ''
"ip","host_name"
"95.216.1.150","lassul.us"
'';
};
environment.etc."graylog/systemd/loglevel.csv" = {
enable = true;
text = ''
"value","Servity","Description"
"0","emergency","System is unusable"
"1","alert","Should be corrected immediately"
"2","cirtical","Critical conditions"
"3","error","Error Condition"
"4","warning","May indicate that an error will occur if action is not taken."
"5","notice","Events that are unusual, but not error conditions."
"6","info","Normal operational messages that require no action."
"7","debug","Information useful to developers for debugging the application."
'';
};
}

View file

@ -279,7 +279,7 @@
"${config.users.users.mailUser.home}/.config/notmuch/notmuchrc";
script = ''
echo "run afew"
${pkgs.afew}/bin/afew --all --tag -v
${pkgs.afew}/bin/afew --all --tag
'';
};
systemd.timers.retagmail = {

View file

@ -54,7 +54,7 @@ in {
in ''
log_format graylog2_json escape=json '{ "timestamp": "$time_iso8601", '
'"facility": "nginx", '
'"remote_addr": "$remote_addr", '
'"src_addr": "$remote_addr", '
'"body_bytes_sent": $body_bytes_sent, '
'"request_time": $request_time, '
'"response_status": $status, '

View file

@ -71,7 +71,7 @@ in {
in ''
log_format graylog2_json escape=json '{ "timestamp": "$time_iso8601", '
'"facility": "nginx", '
'"remote_addr": "$remote_addr", '
'"src_addr": "$remote_addr", '
'"body_bytes_sent": $body_bytes_sent, '
'"request_time": $request_time, '
'"response_status": $status, '

View file

@ -51,7 +51,7 @@ let
--include \
--request POST \
--data-urlencode \
'payload={"text": "Service Failed ${plan.name}"}' \
'payload={"text": "Service Failed ${plan.name} on ${config.networking.hostName}"}' \
${cfg.url}
'';

View file

@ -16,7 +16,7 @@ in {
commonHttpConfig = ''
log_format graylog2_json escape=json '{ "timestamp": "$time_iso8601", '
'"facility": "nginx", '
'"remote_addr": "$remote_addr", '
'"src_addr": "$remote_addr", '
'"body_bytes_sent": $body_bytes_sent, '
'"request_time": $request_time, '
'"response_status": $status, '

View file

@ -41,7 +41,6 @@ let
EOF
'';
in {
programs.tmux = {