Code cleanup

This commit is contained in:
patvdv
2018-11-04 19:57:20 +01:00
parent 0e6469e477
commit ba8f336945
78 changed files with 395 additions and 393 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="AIX" # 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=""
@@ -38,7 +38,7 @@ typeset _SUPPORTED_PLATFORMS="AIX" # 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=""
@@ -104,7 +104,7 @@ do
_STC=1
else
_AGE_CHECK=$(find "${_FILE_DIR}" -type f -name "${_FILE_NAME}" -mmin -"${_FILE_AGE}")
if (( $? != 0 ))
if (( $? > 0 ))
then
warn "unable to execute file age test for ${_FILE_PATH}"
return 1
@@ -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=""
@@ -297,7 +297,7 @@ do
fi
# bounce failures back and jump to next file
if (( _STC != 0 ))
if (( _STC > 0 ))
then
log_hc "$0" ${_STC} "${_MSG}"
continue
@@ -327,7 +327,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"
@@ -36,7 +36,7 @@ typeset _SUPPORTED_PLATFORMS="AIX" # 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=""
@@ -51,7 +51,7 @@ do
case "${_ARG}" in
help)
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
;;
;;
esac
done
@@ -79,9 +79,9 @@ do
;;
*)
_MSG="${_FS} is multiple times mounted?"
;;
;;
esac
# handle unit result
log_hc "$0" ${_STC} "${_MSG}"
_STC=0
+2 -2
View File
@@ -36,7 +36,7 @@ typeset _SUPPORTED_PLATFORMS="AIX" # 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=""
@@ -49,7 +49,7 @@ do
case "${_ARG}" in
help)
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
;;
;;
esac
done
+3 -3
View File
@@ -36,7 +36,7 @@ typeset _SUPPORTED_PLATFORMS="AIX" # 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
@@ -69,7 +69,7 @@ case ${_PATH} in
_STC=1
;;
esac
# handle results
log_hc "$0" ${_STC} "${_MSG}"
@@ -37,7 +37,7 @@ typeset _SUPPORTED_PLATFORMS="AIX" # 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=""
@@ -52,14 +52,14 @@ 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
@@ -77,15 +77,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
@@ -37,7 +37,7 @@ typeset _SUPPORTED_PLATFORMS="AIX" # 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=""
@@ -51,14 +51,14 @@ 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
@@ -82,9 +82,9 @@ do
;;
*)
_MSG="${_SUBSYS} is not on file"
;;
;;
esac
# handle unit result
log_hc "$0" ${_STC} "${_MSG}"
_STC=0
+16 -16
View File
@@ -17,7 +17,7 @@
# DOCUMENTATION (MAIN)
# -----------------------------------------------------------------------------
# @(#) MAIN: check_aix_sysbackup
# DOES: see _show_usage()
# DOES: see _show_usage()
# EXPECTS: see _show_usage()
# REQUIRES: data_space2comma(), init_hc(), log_hc()
#
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="AIX" # 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=""
@@ -59,13 +59,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
@@ -93,7 +93,7 @@ case "${_BACKUP_AGE}" in
+([0-9])*(.)*([0-9]))
# numeric, OK
;;
*)
*)
# not numeric, set default
_BACKUP_AGE=14
;;
@@ -118,21 +118,21 @@ do
# save log
print "=== ${_BACKUP_HOST} ===" >>${HC_STDOUT_LOG}
cat ${_BACKUP_LOG} >>${HC_STDOUT_LOG}
;;
;;
*)
_MSG="sysbackup status for ${_BACKUP_HOST}: failed"
_STC=1
print "=== ${_BACKUP_HOST} ===" >>${HC_STDOUT_LOG}
cat ${_BACKUP_LOG} >>${HC_STDOUT_LOG}
;;
;;
esac
else
# don't flag this as erroneous, we could drop into this fork for
# VIO servers for example without mksysb but having backupios instead
# VIO servers for example without mksysb but having backupios instead
# caveat emptor: also means that hosts *without* backup go undetected
continue
fi
# handle unit result
log_hc "$0" ${_STC} "${_MSG}"
_STC=0
@@ -148,25 +148,25 @@ do
if (( _COUNT == 0 ))
then
_MSG="sysbackup age for ${_BACKUP_HOST}: <=${_BACKUP_AGE} days"
_STC=0
_STC=0
else
_MSG="sysbackup age for ${_BACKUP_HOST}: >${_BACKUP_AGE} days"
_STC=1
print "=== ${_BACKUP_HOST} ===" >>${HC_STDOUT_LOG}
print "age: $(ls -l ${_BACKUP_LOG})" >>${HC_STDOUT_LOG}
print "age: $(ls -l ${_BACKUP_LOG})" >>${HC_STDOUT_LOG}
fi
else
# don't flag this as erroneous, we could drop into this fork for
# VIO servers for example without mksysb but having backupios instead
# VIO servers for example without mksysb but having backupios instead
# caveat emptor: also means that hosts *without* backup go undetected
continue
fi
# handle unit result
log_hc "$0" ${_STC} "${_MSG}"
_STC=0
done
return 0
}
@@ -180,9 +180,9 @@ CONFIG : $3 with:
backup_path=<location_of_mksysb_images>
mksysb_log=<name_of_standard_standard_mksysb_log>
backup_age=<days_till_last_backup>
PURPOSE : Checks the state of saved mksysb client backups (should typically be
PURPOSE : Checks the state of saved mksysb client backups (should typically be
run only on the NIM master or server that is acting as mksysb repo,
do NOT run on a typical client LPAR)
do NOT run on a typical client LPAR)
EOT
@@ -37,7 +37,7 @@ typeset _SUPPORTED_PLATFORMS="AIX" # 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=""
@@ -52,7 +52,7 @@ do
case "${_ARG}" in
help)
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
;;
;;
esac
done
@@ -64,11 +64,11 @@ topasrec -l >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
_TOPAS=$(grep -c "bin" ${HC_STDOUT_LOG} 2>/dev/null)
_NMON=$(grep -c "nmon" ${HC_STDOUT_LOG} 2>/dev/null)
_MSG="process checks: nmon=${_NMON}; topasrec=${_TOPAS}"
if (( _NMON != 1 || _TOPAS != 1 ))
if (( _NMON > 1 || _TOPAS > 1 ))
then
_STC=1
fi
# handle results
log_hc "$0" ${_STC} "${_MSG}"
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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,12 +55,12 @@ do
case "${_ARG}" in
help)
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
;;
;;
esac
done
# check autopath presence
if [[ ! -x ${_AUTOPATH_BIN} ]]
if [[ ! -x ${_AUTOPATH_BIN} ]]
then
warn "${_AUTOPATH_BIN} is not installed here"
return 1
@@ -69,23 +69,23 @@ fi
# collect autopath info
log "collecting autopath information, this may take a while ..."
${_AUTOPATH_BIN} display >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
(( $? != 0 )) && {
(( $? > 0 )) && {
_MSG="unable to run {${_AUTOPATH_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
}
# check for device failures
grep -E -e "${_AUTOPATH_NEEDLE}" ${HC_STDOUT_LOG} 2>/dev/null |\
while read _AUTOPATH_LINE
do
_DEVICE="$(print ${_AUTOPATH_LINE} | cut -f1 -d' ')"
_DEVICE="$(print ${_AUTOPATH_LINE} | cut -f1 -d' ')"
_MSG="failed path for device '${_DEVICE}'"
_STC=1
_STC_COUNT=$(( _STC_COUNT + 1 ))
# handle unit result
log_hc "$0" ${_STC} "${_MSG}"
_STC=0
@@ -37,7 +37,7 @@ typeset _CDSF_BIN="/usr/sbin/io_cdsf_config"
# ------------------------- 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=""
@@ -79,7 +79,7 @@ else
# io_cdsf_config outputs on STDERR (run status & check)
# stable cluster: RC=0
${_CDSF_BIN} -s >${HC_STDOUT_LOG} 2>${HC_STDOUT_LOG}
(( $? != 0 )) && {
(( $? > 0 )) && {
log_hc "$0" 1 "cDSF cluster has not yet been initialized or is not stable"
return 0
}
@@ -44,7 +44,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -247,7 +247,7 @@ else
_MSG="unable to run command: {${_DRD_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
@@ -1,4 +1,4 @@
#!/usr/bin/env ksh
>#!/usr/bin/env ksh
#******************************************************************************
# @(#) check_hpux_file_age.sh
#******************************************************************************
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -109,13 +109,13 @@ do
if (( _DO_REF == 0 ))
then
REF_TIME=$(perl -e "use POSIX;\$t=time-(${_FILE_AGE}*60);print(strftime '%m%d%H%M',localtime(\$t))")
if (( $? != 0 ))
if (( $? > 0 ))
then
warn "failed to query reference time (Perl)"
return 1
fi
touch -amt "${REF_TIME}" ${_REF_FILE} >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
if (( $? != 0 ))
if (( $? > 0 ))
then
warn "failed to create reference time ${TMP_DIR}"
return 1
@@ -39,7 +39,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -297,7 +297,7 @@ do
fi
# bounce failures back and jump to next file
if (( _STC != 0 ))
if (( _STC > 0 ))
then
log_hc "$0" ${_STC} "${_MSG}"
continue
@@ -327,7 +327,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"
@@ -38,7 +38,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -53,7 +53,7 @@ do
case "${_ARG}" in
help)
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
;;
;;
esac
done
@@ -78,16 +78,16 @@ do
;;
*)
_MSG="${_FS} is multiple times mounted?"
;;
;;
esac
# handle unit result
log_hc "$0" ${_STC} "${_MSG}"
_STC=0
done
# add /etc/fstab to STDOUT log
cat /etc/fstab >>${HC_STDOUT_LOG}
cat /etc/fstab >>${HC_STDOUT_LOG}
return 0
}
@@ -40,7 +40,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -37,7 +37,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -74,7 +74,7 @@ else
fi
# 2) try the pgrep way (note: old pgreps do not support '-c')
if (( _RC != 0 ))
if (( _RC > 0 ))
then
# we need guidkeyd & guidd
(( $(pgrep -P 1 -u root guidd 2>>${HC_STDERR_LOG} | wc -l) == 0 )) && _STC=1
@@ -41,7 +41,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -76,11 +76,11 @@ then
fi
${_HPVMSTATUS_BIN} -M >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
(( $? != 0 )) && {
(( $? > 0 )) && {
_MSG="unable to run command: {${_HPVMSTATUS_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
}
@@ -38,7 +38,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -76,7 +76,7 @@ else
fi
# 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) == 0 )) && _STC=1
fi
@@ -43,7 +43,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -100,7 +100,7 @@ then
_MSG="unable to run command: cd /var/opt/ignite/clients"
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
@@ -185,7 +185,7 @@ then
_MSG="unable to run command: cd /var/opt/ignite/clients"
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
else
@@ -46,7 +46,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -127,12 +127,12 @@ else
fi
log "executing ioscan with options: ${_IOSCAN_OPTS}"
${_IOSCAN_BIN} ${_IOSCAN_OPTS} >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
if (( $? != 0 ))
if (( $? > 0 ))
then
_MSG="unable to run command: {${_IOSCAN_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
fi
@@ -41,7 +41,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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,12 +80,12 @@ then
return 1
else
${_KCTUNE_BIN} >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
if (( $? != 0 ))
if (( $? > 0 ))
then
_MSG="unable to gather kctune information"
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
fi
@@ -42,7 +42,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -97,11 +97,11 @@ then
return 1
else
${_KCUSAGE_BIN} >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
if (( $? != 0 ))
if (( $? > 0 ))
then
_MSG="unable to gather kcusage information"
# dump debug info
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
log_hc "$0" 1 "${_MSG}"
return 0
fi
@@ -176,7 +176,7 @@ do
# parameter excluded?
if (( $(print "${_EXCLUDED_PARAMS}" | tr ',' '\n' | grep -c -E -e "${_PARAM_NAME}") != 0 ))
then
(( ARG_DEBUG != 0 )) && debug "excluding kernel parameter ${_PARAM_NAME} ..."
(( ARG_DEBUG > 0 )) && debug "excluding kernel parameter ${_PARAM_NAME} ..."
continue
fi
@@ -42,7 +42,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -117,7 +117,7 @@ fi
}
# get all disk LUNs
(( ARG_DEBUG != 0 )) && debug "collecting ioscan information"
(( ARG_DEBUG > 0 )) && debug "collecting ioscan information"
print "=== ioscan ===" >>${HC_STDOUT_LOG}
${_IOSCAN_BIN} ${_IOSCAN_OPTS} >${_TMP1_FILE} 2>>${HC_STDERR_LOG}
if (( $? > 0 ))
@@ -125,24 +125,24 @@ then
_MSG="unable to gather ioscan information"
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
# collect scsimgr info for all LUNs
(( ARG_DEBUG != 0 )) && debug "collecting scsimgr information"
(( ARG_DEBUG > 0 )) && debug "collecting scsimgr information"
${_SCSIMGR_BIN} ${_SCSIMGR_OPTS} >${_TMP2_FILE} 2>>${HC_STDERR_LOG}
if (( $? > 0 ))
then
_MSG="unable to gather scsimgr information"
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
# parse ioscan + scsimgr results (WWID is the glue)
(( ARG_DEBUG != 0 )) && debug "glueing ioscan & scsimgr information together"
(( ARG_DEBUG > 0 )) && debug "glueing ioscan & scsimgr information together"
awk 'BEGIN { wwid = ""; active_paths = ""; all_paths = ""; failed_paths = ""; standby_paths = ""; }
{
@@ -37,7 +37,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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 _NAMED_CHECKCONF_BIN=""
typeset _NAMED_PID=""
@@ -75,7 +75,7 @@ else
fi
# 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) == 0 )) && _STC=1
fi
@@ -41,7 +41,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=""
@@ -43,7 +43,7 @@ typeset _OVPA_BIN="/opt/perf/bin/perfstat"
# ------------------------- 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=""
@@ -45,7 +45,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -163,7 +163,7 @@ then
_MSG="unable to run command: {${_SWLIST_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
else
@@ -209,7 +209,7 @@ then
_MSG="unable to run command: {${_SHOW_PATCHES_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
else
@@ -241,7 +241,7 @@ then
_MSG="unable to run command: {${_SWLIST_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
fi
@@ -36,7 +36,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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
@@ -37,7 +37,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -52,13 +52,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
@@ -76,20 +76,20 @@ 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
done
return 0
}
@@ -41,7 +41,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -238,7 +238,7 @@ then
# save cimprovider OUTPUT
print "${_CHECK_CIM_OUTPUT}" >>${HC_STDOUT_LOG}
# dump debug info
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
return 1
else
# find module
@@ -310,7 +310,7 @@ then
_MSG="unable to execute {${_SFMCONFIG_BIN} -t -a}, cimserver is probably not running"
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
else
# wait for test event to showing
@@ -326,7 +326,7 @@ then
# save evweb OUTPUT
print "${_CHECK_EVWEB_OUTPUT}" >>${HC_STDOUT_LOG}
# dump debug info
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
return 1
else
if [[ -n "${_CHECK_EVWEB_OUTPUT}" ]]
@@ -361,7 +361,7 @@ then
# save evweb OUTPUT
print "${_CHECK_EVWEB_OUTPUT}" >>${HC_STDOUT_LOG}
# dump debug info
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs
return 1
else
_CFG_EVENTS_SEVERITY=$(data_lc "${_CFG_EVENTS_SEVERITY}")
@@ -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}
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
typeset _ARGS=$(data_space2comma "$*")
typeset _ARG=""
@@ -42,7 +42,7 @@ typeset _SG_DAEMON="/usr/lbin/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}
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
typeset _ARGS=$(data_space2comma "$*")
typeset _ARG=""
@@ -79,11 +79,11 @@ then
return 1
else
cmviewcl -v -f line 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
@@ -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}
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
typeset _ARGS=$(data_space2comma "$*")
typeset _ARG=""
@@ -42,7 +42,7 @@ typeset _SG_DAEMON="/usr/lbin/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}
init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}"
typeset _ARGS=$(data_space2comma "$*")
typeset _ARG=""
@@ -80,11 +80,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="/etc/cmcluster/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=""
@@ -38,7 +38,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -75,7 +75,7 @@ else
fi
# 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) == 0 )) && _STC=1
fi
@@ -40,7 +40,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -132,7 +132,7 @@ then
warn "failed to sort temporary state file"
return 1
}
if (( ARG_LOG != 0 ))
if (( ARG_LOG > 0 ))
then
mv ${_TMP_FILE} ${_STATE_FILE} >/dev/null 2>&1
(( $? > 0 )) && {
@@ -36,7 +36,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # 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=""
@@ -52,13 +52,13 @@ do
case "${_ARG}" in
help)
_show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0
;;
;;
esac
done
# get list of major and minor numbers for vgs
vgdisplay -F | cut -f1 -d':' | cut -f2 -d'=' | while read _VG
do
do
ls -l ${_VG}/group >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG}
done
@@ -70,13 +70,13 @@ then
do
_MSG="MAJ/MIN numbers combination '${_VG_DUPE}' is not unique"
_STC=1
# handle unit result
log_hc "$0" ${_STC} "${_MSG}"
done
else
_MSG="no VGs with duplicate MAJ/MIN numbers detected"
# handle unit result
log_hc "$0" ${_STC} "${_MSG}"
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=""
@@ -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