From 7a0506fc507a19a1640bade996146ac0dd6813e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Thu, 10 Oct 2019 11:46:53 +0200 Subject: [PATCH] Start by restarting rsyslog service --- xymon/xymon.files.alert.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xymon/xymon.files.alert.sh b/xymon/xymon.files.alert.sh index f94abc0..ae48504 100755 --- a/xymon/xymon.files.alert.sh +++ b/xymon/xymon.files.alert.sh @@ -43,6 +43,11 @@ fi # Check if a file exceeds it's modification time {{{ if echo "${BBALPHAMSG}" | grep -qE "File was modified.*ago - should be.*" ; then [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test file — Some files exceeds their modification time." >> "${debug_stdout}" + # First restart Rsyslog service {{{ + [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test service — First restart rsyslog service." >> "${debug_stdout}" + [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Test service — ssh -n -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${REMOTE_SSH_USER}@${BBHOSTNAME} sudo systemctl restart rsyslog.service" >> "${debug_stdout}" + #ssh -n -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "${REMOTE_SSH_USER}"@"${BBHOSTNAME}" "sudo systemctl restart rsyslog.service" >> "${debug_stdout}" 2>> "${debug_stderr}" + # }}} ## Get the list of files path ## TODO : Set a pattern for both yellow and red colors echo "${BBALPHAMSG}" | sed -n 's;^\&yellow \(.*\);\1;p' > "${file_list}"