From c36c07eb2dc127940e438a9c0d540a4b1f2a4a2d Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Mon, 22 Oct 2018 11:47:33 +0200 Subject: [PATCH] Added exclude_filesets option in check_hpux_patch_version() --- configs/etc/check_hpux_patch_version.conf.dist | 4 ++++ sources/lib/platform/hp-ux/check_hpux_ovpa_status.sh | 2 +- sources/lib/platform/hp-ux/check_hpux_patch_version.sh | 10 ++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/configs/etc/check_hpux_patch_version.conf.dist b/configs/etc/check_hpux_patch_version.conf.dist index d4c2aec..49f5249 100644 --- a/configs/etc/check_hpux_patch_version.conf.dist +++ b/configs/etc/check_hpux_patch_version.conf.dist @@ -23,6 +23,10 @@ required_patches="" # [default: yes] check_filesets=yes +# list of filesets to exclude from the check (comma-separated list) +# [default: none] +exclude_filesets="" + #****************************************************************************** # End of FILE diff --git a/sources/lib/platform/hp-ux/check_hpux_ovpa_status.sh b/sources/lib/platform/hp-ux/check_hpux_ovpa_status.sh index 557a691..64cfb8b 100644 --- a/sources/lib/platform/hp-ux/check_hpux_ovpa_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_ovpa_status.sh @@ -92,6 +92,7 @@ else # convert commas and strip quotes _OVPA_DAEMONS=$(data_comma2space $(data_dequote "${_OVPA_DAEMONS}")) fi +log "will check daemons: ${_OVPA_DAEMONS}" _CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy') case "${_CFG_HEALTHY}" in yes|YES|Yes) @@ -128,7 +129,6 @@ else fi # do OVPA status checks -log "checking daemons: ${_OVPA_DAEMONS} ..." for _OVPA_DAEMON in ${_OVPA_DAEMONS} do # anchored grep here! diff --git a/sources/lib/platform/hp-ux/check_hpux_patch_version.sh b/sources/lib/platform/hp-ux/check_hpux_patch_version.sh index 95f9550..8031cef 100644 --- a/sources/lib/platform/hp-ux/check_hpux_patch_version.sh +++ b/sources/lib/platform/hp-ux/check_hpux_patch_version.sh @@ -90,6 +90,8 @@ then # default _CHECK_FILESETS="yes" fi +_EXCLUDE_FILESETS=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'exclude_filesets') +[[ -n "${_EXCLUDE_FILESETS}" ]] && log "excluding filesets: $(print ${_EXCLUDE_FILESETS})" _CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy') case "${_CFG_HEALTHY}" in yes|YES|Yes) @@ -228,8 +230,12 @@ then while read _FILESET_LINE do _FILESET=$(print "${_FILESET_LINE}" | awk '{print $1}' 2>/dev/null) - _MSG="fileset ${_FILESET} is not in a configured state" - log_hc "$0" 1 "${_MSG}" + # check exclude(s) + if [[ "${_EXCLUDE_FILESETS#*${_FILESET}}" = "${_EXCLUDE_FILESETS}" ]] + then + _MSG="fileset ${_FILESET} is not in a configured state" + log_hc "$0" 1 "${_MSG}" + fi done else _MSG="unable to run command: {${_SWLIST_BIN}}"