aboutsummaryrefslogtreecommitdiff
path: root/logwatch.sh
diff options
context:
space:
mode:
authorOxbian <got.dacs@slmail.me>2023-04-24 13:15:49 +0200
committerOxbian <got.dacs@slmail.me>2023-04-24 13:15:49 +0200
commitd36bf2981e438855a0da5904d9131b2737da6107 (patch)
treefee2621b49de09a039db6daacac00c834280e5d7 /logwatch.sh
parent3b53c42d851fa737b8a5efada6baad327ab2e3ba (diff)
downloadmatrix-monitoring-d36bf2981e438855a0da5904d9131b2737da6107.tar.gz
matrix-monitoring-d36bf2981e438855a0da5904d9131b2737da6107.zip
Adding matrix-sender submodules & logwatch.sh
Diffstat (limited to 'logwatch.sh')
-rwxr-xr-xlogwatch.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/logwatch.sh b/logwatch.sh
new file mode 100755
index 0000000..4081489
--- /dev/null
+++ b/logwatch.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# Scripts to send logwatch log to matrix
+
+#set -x
+
+# Ensure the logwatch folder exist
+mkdir -p /var/cache/logwatch
+
+# matrix.sh absolute path
+MATRIX_SH_PATH=''
+
+# Variable
+today=$(date +%d-%m-%Y)
+filename=/var/cache/logwatch/$today-logwatch.html
+
+# Execute
+/usr/sbin/logwatch --output file --format html --filename $filename
+$MATRIX_SH_PATH -html $(cat $filename)
ArKa projects. All rights to me, and your next child right arm.