mirror of
https://github.com/m8tin/cis.git
synced 2026-06-02 14:56:58 +02:00
monitoring fixed
This commit is contained in:
@@ -12,6 +12,9 @@
|
|||||||
!/definitions/default/core/
|
!/definitions/default/core/
|
||||||
/definitions/default/core/*
|
/definitions/default/core/*
|
||||||
!/definitions/default/core/all/
|
!/definitions/default/core/all/
|
||||||
|
!/definitions/default/monitor/
|
||||||
|
/definitions/default/monitor/*
|
||||||
|
!/definitions/default/monitor/checks/
|
||||||
|
|
||||||
# 2.) Ignore all content of 'states', except file README.md
|
# 2.) Ignore all content of 'states', except file README.md
|
||||||
/states/*
|
/states/*
|
||||||
|
|||||||
Regular → Executable
+1
-1
@@ -6,4 +6,4 @@ _CHECK="$(readlink -f "${0}" 2> /dev/null)"
|
|||||||
_CIS_ROOT="${_CHECK%%/definitions/*}/" #Removes longest matching pattern '/definitions/*' from the end
|
_CIS_ROOT="${_CHECK%%/definitions/*}/" #Removes longest matching pattern '/definitions/*' from the end
|
||||||
_GENERIC_CHECKS="${_CIS_ROOT:?"Missing CIS_ROOT"}script/monitor/generic/"
|
_GENERIC_CHECKS="${_CIS_ROOT:?"Missing CIS_ROOT"}script/monitor/generic/"
|
||||||
|
|
||||||
${_GENERIC_CHECKS:?"Missing GENERIC_CHECKS"}OVERRIDDEN_DOMAIN_CHECK.sh "your-host.your-domain.net"
|
${_GENERIC_CHECKS:?"Missing GENERIC_CHECKS"}CIS_OWN_DOMAIN_CHECK.sh "your-host.your-domain.net[:ssh_port]"
|
||||||
@@ -43,7 +43,7 @@ function doChecks(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function usage(){
|
function usage(){
|
||||||
printf "\nUsage: /monitoring/check.sh <command> <options>"
|
printf "\nUsage: /monitor/check.sh <command> <options>"
|
||||||
echo
|
echo
|
||||||
echo "possible commands:"
|
echo "possible commands:"
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -32,13 +32,14 @@ function testDomain(){
|
|||||||
checkOrStartSSHMaster \
|
checkOrStartSSHMaster \
|
||||||
|| return 1
|
|| 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}" ] \
|
[ -z "${_RESULT}" ] \
|
||||||
&& echo "OK" \
|
&& echo "OK" \
|
||||||
&& return 0
|
&& 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
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user