monitoring fixed

This commit is contained in:
m8in
2026-04-18 21:01:33 +02:00
parent a0b8218698
commit ec5b7c5b65
4 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ function doChecks(){
}
function usage(){
printf "\nUsage: /monitoring/check.sh <command> <options>"
printf "\nUsage: /monitor/check.sh <command> <options>"
echo
echo "possible commands:"
echo
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
_CHECK="$(readlink -f "${0}" 2> /dev/null)"
# Folders always ends with an tailing '/'
_CIS_ROOT="${_CHECK%%/definitions/*}/" #Removes longest matching pattern '/definitions/*' from the end
_GENERIC_CHECKS="${_CIS_ROOT:?"Missing CIS_ROOT"}script/monitor/generic/"
${_GENERIC_CHECKS:?"Missing GENERIC_CHECKS"}OVERRIDDEN_DOMAIN_CHECK.sh "your-host.your-domain.net"
@@ -32,13 +32,14 @@ function testDomain(){
checkOrStartSSHMaster \
|| return 1
local _RESULT="$(ssh -S ${_SOCKET} -p ${_REMOTE_PORT} ${_REMOTE_USER}@${_REMOTE_HOSTNAME_FQDN} 'bash /cis/core/printOwnDomain.sh' 2>&1 1>/dev/null)"
local _RESULT=$(ssh -S "${_SOCKET}" -p "${_REMOTE_PORT}" "${_REMOTE_USER}"@"${_REMOTE_HOSTNAME_FQDN}" 'bash /cis/core/printOwnDomain.sh' 2>&1 1>/dev/null)
[ -z "${_RESULT}" ] \
&& echo "OK" \
&& return 0
echo "WARNING#Check hosts '/cis/core/printOwnDomain'"
local _DOMAIN=$(ssh -S "${_SOCKET}" -p "${_REMOTE_PORT}" "${_REMOTE_USER}"@"${_REMOTE_HOSTNAME_FQDN}" 'bash /cis/core/printOwnDomain.sh' 2>/dev/null)
echo "WARNING#Overwritten to '${_DOMAIN}'"
return 0
}