summaryrefslogtreecommitdiffstats
path: root/core/modules/dnbd3-proxy-mode
diff options
context:
space:
mode:
authorSimon Rettberg2019-01-29 13:42:00 +0100
committerSimon Rettberg2019-01-29 13:42:00 +0100
commit520a0f654a25870a533d6feff5f26669eaaa4ac6 (patch)
treefdb5af581cbeab047185f3a9f88ffe0cd0d8fc73 /core/modules/dnbd3-proxy-mode
parent[hardware-stats] God fucking dammit (diff)
downloadmltk-520a0f654a25870a533d6feff5f26669eaaa4ac6.tar.gz
mltk-520a0f654a25870a533d6feff5f26669eaaa4ac6.tar.xz
mltk-520a0f654a25870a533d6feff5f26669eaaa4ac6.zip
[dnbd3-proxy-mode] Watch for hash check fails and log to server
Diffstat (limited to 'core/modules/dnbd3-proxy-mode')
-rw-r--r--core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-logwatch.service8
l---------core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-proxy.target.requires/dnbd3-logwatch.service1
-rwxr-xr-xcore/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_logwatch8
3 files changed, 17 insertions, 0 deletions
diff --git a/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-logwatch.service b/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-logwatch.service
new file mode 100644
index 00000000..2d76781c
--- /dev/null
+++ b/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-logwatch.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=DNBD3 monitor reporting to Satellite Server
+
+[Service]
+ExecStart=/opt/openslx/scripts/systemd-dnbd3_logwatch
+Restart=always
+RestartSec=5
+TimeoutStopSec=2
diff --git a/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-proxy.target.requires/dnbd3-logwatch.service b/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-proxy.target.requires/dnbd3-logwatch.service
new file mode 120000
index 00000000..56096070
--- /dev/null
+++ b/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-proxy.target.requires/dnbd3-logwatch.service
@@ -0,0 +1 @@
+../dnbd3-logwatch.service \ No newline at end of file
diff --git a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_logwatch b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_logwatch
new file mode 100755
index 00000000..f390495d
--- /dev/null
+++ b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_logwatch
@@ -0,0 +1,8 @@
+#!/bin/ash
+
+journalctl -f -n 0 -u dnbd3-proxy \
+ | grep --line-buffered -F -i -e 'crc ' -e 'crc32' -e 'hash check' \
+ | while read -r line; do slxlog "dnbd3-hashfail" "$line"; done
+
+exit 0
+