Code cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user