Code cleanup
This commit is contained in:
@@ -44,7 +44,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -101,7 +101,7 @@ fi
|
||||
|
||||
# burp v1 or v2?
|
||||
_BURP_VERSION="$(${_BURP_BIN} -v 2>/dev/null)"
|
||||
(( ARG_DEBUG != 0 )) && debug "burp version: ${_BURP_VERSION}"
|
||||
(( ARG_DEBUG > 0 )) && debug "burp version: ${_BURP_VERSION}"
|
||||
case "${_BURP_VERSION}" in
|
||||
burp-2*)
|
||||
# check for burp server
|
||||
|
||||
@@ -40,7 +40,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -54,7 +54,7 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -86,7 +86,7 @@ case "${LINUX_INIT}" in
|
||||
esac
|
||||
|
||||
# 2) try the pgrep way (note: old pgreps do not support '-c')
|
||||
if (( _RC != 0 ))
|
||||
if (( _RC > 0 ))
|
||||
then
|
||||
(( $(pgrep -u root burp 2>>${HC_STDERR_LOG} | wc -l 2>/dev/null) == 0 )) && _STC=1
|
||||
fi
|
||||
|
||||
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -105,7 +105,7 @@ do
|
||||
_STC=1
|
||||
else
|
||||
_AGE_CHECK=$(find "${_FILE_DIR}" -type f -name "${_FILE_NAME}" -mmin -"${_FILE_AGE}" 2>/dev/null)
|
||||
if (( $? != 0 ))
|
||||
if (( $? > 0 ))
|
||||
then
|
||||
warn "unable to execute file age test for ${_FILE_PATH}"
|
||||
return 1
|
||||
|
||||
@@ -40,7 +40,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -298,7 +298,7 @@ do
|
||||
fi
|
||||
|
||||
# bounce failures back and jump to next file
|
||||
if (( _STC != 0 ))
|
||||
if (( _STC > 0 ))
|
||||
then
|
||||
log_hc "$0" ${_STC} "${_MSG}"
|
||||
continue
|
||||
@@ -328,7 +328,7 @@ do
|
||||
done <${_TMP1_FILE}
|
||||
|
||||
# update state file (also if TMP2_FILE is empty)
|
||||
if (( ARG_LOG != 0 ))
|
||||
if (( ARG_LOG > 0 ))
|
||||
then
|
||||
[[ -s ${_TMP2_FILE} ]] || {
|
||||
warn "no files found to check, zeroing new state file"
|
||||
|
||||
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -55,7 +55,7 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -82,9 +82,9 @@ do
|
||||
;;
|
||||
*)
|
||||
_MSG="${_FS} is multiple times mounted?"
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# handle unit result
|
||||
log_hc "$0" ${_STC} "${_MSG}"
|
||||
_STC=0
|
||||
|
||||
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -133,7 +133,7 @@ esac
|
||||
# check for dependencies: we need to do DO_ACU_CTRL to have the slot info for all
|
||||
# the other checks
|
||||
_DO_CHECK=$(( _DO_ACU_ENCL + _DO_ACU_PHYS + _DO_ACU_LOGL ))
|
||||
if (( _DO_CHECK != 0 && _DO_ACU_CTRL == 0 ))
|
||||
if (( _DO_CHECK > 0 && _DO_ACU_CTRL == 0 ))
|
||||
then
|
||||
log "switching setting 'do_acu_controller' to 1 to fetch slot info"
|
||||
_DO_ACU_CTRL=1
|
||||
@@ -148,10 +148,10 @@ fi
|
||||
|
||||
# --- perform checks ---
|
||||
# CONTROLLER(s)
|
||||
if (( _DO_ACU_CTRL != 0 ))
|
||||
if (( _DO_ACU_CTRL > 0 ))
|
||||
then
|
||||
${_HPACUCLI_BIN} controller all show status >${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && warn "'${_HPACUCLI_BIN} controller all show status' exited non-zero"
|
||||
(( $? > 0 )) && warn "'${_HPACUCLI_BIN} controller all show status' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail.*)" ${_TMP_FILE} 2>/dev/null |\
|
||||
while read _ACU_LINE
|
||||
@@ -183,13 +183,13 @@ else
|
||||
fi
|
||||
|
||||
# ENCLOSURE(s)
|
||||
if (( _DO_ACU_ENCL != 0 ))
|
||||
if (( _DO_ACU_ENCL > 0 ))
|
||||
then
|
||||
for _CTRL_SLOT in ${_SLOT_NUMS}
|
||||
do
|
||||
${_HPACUCLI_BIN} controller slot=${_CTRL_SLOT} enclosure all show \
|
||||
>${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && \
|
||||
(( $? > 0 )) && \
|
||||
warn "'${_HPACUCLI_BIN} controller slot=${_CTRL_SLOT} enclosure all show' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail.*)" ${_TMP_FILE} 2>/dev/null |\
|
||||
@@ -208,13 +208,13 @@ else
|
||||
fi
|
||||
|
||||
# PHYSICAL DRIVE(s)
|
||||
if (( _DO_ACU_PHYS != 0 ))
|
||||
if (( _DO_ACU_PHYS > 0 ))
|
||||
then
|
||||
for _CTRL_SLOT in ${_SLOT_NUMS}
|
||||
do
|
||||
${_HPACUCLI_BIN} controller slot=${_CTRL_SLOT} physicaldrive all show status \
|
||||
>${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && \
|
||||
(( $? > 0 )) && \
|
||||
warn "'${_HPACUCLI_BIN} controller slot=${_CTRL_SLOT} physicaldrive all show status' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail.*)" ${_TMP_FILE} 2>/dev/null |\
|
||||
@@ -233,13 +233,13 @@ else
|
||||
fi
|
||||
|
||||
# LOGICAL DRIVE(s)
|
||||
if (( _DO_ACU_LOGL != 0 ))
|
||||
if (( _DO_ACU_LOGL > 0 ))
|
||||
then
|
||||
for _CTRL_SLOT in ${_SLOT_NUMS}
|
||||
do
|
||||
${_HPACUCLI_BIN} controller slot=${_CTRL_SLOT} logicaldrive all show status \
|
||||
>${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && \
|
||||
(( $? > 0 )) && \
|
||||
warn "'${_HPACUCLI_BIN} controller slot=${_CTRL_SLOT}logicaldrive all show status' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail)" ${_TMP_FILE} 2>/dev/null |\
|
||||
|
||||
@@ -40,7 +40,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -156,10 +156,10 @@ fi
|
||||
|
||||
# --- perform checks ---
|
||||
# SHOW FANS
|
||||
if (( _DO_ASM_FANS != 0 ))
|
||||
if (( _DO_ASM_FANS > 0 ))
|
||||
then
|
||||
${_HPASMCLI_BIN} -s 'SHOW FANS' >${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW FANS' exited non-zero"
|
||||
(( $? > 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW FANS' exited non-zero"
|
||||
# look for failures
|
||||
grep -E -e '^#' ${_TMP_FILE} 2>/dev/null | grep -vi 'normal' 2>/dev/null |\
|
||||
while read _ASM_LINE
|
||||
@@ -177,10 +177,10 @@ else
|
||||
fi
|
||||
|
||||
# SHOW DIMM
|
||||
if (( _DO_ASM_DIMM != 0 ))
|
||||
if (( _DO_ASM_DIMM > 0 ))
|
||||
then
|
||||
${_HPASMCLI_BIN} -s 'SHOW DIMM' >${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW DIMM' exited non-zero"
|
||||
(( $? > 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW DIMM' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail)" ${_TMP_FILE} 2>/dev/null |\
|
||||
while read _ASM_LINE
|
||||
@@ -197,10 +197,10 @@ else
|
||||
fi
|
||||
|
||||
# SHOW POWERSUPPLY
|
||||
if (( _DO_ASM_POWR != 0 ))
|
||||
if (( _DO_ASM_POWR > 0 ))
|
||||
then
|
||||
${_HPASMCLI_BIN} -s 'SHOW POWERSUPPLY' >${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW POWERSUPPLY' exited non-zero"
|
||||
(( $? > 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW POWERSUPPLY' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail)" ${_TMP_FILE} 2>/dev/null |\
|
||||
while read _ASM_LINE
|
||||
@@ -217,10 +217,10 @@ else
|
||||
fi
|
||||
|
||||
# SHOW SERVER
|
||||
if (( _DO_ASM_SRVR != 0 ))
|
||||
if (( _DO_ASM_SRVR > 0 ))
|
||||
then
|
||||
${_HPASMCLI_BIN} -s 'SHOW SERVER' >${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW SERVER' exited non-zero"
|
||||
(( $? > 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW SERVER' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail)" ${_TMP_FILE} 2>/dev/null |\
|
||||
while read _ASM_LINE
|
||||
@@ -237,10 +237,10 @@ else
|
||||
fi
|
||||
|
||||
# SHOW TEMP
|
||||
if (( _DO_ASM_TEMP != 0 ))
|
||||
if (( _DO_ASM_TEMP > 0 ))
|
||||
then
|
||||
${_HPASMCLI_BIN} -s 'SHOW TEMP' >${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW TEMP' exited non-zero"
|
||||
(( $? > 0 )) && warn "'${_HPASMCLI_BIN} -s SHOW TEMP' exited non-zero"
|
||||
# look for failures
|
||||
grep -E -e '^#' ${_TMP_FILE} 2>/dev/null |\
|
||||
while read _ASM_LINE
|
||||
|
||||
@@ -40,7 +40,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -114,11 +114,11 @@ fi
|
||||
|
||||
# get hplog output
|
||||
${_HPLOG_BIN} -v >${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
|
||||
(( $? != 0 )) && {
|
||||
(( $? > 0 )) && {
|
||||
_MSG="unable to run ${_HPLOG_BIN}"
|
||||
log_hc "$0" 1 "${_MSG}"
|
||||
# dump debug info
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -133,7 +133,7 @@ esac
|
||||
# check for dependencies: we need to do DO_SSA_CTRL to have the slot info for all
|
||||
# the other checks
|
||||
_DO_CHECK=$(( _DO_SSA_ENCL + _DO_SSA_PHYS + _DO_SSA_LOGL ))
|
||||
if (( _DO_CHECK != 0 && _DO_SSA_CTRL == 0 ))
|
||||
if (( _DO_CHECK > 0 && _DO_SSA_CTRL == 0 ))
|
||||
then
|
||||
log "switching setting 'do_ssa_controller' to 1 to fetch slot info"
|
||||
_DO_SSA_CTRL=1
|
||||
@@ -148,10 +148,10 @@ fi
|
||||
|
||||
# --- perform checks ---
|
||||
# CONTROLLER(s)
|
||||
if (( _DO_SSA_CTRL != 0 ))
|
||||
if (( _DO_SSA_CTRL > 0 ))
|
||||
then
|
||||
${_HPSSACLI_BIN} controller all show status >${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && warn "'${_HPSSACLI_BIN} controller all show status' exited non-zero"
|
||||
(( $? > 0 )) && warn "'${_HPSSACLI_BIN} controller all show status' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail.*)" ${_TMP_FILE} 2>/dev/null |\
|
||||
while read _SSA_LINE
|
||||
@@ -183,13 +183,13 @@ else
|
||||
fi
|
||||
|
||||
# ENCLOSURE(s)
|
||||
if (( _DO_SSA_ENCL != 0 ))
|
||||
if (( _DO_SSA_ENCL > 0 ))
|
||||
then
|
||||
for _CTRL_SLOT in ${_SLOT_NUMS}
|
||||
do
|
||||
${_HPSSACLI_BIN} controller slot=${_CTRL_SLOT} enclosure all show \
|
||||
>${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && \
|
||||
(( $? > 0 )) && \
|
||||
warn "'${_HPSSACLI_BIN} controller slot=${_CTRL_SLOT} enclosure all show' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail.*)" ${_TMP_FILE} 2>/dev/null |\
|
||||
@@ -208,13 +208,13 @@ else
|
||||
fi
|
||||
|
||||
# PHYSICAL DRIVE(s)
|
||||
if (( _DO_SSA_PHYS != 0 ))
|
||||
if (( _DO_SSA_PHYS > 0 ))
|
||||
then
|
||||
for _CTRL_SLOT in ${_SLOT_NUMS}
|
||||
do
|
||||
${_HPSSACLI_BIN} controller slot=${_CTRL_SLOT} physicaldrive all show status \
|
||||
>${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && \
|
||||
(( $? > 0 )) && \
|
||||
warn "'${_HPSSACLI_BIN} controller slot=${_CTRL_SLOT} physicaldrive all show status' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail.*)" ${_TMP_FILE} 2>/dev/null |\
|
||||
@@ -233,13 +233,13 @@ else
|
||||
fi
|
||||
|
||||
# LOGICAL DRIVE(s)
|
||||
if (( _DO_SSA_LOGL != 0 ))
|
||||
if (( _DO_SSA_LOGL > 0 ))
|
||||
then
|
||||
for _CTRL_SLOT in ${_SLOT_NUMS}
|
||||
do
|
||||
${_HPSSACLI_BIN} controller slot=${_CTRL_SLOT} logicaldrive all show status \
|
||||
>${_TMP_FILE} 2>${_TMP_FILE}
|
||||
(( $? != 0 )) && \
|
||||
(( $? > 0 )) && \
|
||||
warn "'${_HPSSACLI_BIN} controller slot=${_CTRL_SLOT}logicaldrive all show status' exited non-zero"
|
||||
# look for failures
|
||||
grep -i -E -e "(nok|fail)" ${_TMP_FILE} 2>/dev/null |\
|
||||
|
||||
@@ -41,7 +41,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -56,7 +56,7 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -90,7 +90,7 @@ case "${LINUX_INIT}" in
|
||||
esac
|
||||
|
||||
# 2) try the pgrep way (note: old pgreps do not support '-c')
|
||||
if (( _RC != 0 ))
|
||||
if (( _RC > 0 ))
|
||||
then
|
||||
(( $(pgrep -u root httpd 2>>${HC_STDERR_LOG} | wc -l 2>/dev/null) == 0 )) && _STC=1
|
||||
fi
|
||||
@@ -136,7 +136,7 @@ cat <<- EOT
|
||||
NAME : $1
|
||||
VERSION : $2
|
||||
CONFIG : $3
|
||||
PURPOSE : Checks whether httpd (apache service) is running and whether the
|
||||
PURPOSE : Checks whether httpd (apache service) is running and whether the
|
||||
httpd configuration files are syntactically correct
|
||||
|
||||
EOT
|
||||
|
||||
@@ -38,7 +38,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -55,7 +55,7 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -101,7 +101,7 @@ case "${LINUX_INIT}" in
|
||||
esac
|
||||
|
||||
# 2) try the pgrep way (note: old pgreps do not support '-c')
|
||||
if (( _RC != 0 ))
|
||||
if (( _RC > 0 ))
|
||||
then
|
||||
(( $(pgrep -u root named 2>>${HC_STDERR_LOG} | wc -l 2>/dev/null) == 0 )) && _STC=1
|
||||
fi
|
||||
|
||||
@@ -47,7 +47,7 @@ typeset _NTPQ_BIN="/usr/sbin/ntpq"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -123,7 +123,7 @@ else
|
||||
_MSG="unable to find chronyd or ntpd"
|
||||
log_hc "$0" 1 "${_MSG}"
|
||||
# dump debug info
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -177,7 +177,7 @@ case "${LINUX_INIT}" in
|
||||
esac
|
||||
|
||||
# 2) try the pgrep way (note: old pgreps do not support '-c')
|
||||
if (( _RC != 0 ))
|
||||
if (( _RC > 0 ))
|
||||
then
|
||||
if (( _USE_CHRONYD > 0 ))
|
||||
then
|
||||
@@ -227,7 +227,7 @@ then
|
||||
_MSG="unable to execute {${_CHRONYC_BIN}}"
|
||||
log_hc "$0" 1 "${_MSG}"
|
||||
# dump debug info
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#
|
||||
# @(#) HISTORY:
|
||||
# @(#) 2016-12-01: initial version [Patrick Van der Veken]
|
||||
# @(#) 2017-05-08: suppress errors on postfix call + fix fall-back
|
||||
# @(#) 2017-05-08: suppress errors on postfix call + fix fall-back
|
||||
# @(#) for sysv->pgrep[Patrick Van der Veken]
|
||||
# @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken]
|
||||
# -----------------------------------------------------------------------------
|
||||
@@ -41,7 +41,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -56,7 +56,7 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -89,7 +89,7 @@ case "${LINUX_INIT}" in
|
||||
esac
|
||||
|
||||
# 2) try the postfix way
|
||||
if (( _RC != 0 ))
|
||||
if (( _RC > 0 ))
|
||||
then
|
||||
_POSTFIX_BIN="$(which postfix 2>>${HC_STDERR_LOG})"
|
||||
if [[ -x ${_POSTFIX_BIN} && -n "${_POSTFIX_BIN}" ]]
|
||||
|
||||
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -146,7 +146,7 @@ do
|
||||
case "${_PROCESS_LIMIT}" in
|
||||
"Max open files")
|
||||
# collect ps info
|
||||
(( ARG_DEBUG != 0 )) && debug "${_PROCESS_LIMIT}: collecting information for process class ${_PROCESS}"
|
||||
(( ARG_DEBUG > 0 )) && debug "${_PROCESS_LIMIT}: collecting information for process class ${_PROCESS}"
|
||||
_PROCESS_PS=$(_get_psinfo_by_process "${_PROCESS}")
|
||||
if [[ -z "${_PROCESS_PS}" ]]
|
||||
then
|
||||
@@ -155,7 +155,7 @@ do
|
||||
fi
|
||||
print "${_PROCESS_PS}" | while read _PROCESS_PS_PID _PROCESS_PS_USER
|
||||
do
|
||||
(( ARG_DEBUG != 0 )) && debug "${_PROCESS_LIMIT}: checking process ${_PROCESS_PS_PID}"
|
||||
(( ARG_DEBUG > 0 )) && debug "${_PROCESS_LIMIT}: checking process ${_PROCESS_PS_PID}"
|
||||
# get current values and check thresholds
|
||||
_MAX_OPEN_FILES=$(_get_open_files ${_PROCESS_PS_PID})
|
||||
# SOFT limit
|
||||
@@ -210,7 +210,7 @@ do
|
||||
case "${_USER_LIMIT}" in
|
||||
"Max open files")
|
||||
# collect ps info
|
||||
(( ARG_DEBUG != 0 )) && debug "${_USER_LIMIT}: collecting information for user ${_USER}"
|
||||
(( ARG_DEBUG > 0 )) && debug "${_USER_LIMIT}: collecting information for user ${_USER}"
|
||||
_USER_PS=$(_get_psinfo_by_user "${_USER}")
|
||||
if [[ -z "${_USER_PS}" ]]
|
||||
then
|
||||
@@ -219,7 +219,7 @@ do
|
||||
fi
|
||||
print "${_USER_PS}" | while read _USER_PS_PID _USER_PS_COMM
|
||||
do
|
||||
(( ARG_DEBUG != 0 )) && debug "${_USER_LIMIT}: checking process ${_USER_PS_PID}"
|
||||
(( ARG_DEBUG > 0 )) && debug "${_USER_LIMIT}: checking process ${_USER_PS_PID}"
|
||||
# get current values and check thresholds
|
||||
_MAX_OPEN_FILES=$(_get_open_files ${_USER_PS_PID})
|
||||
# SOFT limit
|
||||
@@ -231,7 +231,7 @@ do
|
||||
done
|
||||
;;
|
||||
"Max processes")
|
||||
(( ARG_DEBUG != 0 )) && debug "${_USER_LIMIT}: collecting information for user ${_USER}"
|
||||
(( ARG_DEBUG > 0 )) && debug "${_USER_LIMIT}: collecting information for user ${_USER}"
|
||||
_MAX_PROCESSES=$(_get_processes ${_USER})
|
||||
# SOFT limit
|
||||
_check_limit "${_USER_LIMIT}" soft 0 ${_USER} "" ${_USER_SOFT_THRESHOLD} \
|
||||
@@ -259,7 +259,7 @@ return 0
|
||||
#1992 root
|
||||
function _get_psinfo_by_process
|
||||
{
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
|
||||
ps -C "${1}" -o pid:1,user:1 --no-headers 2>/dev/null
|
||||
|
||||
@@ -272,7 +272,7 @@ return 0
|
||||
#8539 pickup
|
||||
function _get_psinfo_by_user
|
||||
{
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
|
||||
ps -U "${1}" -o pid:1,comm:1 --no-headers 2>/dev/null
|
||||
|
||||
@@ -293,7 +293,7 @@ typeset _LIMIT_COMMAND=""
|
||||
typeset _LIMIT_ENTRY=""
|
||||
typeset _LIMIT_FIELD=0
|
||||
typeset _MSG_BIT=""
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
|
||||
# check for empties
|
||||
(( _LIMIT_PID == 0 )) && _LIMIT_PID="N/A"
|
||||
@@ -370,7 +370,7 @@ return 0
|
||||
# -----------------------------------------------------------------------------
|
||||
function _get_open_files
|
||||
{
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
|
||||
ls -f /proc/${1}/fd/ 2>/dev/null | wc -l 2>/dev/null
|
||||
|
||||
@@ -380,7 +380,7 @@ return 0
|
||||
# -----------------------------------------------------------------------------
|
||||
function _get_processes
|
||||
{
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
|
||||
ps -U ${1} --no-headers 2>/dev/null | wc -l 2>/dev/null
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -54,13 +54,13 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# handle configuration file
|
||||
[[ -n "${ARG_CONFIG_FILE}" ]] && _CONFIG_FILE="${ARG_CONFIG_FILE}"
|
||||
if [[ ! -r ${_CONFIG_FILE} ]]
|
||||
if [[ ! -r ${_CONFIG_FILE} ]]
|
||||
then
|
||||
warn "unable to read configuration file at ${_CONFIG_FILE}"
|
||||
return 1
|
||||
@@ -92,7 +92,7 @@ then
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# perform check
|
||||
grep -v -E -e '^$' -e '^#' ${_CONFIG_FILE} 2>/dev/null | while read _CRON_ENTRY
|
||||
do
|
||||
@@ -102,15 +102,15 @@ do
|
||||
0)
|
||||
_MSG="'${_CRON_ENTRY}' is not configured in cron"
|
||||
_STC=1
|
||||
;;
|
||||
;;
|
||||
1)
|
||||
_MSG="'${_CRON_ENTRY}' is configured in cron"
|
||||
;;
|
||||
+([0-9])*([0-9]))
|
||||
_MSG="'${_CRON_ENTRY}' is configured multiple times in cron"
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# handle unit result
|
||||
log_hc "$0" ${_STC} "${_MSG}"
|
||||
_STC=0
|
||||
|
||||
@@ -43,7 +43,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -57,7 +57,7 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -98,7 +98,7 @@ case "${LINUX_INIT}" in
|
||||
esac
|
||||
|
||||
# 2) try the pgrep way (note: old pgreps do not support '-c')
|
||||
if (( _RC != 0 ))
|
||||
if (( _RC > 0 ))
|
||||
then
|
||||
(( $(pgrep -u root nmbd 2>>${HC_STDERR_LOG}| wc -l 2>/dev/null) == 0 )) && _STC=1
|
||||
(( $(pgrep -u root smbd 2>>${HC_STDERR_LOG} | wc -l 2>/dev/null) == 0 )) && _STC=$(( _STC + 2 ))
|
||||
|
||||
@@ -42,7 +42,7 @@ typeset _SG_CMGETCONF_FILTER="Permission denied|Number of configured"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
PATH=$PATH:/opt/cmcluster/bin
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
@@ -109,7 +109,7 @@ else
|
||||
_MSG="unable to gather cluster configuration"
|
||||
log_hc "$0" 1 "${_MSG}"
|
||||
# dump debug info
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
return 0
|
||||
}
|
||||
done
|
||||
|
||||
@@ -42,7 +42,7 @@ typeset _SG_DAEMON="/opt/cmcluster/bin/cmcld"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
PATH=$PATH:/opt/cmcluster/bin
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
@@ -80,11 +80,11 @@ then
|
||||
return 1
|
||||
else
|
||||
cmviewcl -v -f line 2>>${HC_STDERR_LOG} | tr '|' ':' >>${HC_STDOUT_LOG} 2>/dev/null
|
||||
(( $? != 0 )) && {
|
||||
(( $? > 0 )) && {
|
||||
_MSG="unable to run command: {cmviewcl}"
|
||||
log_hc "$0" 1 "${_MSG}"
|
||||
# dump debug info
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
return 0
|
||||
}
|
||||
fi
|
||||
|
||||
@@ -42,7 +42,7 @@ typeset _SG_CMGETCONF_FILTER="Permission denied|Number of configured"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
PATH=$PATH:/opt/cmcluster/bin
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
@@ -109,7 +109,7 @@ else
|
||||
_MSG="unable to gather package configuration for at least one cluster package"
|
||||
log_hc "$0" 1 "${_MSG}"
|
||||
# dump debug info
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
return 0
|
||||
}
|
||||
done
|
||||
|
||||
@@ -42,7 +42,7 @@ typeset _SG_DAEMON="/opt/cmcluster/bin/cmcld"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
PATH=$PATH:/opt/cmcluster/bin
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
@@ -81,11 +81,11 @@ then
|
||||
return 1
|
||||
else
|
||||
cmviewcl -v -f line -l package 2>>${HC_STDERR_LOG} | tr '|' ':' >>${HC_STDOUT_LOG}
|
||||
(( $? != 0)) && {
|
||||
(( $? > 0)) && {
|
||||
_MSG="unable to run command: {cmviewcl}"
|
||||
log_hc "$0" 1 "${_MSG}"
|
||||
# dump debug info
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
return 0
|
||||
}
|
||||
fi
|
||||
|
||||
@@ -39,7 +39,7 @@ typeset _QS_AUTH_FILE="/opt/qs/conf/qs_authfile"
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
|
||||
@@ -37,7 +37,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -50,7 +50,7 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -96,7 +96,7 @@ cat <<- EOT
|
||||
NAME : $1
|
||||
VERSION : $2
|
||||
CONFIG : $3
|
||||
PURPOSE : Checks whether shorewall (firewall) service is running and whether
|
||||
PURPOSE : Checks whether shorewall (firewall) service is running and whether
|
||||
shorewall rules compile correctly
|
||||
|
||||
EOT
|
||||
|
||||
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -55,7 +55,7 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -99,7 +99,7 @@ case "${LINUX_INIT}" in
|
||||
esac
|
||||
|
||||
# 2) try the pgrep way (note: old pgreps do not support '-c')
|
||||
if (( _RC != 0 ))
|
||||
if (( _RC > 0 ))
|
||||
then
|
||||
(( $(pgrep -P 1 -u root sshd 2>>${HC_STDERR_LOG} | wc -l 2>/dev/null) == 0 )) && _STC=1
|
||||
fi
|
||||
|
||||
@@ -44,7 +44,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -80,11 +80,11 @@ fi
|
||||
|
||||
# get container stati
|
||||
${_VZLIST_BIN} -a -H -o ctid,status,onboot >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
|
||||
(( $? != 0 )) && {
|
||||
(( $? > 0 )) && {
|
||||
_MSG="unable to run command: {vzlist}"
|
||||
log_hc "$0" 1 "${_MSG}"
|
||||
# dump debug info
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match
|
||||
# ------------------------- CONFIGURATION ends here ---------------------------
|
||||
|
||||
# set defaults
|
||||
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS}
|
||||
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
|
||||
typeset _ARGS=$(data_space2comma "$*")
|
||||
typeset _ARG=""
|
||||
@@ -55,7 +55,7 @@ do
|
||||
case "${_ARG}" in
|
||||
help)
|
||||
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -87,7 +87,7 @@ case "${LINUX_INIT}" in
|
||||
esac
|
||||
|
||||
# 2) try the pgrep way (note: old pgreps do not support '-c')
|
||||
if (( _RC != 0 ))
|
||||
if (( _RC > 0 ))
|
||||
then
|
||||
(( $(pgrep -u root winbind 2>>${HC_STDERR_LOG} | wc -l 2>/dev/null) == 0 )) && _STC=1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user