diff --git a/build/hpux/hc_hpux_platform/hc_hpux_platform.psf b/build/hpux/hc_hpux_platform/hc_hpux_platform.psf index e631e50..a234155 100644 --- a/build/hpux/hc_hpux_platform/hc_hpux_platform.psf +++ b/build/hpux/hc_hpux_platform/hc_hpux_platform.psf @@ -66,6 +66,7 @@ This is the OS/platform plugin package" file -m 755 check_hpux_file_change.sh file -m 755 check_hpux_fs_mounts.sh file -m 755 check_hpux_fs_mounts_options.sh + file -m 755 check_hpux_fs_usage.sh file -m 755 check_hpux_ignite_backup.sh file -m 755 check_hpux_ioscan.sh file -m 755 check_hpux_guid_status.sh @@ -108,6 +109,7 @@ This is the OS/platform plugin package" file -m 644 check_hpux_file_age.conf.dist file -m 644 check_hpux_file_change.conf.dist file -m 644 check_hpux_fs_mounts_options.conf.dist + file -m 644 check_hpux_fs_usage.conf.dist file -m 644 check_hpux_hpvm_vpar_status.conf.dist file -m 644 check_hpux_ignite_backup.conf.dist file -m 644 check_hpux_ioscan.conf.dist diff --git a/build/linux/SPECS/hc-linux-platform.spec b/build/linux/SPECS/hc-linux-platform.spec index 82eb185..1a7d335 100644 --- a/build/linux/SPECS/hc-linux-platform.spec +++ b/build/linux/SPECS/hc-linux-platform.spec @@ -13,8 +13,8 @@ URL: http://www.kudos.be Requires: ksh,hc-linux BuildArch: noarch BuildRoot: %{_topdir}/%{name}-%{version}-root - -%description + +%description The Health Checker is collection of scripts (plugins) designed to perform regular - but not intensive - health checks on UNIX/Linux systems. It provides plugins for AIX, HP-UX and Linux as well customer specific checks. Checks may include topics such file system mounts, process checks, file consistency etc. This package contains platform/OS specific plugins. @@ -31,6 +31,7 @@ cp ../SOURCES/lib/platform/linux/check_linux_burp_backup.sh $RPM_BUILD_ROOT/opt/ cp ../SOURCES/lib/platform/linux/check_linux_file_age.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_file_age.sh cp ../SOURCES/lib/platform/linux/check_linux_file_change.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_file_change.sh cp ../SOURCES/lib/platform/linux/check_linux_fs_mounts.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_fs_mounts.sh +cp ../SOURCES/lib/platform/linux/check_linux_fs_usage.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_fs_usage.sh cp ../SOURCES/lib/platform/linux/check_linux_burp_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_burp_status.sh cp ../SOURCES/lib/platform/linux/check_linux_httpd_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_httpd_status.sh cp ../SOURCES/lib/platform/linux/check_linux_named_status.sh $RPM_BUILD_ROOT/opt/hc/lib/platform/linux/check_linux_named_status.sh @@ -56,6 +57,7 @@ install -d -m 755 $RPM_BUILD_ROOT/etc/opt/hc cp ../SOURCES/etc/check_linux_burp_backup.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_burp_backup.conf.dist cp ../SOURCES/etc/check_linux_file_age.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_file_age.conf.dist cp ../SOURCES/etc/check_linux_file_change.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_file_change.conf.dist +cp ../SOURCES/etc/check_linux_fs_usage.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_fs_usage.conf.dist cp ../SOURCES/etc/check_linux_hpasmcli.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_hpasmcli.conf.dist cp ../SOURCES/etc/check_linux_hpacucli.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_hpacucli.conf.dist cp ../SOURCES/etc/check_linux_hplog.conf.dist $RPM_BUILD_ROOT/etc/opt/hc/check_linux_hplog.conf.dist @@ -112,6 +114,7 @@ echo "INFO: finished post-uninstall script" %attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_file_age.sh %attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_file_change.sh %attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_fs_mounts.sh +%attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_fs_usage.sh %attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_burp_status.sh %attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_httpd_status.sh %attr(755, root, root) /opt/hc/lib/platform/linux/check_linux_named_status.sh @@ -137,6 +140,7 @@ echo "INFO: finished post-uninstall script" %attr(644, root, root) /etc/opt/hc/check_linux_burp_backup.conf.dist %attr(644, root, root) /etc/opt/hc/check_linux_file_age.conf.dist %attr(644, root, root) /etc/opt/hc/check_linux_file_change.conf.dist +%attr(644, root, root) /etc/opt/hc/check_linux_fs_usage.conf.dist %attr(644, root, root) /etc/opt/hc/check_linux_hpasmcli.conf.dist %attr(644, root, root) /etc/opt/hc/check_linux_hpacucli.conf.dist %attr(644, root, root) /etc/opt/hc/check_linux_hplog.conf.dist @@ -155,6 +159,8 @@ echo "INFO: finished post-uninstall script" %attr(644, root, root) /etc/opt/hc/core/templates/mail_body.tpl-check_linux_root_crontab %changelog +* Tue Jan 22 2019 - 0.1.2 +- Added check_linux_fs_usage * Tue Jul 10 2018 - 0.1.1 - Added check_linux_process_limits * Sat Apr 21 2018 - 0.1.0 diff --git a/configs/etc/check_aix_file_age.conf.dist b/configs/etc/check_aix_file_age.conf.dist index 2ca409e..a229f1f 100644 --- a/configs/etc/check_aix_file_age.conf.dist +++ b/configs/etc/check_aix_file_age.conf.dist @@ -1,5 +1,5 @@ #****************************************************************************** -# @(#) check_aix_file_age.conf.dist +# @(#) check_aix_file_age.conf #****************************************************************************** # This is a configuration file for the check_aix_file_age HC plugin. # All lines starting with a '#' are comment lines. @@ -12,4 +12,4 @@ #****************************************************************************** # End of FILE -#****************************************************************************** \ No newline at end of file +#****************************************************************************** diff --git a/configs/etc/check_aix_root_crontab.conf.dist b/configs/etc/check_aix_root_crontab.conf.dist index 1bd33e9..5cb0ca9 100644 --- a/configs/etc/check_aix_root_crontab.conf.dist +++ b/configs/etc/check_aix_root_crontab.conf.dist @@ -1,5 +1,5 @@ #****************************************************************************** -# @(#) check_aix_root_crontab.conf.dist +# @(#) check_aix_root_crontab.conf #****************************************************************************** # This is a configuration file for the check_aix_root_crontab HC plugin. # All lines starting with a '#' are comment lines. @@ -13,4 +13,4 @@ #****************************************************************************** # End of FILE -#****************************************************************************** \ No newline at end of file +#****************************************************************************** diff --git a/configs/etc/check_aix_subsystems.conf.dist b/configs/etc/check_aix_subsystems.conf.dist index 2f5e119..9606027 100644 --- a/configs/etc/check_aix_subsystems.conf.dist +++ b/configs/etc/check_aix_subsystems.conf.dist @@ -1,5 +1,5 @@ #****************************************************************************** -# @(#) check_aix_subsystems.conf.dist +# @(#) check_aix_subsystems.conf #****************************************************************************** # This is a configuration file for the check_aix_subsystems HC plugin. # All lines starting with a '#' are comment lines. @@ -32,4 +32,4 @@ IBM.CSMAgentRM #****************************************************************************** # End of FILE -#****************************************************************************** \ No newline at end of file +#****************************************************************************** diff --git a/configs/etc/check_aix_sysbackup.conf.dist b/configs/etc/check_aix_sysbackup.conf.dist index 5600a0d..2fdbb04 100644 --- a/configs/etc/check_aix_sysbackup.conf.dist +++ b/configs/etc/check_aix_sysbackup.conf.dist @@ -1,5 +1,5 @@ #****************************************************************************** -# @(#) check_aix_sysbackup.conf.dist +# @(#) check_aix_sysbackup.conf #****************************************************************************** # This is a configuration file for the check_aix_sysbackup HC plugin. # All lines starting with a '#' are comment lines. @@ -19,4 +19,4 @@ backup_age=14 #****************************************************************************** # End of FILE -#****************************************************************************** \ No newline at end of file +#****************************************************************************** diff --git a/configs/etc/check_hpux_fs_mounts_options.conf.dist b/configs/etc/check_hpux_fs_mounts_options.conf.dist index d741aed..f7aa0b8 100644 --- a/configs/etc/check_hpux_fs_mounts_options.conf.dist +++ b/configs/etc/check_hpux_fs_mounts_options.conf.dist @@ -12,11 +12,11 @@ ignore_missing_fs=yes # specify mount points and their options (use the mount options as displayed # by the 'mount' command; order of the options is not important) -# [fs::] -fs:myfs1:myopts1 -fs:myfs2:myopts2 +# [fs::] +#fs:my_fs1:my_opts1 +#fs:my_fs2:my_opts2 #****************************************************************************** # End of FILE -#****************************************************************************** \ No newline at end of file +#****************************************************************************** diff --git a/configs/etc/check_hpux_fs_usage.conf.dist b/configs/etc/check_hpux_fs_usage.conf.dist new file mode 100644 index 0000000..72f9468 --- /dev/null +++ b/configs/etc/check_hpux_fs_usage.conf.dist @@ -0,0 +1,40 @@ +#****************************************************************************** +# @(#) check_hpux_fs_usage.conf +#****************************************************************************** +# This is a configuration file for the check_hpux_fs_usage HC plugin. +# All lines starting with a '#' are comment lines. +# [default: indicates hardcoded script values if no value is defined here] +#****************************************************************************** + +# specify whether to also log passed health checks +# (warning: this may rapidly grow the HC log) +# [default: no] +log_healthy=yes + +# specify whether to perform inode usage check +# [default: yes] +check_inodes_usage=yes + +# specify whether to perform space usage check +# [default: yes] +check_space_usage=yes + +# specify the maximum % of inodes usage a filesystem may reach (general threshold) +# [default: 90] +max_inodes_usage=90 + +# specify the maximum % of space usage a filesystem may reach (general threshold) +# [default: 90] +max_space_usage=90 + +# specify mount points and their maximum usage (in %). Leave undefined to +# perform check on all active filesystems. When not defining individual thresholds +# for a given filesystem, the general threshold will be used (see above) +# [fs:::::/dev/null 2>&1; return 1" 1 2 3 15 +# get pre-archive log co +PRE_LOG_COUNT=$(wc -l ${HC_LOG} 2>/dev/null | cut -f1 -d' ' 2>/dev/null) +if (( PRE_LOG_COUNT == 0 )) +then + warn "${HC_LOG} is empty, nothing to archive" + return 0 +fi + # isolate messages from HC, find unique %Y-%m combinations grep ".*${LOG_SEP}${HC_NAME}${LOG_SEP}" ${HC_LOG} 2>/dev/null |\ cut -f1 -d"${LOG_SEP}" 2>/dev/null | cut -f1 -d' ' 2>/dev/null |\ cut -f1-2 -d'-' 2>/dev/null | sort -u 2>/dev/null |\ - while read YEAR_MONTH + while read -r YEAR_MONTH do # find all messages for that YEAR-MONTH combination grep "${YEAR_MONTH}.*${LOG_SEP}${HC_NAME}${LOG_SEP}" ${HC_LOG} >${TMP1_FILE} - LOG_COUNT=$(wc -l ${TMP1_FILE} 2>/dev/null | cut -f1 -d' ' 2>/dev/null) - log "# of entries in ${YEAR_MONTH} to archive: ${LOG_COUNT}" + TODO_LOG_COUNT=$(wc -l ${TMP1_FILE} 2>/dev/null | cut -f1 -d' ' 2>/dev/null) + log "# of entries in ${YEAR_MONTH} to archive: ${TODO_LOG_COUNT}" # combine existing archived messages and resort ARCHIVE_FILE="${ARCHIVE_DIR}/hc.${YEAR_MONTH}.log" @@ -73,13 +83,15 @@ do sort ${HC_LOG} >${TMP1_FILE} comm -23 ${TMP1_FILE} ${ARCHIVE_FILE} 2>/dev/null >${TMP2_FILE} - if [[ -s ${TMP2_FILE} ]] + # check archive action (HC_LOG should not be empty unless it contained + # only messages from one single HC plugin before archival) + if [[ -s ${TMP2_FILE} ]] || (( PRE_LOG_COUNT == TODO_LOG_COUNT )) then mv ${TMP2_FILE} ${HC_LOG} 2>/dev/null || { warn "failed to move HC log file, aborting" return 2 } - LOG_COUNT=$(wc -l ${HC_LOG} 2>/dev/null | cut -f1 -d' ' 2>/dev/null ) + LOG_COUNT=$(wc -l ${HC_LOG} 2>/dev/null | cut -f1 -d' ' 2>/dev/null) log "# entries in ${HC_LOG} now: ${LOG_COUNT}" ARCHIVE_RC=1 else diff --git a/sources/lib/core/report_std.sh b/sources/lib/core/report_std.sh index 43cbedc..fe890ce 100644 --- a/sources/lib/core/report_std.sh +++ b/sources/lib/core/report_std.sh @@ -30,7 +30,7 @@ function report_std { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX,HP-UX,Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- @@ -63,7 +63,7 @@ fi # --last report if (( ARG_LAST > 0 )) then - printf "\n| %-30s | %-20s | %-14s | %-4s\n" "HC" "Timestamp" "FAIL ID" "STC (combined value)" + printf "\n| %-40s | %-20s | %-14s | %-4s\n" "HC" "Timestamp" "FAIL ID" "STC (combined value)" # shellcheck disable=SC2183 printf "%100s\n" | tr ' ' - # loop over all HCs @@ -102,7 +102,7 @@ then ' 2>/dev/null | read _HC_LAST_FAIL_ID _HC_LAST_STC fi # report on findings - printf "| %-30s | %-20s | %-14s | %-4s\n" \ + printf "| %-40s | %-20s | %-14s | %-4s\n" \ "${_HC_LAST}" "${_HC_LAST_TIME}" "${_HC_LAST_FAIL_ID}" "${_HC_LAST_STC}" done # disclaimer @@ -134,7 +134,7 @@ else # global or detailed? if (( ARG_DETAIL == 0 )) then - printf "\n| %-20s | %-14s | %-30s | %-s\n" \ + printf "\n| %-20s | %-14s | %-40s | %-s\n" \ "Timestamp" "FAIL ID" "HC" "Message" # shellcheck disable=SC2183 printf "%120s\n" | tr ' ' - @@ -146,7 +146,7 @@ else ' { if ($5 ~ id_needle && NF <= '"${NUM_LOG_FIELDS}"') { - printf ("| %-20s | %-14s | %-30s | %-s\n", $1, $5, $2, $4) + printf ("| %-20s | %-14s | %-40s | %-s\n", $1, $5, $2, $4) } } ' 2>/dev/null diff --git a/sources/lib/platform/aix/check_aix_errpt.sh b/sources/lib/platform/aix/check_aix_errpt.sh index bb1430d..aca1cd1 100644 --- a/sources/lib/platform/aix/check_aix_errpt.sh +++ b/sources/lib/platform/aix/check_aix_errpt.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_aix_errpt # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-15: initial version [Patrick Van der Veken] # @(#) 2013-05-29: small fix errpt last check time [Patrick Van der Veken] # @(#) 2013-06-24: big fix errpt last check time [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -34,14 +35,14 @@ function check_aix_errpt { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/aix/check_aix_file_age.sh b/sources/lib/platform/aix/check_aix_file_age.sh index 0f4f247..81ea23d 100644 --- a/sources/lib/platform/aix/check_aix_file_age.sh +++ b/sources/lib/platform/aix/check_aix_file_age.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_aix_file_age # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-27: initial version [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -33,14 +34,14 @@ function check_aix_file_age { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/aix/check_aix_file_change.sh b/sources/lib/platform/aix/check_aix_file_change.sh index 2e94b1e..0c9f129 100644 --- a/sources/lib/platform/aix/check_aix_file_change.sh +++ b/sources/lib/platform/aix/check_aix_file_change.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_aix_file_change # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc(), warn(), +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn(), # openssl (sha256 digest) OR cksum (CRC32 digest) # # @(#) HISTORY: # @(#) 2017-05-18: initial version [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,14 +36,14 @@ function check_aix_file_change { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/aix/check_aix_fs_mounts.sh b/sources/lib/platform/aix/check_aix_fs_mounts.sh index 11d8423..379f054 100644 --- a/sources/lib/platform/aix/check_aix_fs_mounts.sh +++ b/sources/lib/platform/aix/check_aix_fs_mounts.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_aix_fs_mounts # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-15: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -31,14 +32,14 @@ function check_aix_fs_mounts { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2013-05-15" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/aix/check_aix_lppchk.sh b/sources/lib/platform/aix/check_aix_lppchk.sh index 3896806..2fba6b8 100644 --- a/sources/lib/platform/aix/check_aix_lppchk.sh +++ b/sources/lib/platform/aix/check_aix_lppchk.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_aix_lppchk # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-17: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -31,14 +32,14 @@ function check_aix_lppchk { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2013-05-17" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/aix/check_aix_paths.sh b/sources/lib/platform/aix/check_aix_paths.sh index 8acec8b..0bd7c61 100644 --- a/sources/lib/platform/aix/check_aix_paths.sh +++ b/sources/lib/platform/aix/check_aix_paths.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_aix_paths # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-07: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -31,14 +32,14 @@ function check_aix_paths { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2013-05-07" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/aix/check_aix_root_crontab.sh b/sources/lib/platform/aix/check_aix_root_crontab.sh index 3f3852b..a47ed5e 100644 --- a/sources/lib/platform/aix/check_aix_root_crontab.sh +++ b/sources/lib/platform/aix/check_aix_root_crontab.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_aix_root_crontab # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-09-19: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -32,14 +33,14 @@ function check_aix_root_crontab { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2013-09-19" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/aix/check_aix_subsystems.sh b/sources/lib/platform/aix/check_aix_subsystems.sh index 3062652..341659e 100644 --- a/sources/lib/platform/aix/check_aix_subsystems.sh +++ b/sources/lib/platform/aix/check_aix_subsystems.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_aix_subsystems # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-07: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -32,14 +33,14 @@ function check_aix_subsystems { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2013-05-07" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/aix/check_aix_sysbackup.sh b/sources/lib/platform/aix/check_aix_sysbackup.sh index 7715218..d6c89b7 100644 --- a/sources/lib/platform/aix/check_aix_sysbackup.sh +++ b/sources/lib/platform/aix/check_aix_sysbackup.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_aix_sysbackup # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-28: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -34,14 +35,14 @@ function check_aix_sysbackup typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" # mksysb identifier prefix of error code(s) typeset _MKSYSB_NEEDLE="^0512" -typeset _VERSION="2013-05-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/aix/check_aix_topasrec.sh b/sources/lib/platform/aix/check_aix_topasrec.sh index dfb6e03..95d29b0 100644 --- a/sources/lib/platform/aix/check_aix_topasrec.sh +++ b/sources/lib/platform/aix/check_aix_topasrec.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_aix_topasrec # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-07: initial version [Patrick Van der Veken] # @(#) 2013-08-16: comparison fix [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -32,14 +33,14 @@ function check_aix_topasrec { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2013-08-16" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="AIX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_autopath.sh b/sources/lib/platform/hp-ux/check_hpux_autopath.sh index cbfe942..e98b0d4 100644 --- a/sources/lib/platform/hp-ux/check_hpux_autopath.sh +++ b/sources/lib/platform/hp-ux/check_hpux_autopath.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_hpux_autopath # DOES: see _show_usage(). # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-08-29: initial version [Patrick Van der Veken] # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -34,14 +35,14 @@ function check_hpux_autopath # ------------------------- CONFIGURATION starts here ------------------------- typeset _AUTOPATH_BIN="/sbin/autopath" typeset _AUTOPATH_NEEDLE="Failed" -typeset _VERSION="2018-05-20" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_cdsf_cluster.sh b/sources/lib/platform/hp-ux/check_hpux_cdsf_cluster.sh index 7b5464b..ec6d7bd 100644 --- a/sources/lib/platform/hp-ux/check_hpux_cdsf_cluster.sh +++ b/sources/lib/platform/hp-ux/check_hpux_cdsf_cluster.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_hpux_cdsf_cluster # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2016-07-21: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -31,7 +32,7 @@ function check_hpux_cdsf_cluster { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2018-07-21" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match typeset _CDSF_BIN="/usr/sbin/io_cdsf_config" # ------------------------- CONFIGURATION ends here --------------------------- @@ -39,7 +40,7 @@ typeset _CDSF_BIN="/usr/sbin/io_cdsf_config" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _LOG_HEALTHY=0 typeset _CDSF_CONFLICTS="" diff --git a/sources/lib/platform/hp-ux/check_hpux_drd_status.sh b/sources/lib/platform/hp-ux/check_hpux_drd_status.sh index 9bc17f1..8fe9e48 100644 --- a/sources/lib/platform/hp-ux/check_hpux_drd_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_drd_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_hpux_drd_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), data_get_lvalue_from_config(), data_date2epoch(), +# REQUIRES: data_comma2space(), data_get_lvalue_from_config(), data_date2epoch(), # data_lc(), data_strip_space(), data_strip_outer_space(), # dump_logs(), init_hc(), log_hc(), warn() # @@ -39,14 +39,14 @@ function check_hpux_drd_status # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _DRD_BIN="/opt/drd/bin/drd" -typeset _VERSION="2018-10-31" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _RC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_file_age.sh b/sources/lib/platform/hp-ux/check_hpux_file_age.sh index f65b4ae..ba2269c 100644 --- a/sources/lib/platform/hp-ux/check_hpux_file_age.sh +++ b/sources/lib/platform/hp-ux/check_hpux_file_age.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_hpux_file_age # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-27: initial version [Patrick Van der Veken] # @(#) 2013-05-29: added local trap for cleanup [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,14 +36,14 @@ function check_hpux_file_age { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_file_change.sh b/sources/lib/platform/hp-ux/check_hpux_file_change.sh index df40896..bd29458 100644 --- a/sources/lib/platform/hp-ux/check_hpux_file_change.sh +++ b/sources/lib/platform/hp-ux/check_hpux_file_change.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_hpux_file_change # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc(), warn(), +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn(), # openssl (sha256 digest) OR cksum (CRC32 digest) # # @(#) HISTORY: # @(#) 2017-05-18: initial version [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,14 +36,14 @@ function check_hpux_file_change { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_fs_mounts.sh b/sources/lib/platform/hp-ux/check_hpux_fs_mounts.sh index 0b8263d..eb21226 100644 --- a/sources/lib/platform/hp-ux/check_hpux_fs_mounts.sh +++ b/sources/lib/platform/hp-ux/check_hpux_fs_mounts.sh @@ -19,12 +19,13 @@ # @(#) MAIN: check_hpux_fs_mounts # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-27: initial version [Patrick Van der Veken] # @(#) 2016-04-04: exclude dump/swap spaces (...) [Patrick Van der Veken] # @(#) 2016-07-04: fix for nfs exclusion [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -33,14 +34,14 @@ function check_hpux_fs_mounts { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2016-07-04" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 @@ -59,12 +60,16 @@ done # collect data (mount only) mount >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG} -(( $? == 0)) || return $? +if (( $? > 0 )) +then + warn "unable to execute {mount} command" + return 1 +fi # check for each configured file system (except / and dump/swap) grep -v -E -e '^#' -e '^$' \ -e '[[:space:]]*\/[[:space:]]+' -e '\.\.\.' /etc/fstab 2>/dev/null |\ - awk '{print $2}' |\ + awk '{print $2}' 2>/dev/null |\ while read _FS do _FS_COUNT=$(grep -c -E -e "^${_FS}[ \t]+on.*[ \t]+" ${HC_STDOUT_LOG} 2>/dev/null) diff --git a/sources/lib/platform/hp-ux/check_hpux_fs_mounts_options.sh b/sources/lib/platform/hp-ux/check_hpux_fs_mounts_options.sh index 54d6bfb..7501dc5 100644 --- a/sources/lib/platform/hp-ux/check_hpux_fs_mounts_options.sh +++ b/sources/lib/platform/hp-ux/check_hpux_fs_mounts_options.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_hpux_fs_mounts_options # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2016-04-04: original version [Patrick Van der Veken] # @(#) 2016-12-02: add support for ignore_missing_fs option [Patrick Van der Veken] # @(#) 2017-07-31: added support for current/expected value output [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,14 +36,14 @@ function check_hpux_fs_mounts_options { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_fs_usage.sh b/sources/lib/platform/hp-ux/check_hpux_fs_usage.sh new file mode 100644 index 0000000..42fa5ef --- /dev/null +++ b/sources/lib/platform/hp-ux/check_hpux_fs_usage.sh @@ -0,0 +1,334 @@ +#!/usr/bin/env ksh +#****************************************************************************** +# @(#) check_hpux_fs_usage.sh +#****************************************************************************** +# @(#) Copyright (C) 2019 by KUDOS BVBA (info@kudos.be). All rights reserved. +# +# This program is a free software; you can redistribute it and/or modify +# it under the same terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details +#****************************************************************************** +# +# DOCUMENTATION (MAIN) +# ----------------------------------------------------------------------------- +# @(#) MAIN: check_hpux_fs_usage +# DOES: see _show_usage() +# EXPECTS: n/a +# REQUIRES: data_comma2space(), init_hc(), log_hc(), data_is_numeric(), warn() +# +# @(#) HISTORY: +# @(#) 2019-01-24: initial version [Patrick Van der Veken] +# ----------------------------------------------------------------------------- +# DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! +#****************************************************************************** + +# ----------------------------------------------------------------------------- +function check_hpux_fs_usage +{ +# ------------------------- CONFIGURATION starts here ------------------------- +typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" +typeset _VERSION="2019-01-24" # YYYY-MM-DD +typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match +# ------------------------- CONFIGURATION ends here --------------------------- + +# set defaults +(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} +init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" +typeset _ARGS=$(data_comma2space "$*") +typeset _ARG="" +typeset _MSG="" +typeset _STC=0 +typeset _CFG_HEALTHY="" +typeset _LOG_HEALTHY=0 +typeset _CFG_CHECK_INODES_USAGE="" +typeset _CFG_CHECK_SPACE_USAGE="" +typeset _CFG_MAX_INODES_USAGE="" +typeset _CFG_MAX_SPACE_USAGE="" +typeset _CFG_FS="" +typeset _CFG_INODES_THRESHOLD="" +typeset _CFG_SPACE_THRESHOLD="" +typeset _FS="" +typeset _DO_INODES=0 +typeset _DO_SPACE=0 +typeset _INODES_USAGE=1 +typeset _SPACE_USAGE=1 +typeset _LINE_COUNT=1 + +# handle arguments (originally comma-separated) +for _ARG in ${_ARGS} +do + case "${_ARG}" in + help) + _show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0 + ;; + check_inodes) + log "enabled check of inodes usage via cmd-line option" + _DO_INODES=1 + ;; + check_space) + log "enabled check of space usage via cmd-line option" + _DO_SPACE=1 + ;; + esac +done + +# handle configuration file +[[ -n "${ARG_CONFIG_FILE}" ]] && _CONFIG_FILE="${ARG_CONFIG_FILE}" +if [[ ! -r ${_CONFIG_FILE} ]] +then + warn "unable to read configuration file at ${_CONFIG_FILE}" + return 1 +fi +# read configuration values +_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy') +case "${_CFG_HEALTHY}" in + yes|YES|Yes) + _LOG_HEALTHY=1 + ;; + *) + # do not override hc_arg + (( _LOG_HEALTHY > 0 )) || _LOG_HEALTHY=0 + ;; +esac +_CFG_CHECK_INODES_USAGE=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'check_inodes_usage') +case "${_CFG_CHECK_INODES_USAGE}" in + yes|YES|Yes) + log "enabled check of inodes usage via configuration file" + _DO_INODES=1 + ;; + *) + : # not set + ;; +esac +_CFG_CHECK_SPACE_USAGE=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'check_space_usage') +case "${_CFG_CHECK_SPACE_USAGE}" in + yes|YES|Yes) + log "enabled check of space usage via configuration file" + _DO_SPACE=1 + ;; + *) + : # not set + ;; +esac +_CFG_MAX_INODES_USAGE=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'max_inodes_usage') +if [[ -z "${_CFG_MAX_INODES_USAGE}" ]] +then + # default + _CFG_MAX_INODES_USAGE=90 +fi +_CFG_MAX_SPACE_USAGE=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'max_space_usage') +if [[ -z "${_CFG_MAX_SPACE_USAGE}" ]] +then + # default + _CFG_MAX_SPACE_USAGE=90 +fi +if (( _DO_INODES == 0 && _DO_SPACE == 0 )) +then + warn "you must enable at least one check (inode and/or space)" + return 1 +fi + +# log_healthy +(( ARG_LOG_HEALTHY > 0 )) && _LOG_HEALTHY=1 +if (( _LOG_HEALTHY > 0 )) +then + if (( ARG_LOG > 0 )) + then + log "logging/showing passed health checks" + else + log "showing passed health checks (but not logging)" + fi +else + log "not logging/showing passed health checks" +fi + +# collect data (use a rewritten one-liner bdf, remove % signs and invalidate the +# result if we get non-empty STDERR). Output will be FSINODES_%SPACE_% +bdf -il 2>${HC_STDERR_LOG} |\ + awk '{gsub(/%/,"");if ($0~/^\//&&NF>2){print $9, $5, $8;};if($0!~/^\//&&NF>2){print $8, $4, $7;}}' >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG} +if [[ -s ${HC_STDERR_LOG} ]] +then + warn "error(s) occurred executing {bdf -il}" + (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs + return 1 +fi + +# check for each configured filesystem or for all +if (( $(grep -c -i '^fs:' ${_CONFIG_FILE} 2>/dev/null) > 0 )) +then + # 1) --- configured FS --- + # a) --- inodes --- + if (( _DO_INODES > 0 )) + then + _LINE_COUNT=1 + grep -i '^fs:' ${_CONFIG_FILE} 2>/dev/null |\ + while IFS=':' read _ _CFG_FS _CFG_INODES_THRESHOLD _ + do + # report on missing FS name of threshold + if [[ -z "${_CFG_FS}" ]] && [[ -z "${_CFG_INODES_THRESHOLD}" ]] + then + warn "missing filesystem name and/or threshold in configuration file ${_CONFIG_FILE} at data line ${_LINE_COUNT}" + continue + fi + data_is_numeric ${_CFG_INODES_THRESHOLD} + if (( $? > 0 )) + then + warn "parameter is not numeric in configuration file ${_CONFIG_FILE} at data line ${_LINE_COUNT}" + continue + fi + if (( _CFG_INODES_THRESHOLD == 0 || _CFG_INODES_THRESHOLD >= 100 )) + then + (( ARG_DEBUG > 0 )) && debug "found out-of-bounds inodes threshold for ${_CFG_FS}, using general threshold" + _CFG_INODES_THRESHOLD=${_CFG_MAX_INODES_USAGE} + fi + _INODES_USAGE=$(grep -E -e "^${_CFG_FS} " ${HC_STDOUT_LOG} 2>/dev/null | awk '{print $2}' 2>/dev/null) + data_is_numeric ${_INODES_USAGE} + if (( $? > 0 )) + then + warn "discovered value for inode usage is incorrect [${_CFG_FS}:${_INODES_USAGE}]" + continue + fi + # check against the threshold + if (( _INODES_USAGE > _CFG_INODES_THRESHOLD )) + then + _MSG="${_CFG_FS} exceedes its inode threshold (${_INODES_USAGE}%>${_CFG_INODES_THRESHOLD}%)" + _STC=1 + else + _MSG="${_CFG_FS} does not exceede its inode threshold (${_INODES_USAGE}%<=${_CFG_INODES_THRESHOLD}%)" + _STC=0 + fi + if (( _LOG_HEALTHY > 0 || _STC > 0 )) + then + log_hc "$0" ${_STC} "${_MSG}" ${_INODES_USAGE} ${_CFG_INODES_THRESHOLD} + fi + _LINE_COUNT=$(( _LINE_COUNT + 1 )) + done + fi + # a) --- space --- + if (( _DO_SPACE > 0 )) + then + _LINE_COUNT=1 + grep -i '^fs:' ${_CONFIG_FILE} 2>/dev/null |\ + while IFS=':' read _ _CFG_FS _ _CFG_SPACE_THRESHOLD _ + do + # report on missing FS name of threshold + if [[ -z "${_CFG_FS}" ]] && [[ -z "${_CFG_SPACE_THRESHOLD}" ]] + then + warn "missing filesystem name and/or threshold in configuration file ${_CONFIG_FILE} at data line ${_LINE_COUNT}" + continue + fi + data_is_numeric ${_CFG_SPACE_THRESHOLD} + if (( $? > 0 )) + then + warn "parameter is not numeric in configuration file ${_CONFIG_FILE} at data line ${_LINE_COUNT}" + continue + fi + if (( _CFG_SPACE_THRESHOLD == 0 || _CFG_SPACE_THRESHOLD >= 100 )) + then + (( ARG_DEBUG > 0 )) && debug "found out-of-bounds space threshold for ${_CFG_FS}, using general threshold" + _CFG_SPACE_THRESHOLD=${_CFG_MAX_SPACE_USAGE} + fi + _SPACE_USAGE=$(grep -E -e "^${_CFG_FS} " ${HC_STDOUT_LOG} 2>/dev/null | awk '{print $3}' 2>/dev/null) + data_is_numeric ${_SPACE_USAGE} + if (( $? > 0 )) + then + warn "discovered value for space usage is incorrect [${_CFG_FS}:${_SPACE_USAGE}]" + continue + fi + # check against the threshold + if (( _SPACE_USAGE > _CFG_SPACE_THRESHOLD )) + then + _MSG="${_CFG_FS} exceedes its space threshold (${_SPACE_USAGE}%>${_CFG_SPACE_THRESHOLD}%)" + _STC=1 + else + _MSG="${_CFG_FS} does not exceede its space threshold (${_SPACE_USAGE}%<=${_CFG_SPACE_THRESHOLD}%)" + _STC=0 + fi + if (( _LOG_HEALTHY > 0 || _STC > 0 )) + then + log_hc "$0" ${_STC} "${_MSG}" ${_SPACE_USAGE} ${_CFG_SPACE_THRESHOLD} + fi + _LINE_COUNT=$(( _LINE_COUNT + 1 )) + done + fi +else + # 2) --- ALL FS --- + grep '^\/' ${HC_STDOUT_LOG} 2>/dev/null | awk '{print $1}' 2>/dev/null |\ + while read _FS + do + # a) --- inodes --- + _INODES_USAGE=$(grep "^${_FS} " ${HC_STDOUT_LOG} 2>/dev/null | awk '{print $2}' 2>/dev/null) + data_is_numeric ${_INODES_USAGE} + if (( $? > 0 )) + then + warn "discovered value for inode usage is incorrect [${_FS}:${_INODES_USAGE}]" + continue + fi + # check against the threshold + if (( _INODES_USAGE > _CFG_MAX_INODES_USAGE )) + then + _MSG="${_FS} exceedes its inode threshold (${_INODES_USAGE}%>${_CFG_MAX_INODES_USAGE}%)" + _STC=1 + else + _MSG="${_FS} does not exceede its inode threshold (${_INODES_USAGE}%<=${_CFG_MAX_INODES_USAGE}%)" + _STC=0 + fi + if (( _LOG_HEALTHY > 0 || _STC > 0 )) + then + log_hc "$0" ${_STC} "${_MSG}" ${_INODES_USAGE} ${_CFG_MAX_INODES_USAGE} + fi + # b) --- space --- + _SPACE_USAGE=$(grep "^${_FS} " ${HC_STDOUT_LOG} 2>/dev/null | awk '{print $3}' 2>/dev/null) + data_is_numeric ${_SPACE_USAGE} + if (( $? > 0 )) + then + warn "discovered value for space usage is incorrect [${_FS}:${_SPACE_USAGE}]" + continue + fi + # check against the threshold + if (( _SPACE_USAGE > _CFG_MAX_SPACE_USAGE )) + then + _MSG="${_FS} exceedes its space threshold (${_SPACE_USAGE}%>${_CFG_MAX_SPACE_USAGE}%)" + _STC=1 + else + _MSG="${_FS} does not exceede its space threshold (${_SPACE_USAGE}%<=${_CFG_MAX_SPACE_USAGE}%)" + _STC=0 + fi + if (( _LOG_HEALTHY > 0 || _STC > 0 )) + then + log_hc "$0" ${_STC} "${_MSG}" ${_SPACE_USAGE} ${_CFG_MAX_SPACE_USAGE} + fi + done +fi + +return 0 +} + +# ----------------------------------------------------------------------------- +function _show_usage +{ +cat <<- EOT +NAME : $1 +VERSION : $2 +CONFIG : $3 with formatted stanzas (optional): + fs::: + Other options: + check_inodes_usage= + check_space_usage= + max_inodes_usage= + max_space_usage= +PURPOSE : Checks the inodes & space usage for the configured or all (local) filesystems + +EOT + +return 0 +} + +#****************************************************************************** +# END of script +#****************************************************************************** diff --git a/sources/lib/platform/hp-ux/check_hpux_guid_status.sh b/sources/lib/platform/hp-ux/check_hpux_guid_status.sh index 136c6de..56c21ce 100644 --- a/sources/lib/platform/hp-ux/check_hpux_guid_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_guid_status.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_hpux_guid_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-05-18: initial version [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -32,14 +33,14 @@ function check_hpux_guid_status { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _GUID_PID="" typeset _MSG="" diff --git a/sources/lib/platform/hp-ux/check_hpux_hpvm_vpar_status.sh b/sources/lib/platform/hp-ux/check_hpux_hpvm_vpar_status.sh index 8288c97..9590344 100644 --- a/sources/lib/platform/hp-ux/check_hpux_hpvm_vpar_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_hpvm_vpar_status.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_hpux_hpvm_vpar_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2017-06-01: initial version [Patrick Van der Veken] # @(#) 2017-06-08: return 1 on error [Patrick Van der Veken] # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,14 +37,14 @@ function check_hpux_hpvm_vpar_status # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _HPVMSTATUS_BIN="/opt/hpvm/bin/hpvmstatus" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _LINE_COUNT=1 typeset _PAR_ENTRY="" diff --git a/sources/lib/platform/hp-ux/check_hpux_httpd_status.sh b/sources/lib/platform/hp-ux/check_hpux_httpd_status.sh index 15697c6..fd542aa 100644 --- a/sources/lib/platform/hp-ux/check_hpux_httpd_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_httpd_status.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_hpux_httpd_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-04-23: initial version [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -33,14 +34,14 @@ function check_hpux_httpd_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _HTTPD_PID_FILE="/var/run/httpd/httpd.pid" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _HTTPD_BIN="" typeset _HTTPD_PID="" diff --git a/sources/lib/platform/hp-ux/check_hpux_ignite_backup.sh b/sources/lib/platform/hp-ux/check_hpux_ignite_backup.sh index 8861f5f..1ecf445 100644 --- a/sources/lib/platform/hp-ux/check_hpux_ignite_backup.sh +++ b/sources/lib/platform/hp-ux/check_hpux_ignite_backup.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_hpux_ignite_backup # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-28: initial version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) parameter [Patrick Van der Veken] # @(#) 2016-06-03: small fix [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -38,14 +39,14 @@ function check_hpux_ignite_backup typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" # backup DONE identifier typeset _IGNITE_NEEDLE="^DONE" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_ioscan.sh b/sources/lib/platform/hp-ux/check_hpux_ioscan.sh index e03bc10..575f9b5 100644 --- a/sources/lib/platform/hp-ux/check_hpux_ioscan.sh +++ b/sources/lib/platform/hp-ux/check_hpux_ioscan.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_hpux_ioscan # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), data_comma2pipe(), data_dequote(), dump_logs(), +# REQUIRES: data_comma2space(), data_comma2pipe(), data_dequote(), dump_logs(), # init_hc(), log_hc(), warn() # # @(#) HISTORY: @@ -30,6 +30,7 @@ # @(#) 2018-05-11: small optimizations [Patrick Van der Veken] # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -41,14 +42,14 @@ function check_hpux_ioscan typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _IOSCAN_BIN="/usr/sbin/ioscan" typeset _IOSCAN_OPTS="-Fn" -typeset _VERSION="2018-08-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_kernel_params.sh b/sources/lib/platform/hp-ux/check_hpux_kernel_params.sh index e9c417e..f6f049c 100644 --- a/sources/lib/platform/hp-ux/check_hpux_kernel_params.sh +++ b/sources/lib/platform/hp-ux/check_hpux_kernel_params.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_hpux_kernel_params # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-12-22: original version [Patrick Van der Veken] # @(#) 2018-01-05: added validation on config values [Patrick Van der Veken] # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,14 +37,14 @@ function check_hpux_kernel_params # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _KCTUNE_BIN="/usr/sbin/kctune" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_kernel_usage.sh b/sources/lib/platform/hp-ux/check_hpux_kernel_usage.sh index 6285499..869ce3a 100644 --- a/sources/lib/platform/hp-ux/check_hpux_kernel_usage.sh +++ b/sources/lib/platform/hp-ux/check_hpux_kernel_usage.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_hpux_kernel_usage # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-12-22: original version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) 2018-01-09: bug fix [Patrick Van der Veken] # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -37,14 +38,14 @@ function check_hpux_kernel_usage # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _KCUSAGE_BIN="/usr/sbin/kcusage" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_lunpaths.sh b/sources/lib/platform/hp-ux/check_hpux_lunpaths.sh index e292dc0..ac7b71f 100644 --- a/sources/lib/platform/hp-ux/check_hpux_lunpaths.sh +++ b/sources/lib/platform/hp-ux/check_hpux_lunpaths.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_hpux_lunpaths # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2017-12-20: initial version [Patrick Van der Veken] # @(#) 2018-18-22: reworked discovery routine (accommdate large number of LUNS) # @(#) [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -38,14 +39,14 @@ typeset _IOSCAN_BIN="/usr/sbin/ioscan" typeset _IOSCAN_OPTS="-C disk -P wwid" typeset _SCSIMGR_BIN="/usr/sbin/scsimgr" typeset _SCSIMGR_OPTS="-v get_info all_lun" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_named_status.sh b/sources/lib/platform/hp-ux/check_hpux_named_status.sh index 0bae5bc..61c2eb7 100644 --- a/sources/lib/platform/hp-ux/check_hpux_named_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_named_status.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_hpux_named_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-01-07: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -32,7 +33,7 @@ function check_hpux_named_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _NAMED_PID_FILE="/var/run/named/named.pid" -typeset _VERSION="2017-01-07" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- @@ -41,7 +42,7 @@ typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" typeset _NAMED_CHECKCONF_BIN="" typeset _NAMED_PID="" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_ntp_status.sh b/sources/lib/platform/hp-ux/check_hpux_ntp_status.sh index f93447c..822bf8d 100644 --- a/sources/lib/platform/hp-ux/check_hpux_ntp_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_ntp_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_hpux_ntp_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2016-12-01: initial version [Patrick Van der Veken] @@ -28,6 +28,7 @@ # @(#) 2018-10-31: added support for --log-healthy [Patrick Van der Veken] # @(#) 2019-01-10: added configuration option 'ntpq_use_ipv4', fixed problem # @(#) with offset calculation [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #------------------------------------------------------------------------------ @@ -37,7 +38,7 @@ function check_hpux_ntp_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2019-01-10" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match typeset _NTPQ_BIN="/usr/sbin/ntpq" typeset _NTPQ_OPTS="-pn" @@ -46,7 +47,7 @@ typeset _NTPQ_OPTS="-pn" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 @@ -180,15 +181,19 @@ return 0 function _show_usage { cat <<- EOT -NAME : $1 -VERSION : $2 -CONFIG : $3 with: - log_healthy= - max_offset= - force_chrony= - force_ntp= - ntpq_use_ipv4= -PURPOSE : Checks the status of NTP synchronization +NAME : $1 +VERSION : $2 +CONFIG : $3 with: + log_healthy= + max_offset= + force_chrony= + force_ntp= + ntpq_use_ipv4= +EXTRA OPTS : --hc-args=force_chrony, --hc-args=force_ntp +PURPOSE : Checks the status of NTP service & synchronization. + Supports chronyd & ntpd. + Assumes chronyd is the preferred time synchronization. +LOG HEALTHY : Supported EOT 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 5159473..09c5d77 100644 --- a/sources/lib/platform/hp-ux/check_hpux_ovpa_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_ovpa_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_hpux_ovpa_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2016-04-08: initial version [Patrick Van der Veken] @@ -28,6 +28,7 @@ # @(#) 2018-08-30: added config file + check list for daemons [Patrick Van der Veken] # @(#) 2018-10-22: small fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -37,7 +38,7 @@ function check_hpux_ovpa_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match typeset _OVPA_BIN="/opt/perf/bin/perfstat" # ------------------------- CONFIGURATION ends here --------------------------- @@ -45,7 +46,7 @@ typeset _OVPA_BIN="/opt/perf/bin/perfstat" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 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 7f3ea86..b4d8085 100644 --- a/sources/lib/platform/hp-ux/check_hpux_patch_version.sh +++ b/sources/lib/platform/hp-ux/check_hpux_patch_version.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_hpux_patch_version # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), data_get_lvalue_from_config(), data_dequote(), +# REQUIRES: data_comma2space(), data_get_lvalue_from_config(), data_dequote(), # dump_logs(), init_hc(), log_hc(), warn() # # @(#) HISTORY: @@ -27,6 +27,7 @@ # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-10-22: added check on fileset state [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -40,14 +41,14 @@ typeset _SWLIST_BIN="/usr/sbin/swlist" typeset _SWLIST_OPTS="" typeset _SHOW_PATCHES_BIN="/usr/contrib/bin/show_patches" typeset _SHOW_PATCHES_OPTS="" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _CFG_HEALTHY="" diff --git a/sources/lib/platform/hp-ux/check_hpux_postfix_status.sh b/sources/lib/platform/hp-ux/check_hpux_postfix_status.sh index 9761e03..e8271dd 100644 --- a/sources/lib/platform/hp-ux/check_hpux_postfix_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_postfix_status.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_hpux_postfix_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2016-12-01: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -31,14 +32,14 @@ function check_hpux_postfix_status { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2016-12-01" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _POSTFIX_BIN="" typeset _MSG="" diff --git a/sources/lib/platform/hp-ux/check_hpux_root_crontab.sh b/sources/lib/platform/hp-ux/check_hpux_root_crontab.sh index 772233e..28138e5 100644 --- a/sources/lib/platform/hp-ux/check_hpux_root_crontab.sh +++ b/sources/lib/platform/hp-ux/check_hpux_root_crontab.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_hpux_root_crontab # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-09-19: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -32,14 +33,14 @@ function check_hpux_root_crontab { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2013-09-09" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_sfm_status.sh b/sources/lib/platform/hp-ux/check_hpux_sfm_status.sh index 92da2d6..425138d 100644 --- a/sources/lib/platform/hp-ux/check_hpux_sfm_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_sfm_status.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_hpux_sfm_statuss # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), data_contains_string(), data_is_numeric(), +# REQUIRES: data_comma2space(), data_contains_string(), data_is_numeric(), # init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2018-10-28: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,14 +37,14 @@ typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _SFMCONFIG_BIN="/opt/sfm/bin/sfmconfig" typeset _EVWEB_BIN="/opt/sfm/bin/evweb" typeset _CIMPROVIDER_BIN="/opt/wbem/bin/cimprovider" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_sg_cluster_config.sh b/sources/lib/platform/hp-ux/check_hpux_sg_cluster_config.sh index 9da2d73..857e790 100644 --- a/sources/lib/platform/hp-ux/check_hpux_sg_cluster_config.sh +++ b/sources/lib/platform/hp-ux/check_hpux_sg_cluster_config.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_hpux_sg_cluster_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2016-03-08: initial version [Patrick Van der Veken] # @(#) 2016-12-01: more standardized error handling [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,7 +36,7 @@ function check_hpux_sg_cluster_config { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match typeset _SG_DAEMON="/usr/lbin/cmcld" # rubbish that cmgetconf outputs to STDOUT instead of STDERR @@ -45,7 +46,7 @@ typeset _SG_CMGETCONF_FILTER="Permission denied|Number of configured" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_sg_cluster_status.sh b/sources/lib/platform/hp-ux/check_hpux_sg_cluster_status.sh index c291e97..6f9a011 100644 --- a/sources/lib/platform/hp-ux/check_hpux_sg_cluster_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_sg_cluster_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_hpux_sg_cluster_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2016-03-25: initial version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) 2017-05-07: made checks more detailed for log_hc() [Patrick Van der Veken] # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,7 +37,7 @@ function check_hpux_sg_cluster_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match typeset _SG_DAEMON="/usr/lbin/cmcld" # ------------------------- CONFIGURATION ends here --------------------------- @@ -44,7 +45,7 @@ typeset _SG_DAEMON="/usr/lbin/cmcld" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_sg_package_config.sh b/sources/lib/platform/hp-ux/check_hpux_sg_package_config.sh index 5d8538d..a8a673c 100644 --- a/sources/lib/platform/hp-ux/check_hpux_sg_package_config.sh +++ b/sources/lib/platform/hp-ux/check_hpux_sg_package_config.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_hpux_sg_package_config # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2016-03-08: initial version [Patrick Van der Veken] # @(#) 2016-12-01: more standardized error handling [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,7 +36,7 @@ function check_hpux_sg_package_config { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match typeset _SG_DAEMON="/usr/lbin/cmcld" # rubbish that cmgetconf outputs to STDOUT instead of STDERR @@ -45,7 +46,7 @@ typeset _SG_CMGETCONF_FILTER="Permission denied|Number of configured" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_sg_package_status.sh b/sources/lib/platform/hp-ux/check_hpux_sg_package_status.sh index cda3fea..c7ad12d 100644 --- a/sources/lib/platform/hp-ux/check_hpux_sg_package_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_sg_package_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_hpux_sg_package_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2016-03-08: initial version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) 2017-05-07: made checks more detailed for log_hc() [Patrick Van der Veken] # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,7 +37,7 @@ function check_hpux_sg_package_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match typeset _SG_DAEMON="/usr/lbin/cmcld" # ------------------------- CONFIGURATION ends here --------------------------- @@ -44,7 +45,7 @@ typeset _SG_DAEMON="/usr/lbin/cmcld" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_sg_qs_status.sh b/sources/lib/platform/hp-ux/check_hpux_sg_qs_status.sh index 2d84686..09779aa 100644 --- a/sources/lib/platform/hp-ux/check_hpux_sg_qs_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_sg_qs_status.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_hpux_sg_qs_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-05-01: initial version [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -32,7 +33,7 @@ function check_hpux_sg_qs_status { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match typeset _QS_BIN="/usr/lbin/qsc" typeset _QS_AUTH_FILE="/etc/cmcluster/qs_authfile" @@ -41,7 +42,7 @@ typeset _QS_AUTH_FILE="/etc/cmcluster/qs_authfile" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_sshd_status.sh b/sources/lib/platform/hp-ux/check_hpux_sshd_status.sh index 087e650..eabe7e1 100644 --- a/sources/lib/platform/hp-ux/check_hpux_sshd_status.sh +++ b/sources/lib/platform/hp-ux/check_hpux_sshd_status.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_hpux_sshd_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: datadata_comma2spacespace2comma(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-04-01: initial version [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -33,14 +34,14 @@ function check_hpux_sshd_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _SSHD_PID_FILE="/var/run/sshd/sshd.pid" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _SSHD_PID="" typeset _MSG="" diff --git a/sources/lib/platform/hp-ux/check_hpux_syslog.sh b/sources/lib/platform/hp-ux/check_hpux_syslog.sh index 1edfef4..8dda73d 100644 --- a/sources/lib/platform/hp-ux/check_hpux_syslog.sh +++ b/sources/lib/platform/hp-ux/check_hpux_syslog.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_hpux_syslog # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2016-06-20: initial version [Patrick Van der Veken] # @(#) 2017-05-18: do not update the state file with --no-log [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,14 +37,14 @@ function check_hpux_syslog # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _STATE_FILE="${STATE_PERM_DIR}/discovered.syslog" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/hp-ux/check_hpux_vg_minor_number.sh b/sources/lib/platform/hp-ux/check_hpux_vg_minor_number.sh index c6e3e77..49f29ee 100644 --- a/sources/lib/platform/hp-ux/check_hpux_vg_minor_number.sh +++ b/sources/lib/platform/hp-ux/check_hpux_vg_minor_number.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_hpux_vg_minor_number # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2016-04-28: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -31,14 +32,14 @@ function check_hpux_vg_minor_number { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2016-04-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_burp_backup.sh b/sources/lib/platform/linux/check_linux_burp_backup.sh index f70c8ac..3946759 100644 --- a/sources/lib/platform/linux/check_linux_burp_backup.sh +++ b/sources/lib/platform/linux/check_linux_burp_backup.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_burp_backup # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(),init_hc(), log_hc(), +# REQUIRES: data_comma2space(),init_hc(), log_hc(), # GNU date that can calculate UNIX epoch seconds from given date, # BURP server must be be able to impersonate configured clients # @@ -28,6 +28,7 @@ # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-08-25: support for burp v2 [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -39,14 +40,14 @@ function check_linux_burp_backup typeset _BURP_SERVER_CONFIG_FILE="/etc/burp/burp-server.conf" typeset _BURP_CLIENT_CONFIG_FILE="/etc/burp/burp.conf" typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_burp_status.sh b/sources/lib/platform/linux/check_linux_burp_status.sh index a0c8651..7c368e0 100644 --- a/sources/lib/platform/linux/check_linux_burp_status.sh +++ b/sources/lib/platform/linux/check_linux_burp_status.sh @@ -19,12 +19,13 @@ # @(#) MAIN: check_linux_burp_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), linux_get_init(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), linux_get_init(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2016-12-01: initial version [Patrick Van der Veken] # @(#) 2017-05-08: fix fall-back for sysv->pgrep [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,14 +36,14 @@ function check_linux_burp_status # ------------------------- CONFIGURATION starts here ------------------------- typeset _BURP_INIT_SCRIPT="/etc/init.d/burp" typeset _BURP_SYSTEMD_SERVICE="burp.service" -typeset _VERSION="2018-05-21" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_file_age.sh b/sources/lib/platform/linux/check_linux_file_age.sh index 7cab062..1f2de21 100644 --- a/sources/lib/platform/linux/check_linux_file_age.sh +++ b/sources/lib/platform/linux/check_linux_file_age.sh @@ -19,12 +19,13 @@ # @(#) MAIN: check_linux_file_age # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-27: initial version [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -34,14 +35,14 @@ function check_linux_file_age { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_file_change.sh b/sources/lib/platform/linux/check_linux_file_change.sh index ede28a9..752cb19 100644 --- a/sources/lib/platform/linux/check_linux_file_change.sh +++ b/sources/lib/platform/linux/check_linux_file_change.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_file_change # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc(), warn(), +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn(), # openssl (sha256 digest) OR cksum (CRC32 digest) # # @(#) HISTORY: @@ -27,6 +27,7 @@ # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,14 +37,14 @@ function check_linux_file_change { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_fs_mounts.sh b/sources/lib/platform/linux/check_linux_fs_mounts.sh index 1ef7f95..63635f9 100644 --- a/sources/lib/platform/linux/check_linux_fs_mounts.sh +++ b/sources/lib/platform/linux/check_linux_fs_mounts.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_linux_fs_mounts # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-17: initial version [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-08-25: small fix [Patrick Van der Veken] # @(#) 2018-10-02: regex fix [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -34,17 +35,16 @@ function check_linux_fs_mounts { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2018-10-02" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" -typeset _MSG="" typeset _STC=0 typeset _FS="" typeset _FS_COUNT=0 @@ -61,14 +61,18 @@ done # collect data (mount only) mount >>${HC_STDOUT_LOG} 2>>${HC_STDERR_LOG} -(( $? == 0 )) || return $? +if (( $? > 0 )) +then + warn "unable to execute {mount} command" + return 1 +fi # check for each configured file system (except /) grep -v -E -e '^#' -e '^$' \ -e '[[:space:]]*.*[[:space:]]+(proc|swap|sysfs|devpts|tmpfs).*' \ -e '(floppy|cdrom)' \ -e '[[:space:]]*\/[[:space:]]+' /etc/fstab 2>/dev/null |\ - awk '{print $2}' |\ + awk '{print $2}' 2>/dev/null |\ while read _FS do _FS_COUNT=$(grep -c -E -e ".*on[ \t]+${_FS}[ \t]+.*" ${HC_STDOUT_LOG} 2>/dev/null) diff --git a/sources/lib/platform/linux/check_linux_fs_usage.sh b/sources/lib/platform/linux/check_linux_fs_usage.sh new file mode 100644 index 0000000..0eab0c3 --- /dev/null +++ b/sources/lib/platform/linux/check_linux_fs_usage.sh @@ -0,0 +1,376 @@ +#!/usr/bin/env ksh +#****************************************************************************** +# @(#) check_linux_fs_usage.sh +#****************************************************************************** +# @(#) Copyright (C) 2019 by KUDOS BVBA (info@kudos.be). All rights reserved. +# +# This program is a free software; you can redistribute it and/or modify +# it under the same terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details +#****************************************************************************** +# +# DOCUMENTATION (MAIN) +# ----------------------------------------------------------------------------- +# @(#) MAIN: check_linux_fs_usage +# DOES: see _show_usage() +# EXPECTS: n/a +# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn() +# +# @(#) HISTORY: +# @(#) 2019-01-24: initial version [Patrick Van der Veken] +# ----------------------------------------------------------------------------- +# DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! +#****************************************************************************** + +# ----------------------------------------------------------------------------- +function check_linux_fs_usage +{ +# ------------------------- CONFIGURATION starts here ------------------------- +typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" +typeset _VERSION="2019-01-24" # YYYY-MM-DD +typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match +# ------------------------- CONFIGURATION ends here --------------------------- + +# set defaults +(( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} +init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" +typeset _ARGS=$(data_comma2space "$*") +typeset _ARG="" +typeset _MSG="" +typeset _STC=0 +typeset _CFG_HEALTHY="" +typeset _LOG_HEALTHY=0 +typeset _CFG_CHECK_INODES_USAGE="" +typeset _CFG_CHECK_SPACE_USAGE="" +typeset _CFG_MAX_INODES_USAGE="" +typeset _CFG_MAX_SPACE_USAGE="" +typeset _CFG_FS="" +typeset _CFG_INODES_THRESHOLD="" +typeset _CFG_SPACE_THRESHOLD="" +typeset _FS="" +typeset _DO_INODES=0 +typeset _DO_SPACE=0 +typeset _INODES_USAGE=1 +typeset _SPACE_USAGE=1 +typeset _LINE_COUNT=1 +typeset _INODES_FILE="${TMP_DIR}/.$0.inodes.$$" +typeset _SPACE_FILE="${TMP_DIR}/.$0.space.$$" + +# set local trap for cleanup +# shellcheck disable=SC2064 +trap "rm -f ${_SPACE_FILE}.* ${_INODES_FILE}.* >/dev/null 2>&1; return 1" 1 2 3 15 + +# handle arguments (originally comma-separated) +for _ARG in ${_ARGS} +do + case "${_ARG}" in + help) + _show_usage $0 ${_VERSION} ${_CONFIG_FILE} && return 0 + ;; + check_inodes) + log "enabled check of inodes usage via cmd-line option" + _DO_INODES=1 + ;; + check_space) + log "enabled check of space usage via cmd-line option" + _DO_SPACE=1 + ;; + esac +done + +# handle configuration file +[[ -n "${ARG_CONFIG_FILE}" ]] && _CONFIG_FILE="${ARG_CONFIG_FILE}" +if [[ ! -r ${_CONFIG_FILE} ]] +then + warn "unable to read configuration file at ${_CONFIG_FILE}" + return 1 +fi +# read configuration values +_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy') +case "${_CFG_HEALTHY}" in + yes|YES|Yes) + _LOG_HEALTHY=1 + ;; + *) + # do not override hc_arg + (( _LOG_HEALTHY > 0 )) || _LOG_HEALTHY=0 + ;; +esac +_CFG_CHECK_INODES_USAGE=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'check_inodes_usage') +case "${_CFG_CHECK_INODES_USAGE}" in + yes|YES|Yes) + log "enabled check of inodes usage via configuration file" + _DO_INODES=1 + ;; + *) + : # not set + ;; +esac +_CFG_CHECK_SPACE_USAGE=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'check_space_usage') +case "${_CFG_CHECK_SPACE_USAGE}" in + yes|YES|Yes) + log "enabled check of space usage via configuration file" + _DO_SPACE=1 + ;; + *) + : # not set + ;; +esac +_CFG_MAX_INODES_USAGE=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'max_inodes_usage') +if [[ -z "${_CFG_MAX_INODES_USAGE}" ]] +then + # default + _CFG_MAX_INODES_USAGE=90 +fi +_CFG_MAX_SPACE_USAGE=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'max_space_usage') +if [[ -z "${_CFG_MAX_SPACE_USAGE}" ]] +then + # default + _CFG_MAX_SPACE_USAGE=90 +fi +if (( _DO_INODES == 0 && _DO_SPACE == 0 )) +then + warn "you must enable at least one check (inode and/or space)" + return 1 +fi + +# log_healthy +(( ARG_LOG_HEALTHY > 0 )) && _LOG_HEALTHY=1 +if (( _LOG_HEALTHY > 0 )) +then + if (( ARG_LOG > 0 )) + then + log "logging/showing passed health checks" + else + log "showing passed health checks (but not logging)" + fi +else + log "not logging/showing passed health checks" +fi + +# collect data (POSIX format) +if (( _DO_INODES > 0 )) +then + df -Pil >>${_INODES_FILE} 2>>${HC_STDERR_LOG} + if (( $? > 0 )) + then + # df exits >0 if there are issues with some filesystems, consider non-fatal + warn "error(s) occurred executing the {df -Pil}" + fi +fi +if (( _DO_SPACE > 0 )) +then + df -Pl >>${_SPACE_FILE} 2>>${HC_STDERR_LOG} + if (( $? > 0 )) + then + # df exits >0 if there are issues with some filesystems, consider non-fatal + warn "error(s) occurred executing {df -Pl}" + fi +fi + +# do inodes/space checks +if (( $(grep -c -i '^fs:' ${_CONFIG_FILE} 2>/dev/null) > 0 )) +then + # 1) --- configured FS --- + # a) --- inodes (df -Pil) --- + if (( _DO_INODES > 0 )) + then + _LINE_COUNT=1 + grep -i '^fs:' ${_CONFIG_FILE} 2>/dev/null |\ + while IFS=':' read _ _CFG_FS _CFG_INODES_THRESHOLD _ + do + # report on missing FS name or threshold + if [[ -z "${_CFG_FS}" ]] && [[ -z "${_CFG_INODES_THRESHOLD}" ]] + then + warn "missing filesystem name and/or threshold in configuration file ${_CONFIG_FILE} at data line ${_LINE_COUNT}" + continue + fi + data_is_numeric ${_CFG_INODES_THRESHOLD} + if (( $? > 0 )) + then + warn "parameter is not numeric in configuration file ${_CONFIG_FILE} at data line ${_LINE_COUNT}" + continue + fi + if (( _CFG_INODES_THRESHOLD == 0 || _CFG_INODES_THRESHOLD >= 100 )) + then + (( ARG_DEBUG > 0 )) && debug "found out-of-bounds inodes threshold for ${_CFG_FS}, using general threshold" + _CFG_INODES_THRESHOLD=${_CFG_MAX_INODES_USAGE} + fi + _INODES_USAGE=$(grep -E -e "${_CFG_FS}$" ${_INODES_FILE} 2>/dev/null | awk '{gsub(/%/,"",$5);print $5}' 2>/dev/null) + data_is_numeric ${_INODES_USAGE} + if (( $? > 0 )) + then + warn "discovered value for inodes usage is incorrect [${_CFG_FS}:${_INODES_USAGE}]" + continue + fi + # check against the threshold + if (( _INODES_USAGE > _CFG_INODES_THRESHOLD )) + then + _MSG="${_CFG_FS} exceedes its inode threshold (${_INODES_USAGE}%>${_CFG_INODES_THRESHOLD}%)" + _STC=1 + else + _MSG="${_CFG_FS} does not exceede its inode threshold (${_INODES_USAGE}%<=${_CFG_INODES_THRESHOLD}%)" + _STC=0 + fi + if (( _LOG_HEALTHY > 0 || _STC > 0 )) + then + log_hc "$0" ${_STC} "${_MSG}" ${_INODES_USAGE} ${_CFG_INODES_THRESHOLD} + fi + _LINE_COUNT=$(( _LINE_COUNT + 1 )) + done + # add df output to stdout log_hc + print "==== df -Pil ====" >>${HC_STDOUT_LOG} + cat ${_INODES_FILE} >>${HC_STDOUT_LOG} + (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs + fi + # b) --- space (df -Pl) --- + if (( _DO_SPACE > 0 )) + then + _LINE_COUNT=1 + grep -i '^fs:' ${_CONFIG_FILE} 2>/dev/null |\ + while IFS=':' read _ _CFG_FS _ _CFG_SPACE_THRESHOLD + do + # report on missing FS name or threshold + if [[ -z "${_CFG_FS}" ]] && [[ -z "${_CFG_SPACE_THRESHOLD}" ]] + then + warn "missing filesystem name and/or threshold in configuration file ${_CONFIG_FILE} at data line ${_LINE_COUNT}" + continue + fi + data_is_numeric ${_CFG_SPACE_THRESHOLD} + if (( $? > 0 )) + then + warn "parameter is not numeric in configuration file ${_CONFIG_FILE} at data line ${_LINE_COUNT}" + continue + fi + if (( _CFG_SPACE_THRESHOLD == 0 || _CFG_SPACE_THRESHOLD >= 100 )) + then + (( ARG_DEBUG > 0 )) && debug "found out-of-bounds space threshold for ${_CFG_FS}, using general threshold" + _CFG_SPACE_THRESHOLD=${_CFG_MAX_SPACE_USAGE} + fi + _SPACE_USAGE=$(grep -E -e "${_CFG_FS}$" ${_SPACE_FILE} 2>/dev/null | awk '{gsub(/%/,"",$5);print $5}' 2>/dev/null) + data_is_numeric ${_SPACE_USAGE} + if (( $? > 0 )) + then + warn "discovered value for space usage is incorrect [${_CFG_FS}:${_SPACE_USAGE}]" + continue + fi + # check against the threshold + if (( _SPACE_USAGE > _CFG_SPACE_THRESHOLD )) + then + _MSG="${_CFG_FS} exceedes its space threshold (${_SPACE_USAGE}%>${_CFG_SPACE_THRESHOLD}%)" + _STC=1 + else + _MSG="${_CFG_FS} does not exceede its space threshold (${_SPACE_USAGE}%<=${_CFG_SPACE_THRESHOLD}%)" + _STC=0 + fi + if (( _LOG_HEALTHY > 0 || _STC > 0 )) + then + log_hc "$0" ${_STC} "${_MSG}" ${_SPACE_USAGE} ${_CFG_SPACE_THRESHOLD} + fi + _LINE_COUNT=$(( _LINE_COUNT + 1 )) + done + # add df output to stdout log_hc + print "==== df -Pl ====" >>${HC_STDOUT_LOG} + cat ${_SPACE_FILE} >>${HC_STDOUT_LOG} + (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs + fi +else + # 2) --- ALL FS --- + df -Pl 2>/dev/null | grep '^\/' 2>/dev/null | awk '{print $6}' 2>/dev/null |\ + while read _FS + do + # a) --- inodes (df -Pil) --- + if (( _DO_INODES > 0 )) + then + _INODES_USAGE=$(grep -E -e "${_FS}$" ${_INODES_FILE} 2>/dev/null | awk '{gsub(/%/,"",$5);print $5}' 2>/dev/null) + data_is_numeric ${_INODES_USAGE} + if (( $? > 0 )) + then + warn "discovered value for inodes usage is incorrect [${_FS}:${_INODES_USAGE}]" + (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs + continue + fi + # check against the threshold + if (( _INODES_USAGE > _CFG_MAX_INODES_USAGE )) + then + _MSG="${_FS} exceedes its inode threshold (${_INODES_USAGE}%>${_CFG_MAX_INODES_USAGE}%)" + _STC=1 + else + _MSG="${_FS} does not exceede its inode threshold (${_INODES_USAGE}%<=${_CFG_MAX_INODES_USAGE}%)" + _STC=0 + fi + if (( _LOG_HEALTHY > 0 || _STC > 0 )) + then + log_hc "$0" ${_STC} "${_MSG}" ${_INODES_USAGE} ${_CFG_MAX_INODES_USAGE} + fi + # add df output to stdout log_hc + print "==== df -Pil ====" >>${HC_STDOUT_LOG} + cat ${_INODES_FILE} >>${HC_STDOUT_LOG} + fi + # b) --- space (df -Pl) --- + if (( _DO_SPACE > 0 )) + then + _SPACE_USAGE=$(grep -E -e "${_FS}$" ${_SPACE_FILE} 2>/dev/null | awk '{gsub(/%/,"",$5);print $5}' 2>/dev/null) + data_is_numeric ${_SPACE_USAGE} + if (( $? > 0 )) + then + warn "discovered value for space usage is incorrect [${_FS}:${_SPACE_USAGE}]" + (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && dump_logs + continue + fi + # check against the threshold + if (( _SPACE_USAGE > _CFG_MAX_SPACE_USAGE )) + then + _MSG="${_FS} exceedes its space threshold (${_SPACE_USAGE}%>${_CFG_MAX_SPACE_USAGE}%)" + _STC=1 + else + _MSG="${_FS} does not exceede its space threshold (${_SPACE_USAGE}%<=${_CFG_MAX_SPACE_USAGE}%)" + _STC=0 + fi + if (( _LOG_HEALTHY > 0 || _STC > 0 )) + then + log_hc "$0" ${_STC} "${_MSG}" ${_SPACE_USAGE} ${_CFG_MAX_SPACE_USAGE} + fi + # add df output to stdout log_hc + print "==== df -Pl ====" >>${HC_STDOUT_LOG} + cat ${_SPACE_FILE} >>${HC_STDOUT_LOG} + fi + done +fi + +# do cleanup +rm -f ${_INODES_FILE}.* ${_SPACE_FILE}.* >/dev/null 2>&1 + +return 0 +} + +# ----------------------------------------------------------------------------- +function _show_usage +{ +cat <<- EOT +NAME : $1 +VERSION : $2 +CONFIG : $3 with formatted stanzas (optional): + fs::: + Other options: + check_inodes_usage= + check_space_usage= + max_inodes_usage= + max_space_usage= +EXT OPTS : --hc-args=check_inodes, --hc-args=check_space +PURPOSE : Checks the inodes & space usage for the configured or all (local) filesystems +LOG HEALTHY : Supported + +EOT + +return 0 +} + +#****************************************************************************** +# END of script +#****************************************************************************** diff --git a/sources/lib/platform/linux/check_linux_hpacucli.sh b/sources/lib/platform/linux/check_linux_hpacucli.sh index 5e9e8b4..95b6b08 100644 --- a/sources/lib/platform/linux/check_linux_hpacucli.sh +++ b/sources/lib/platform/linux/check_linux_hpacucli.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_linux_hpacucli # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-09-09: initial version [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,14 +36,14 @@ function check_linux_hpacucli { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC_COUNT=0 diff --git a/sources/lib/platform/linux/check_linux_hpasmcli.sh b/sources/lib/platform/linux/check_linux_hpasmcli.sh index 0956f52..48688b9 100644 --- a/sources/lib/platform/linux/check_linux_hpasmcli.sh +++ b/sources/lib/platform/linux/check_linux_hpasmcli.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_hpasmcli # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-09-07: initial version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,14 +37,14 @@ function check_linux_hpasmcli { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC_COUNT=0 diff --git a/sources/lib/platform/linux/check_linux_hplog.sh b/sources/lib/platform/linux/check_linux_hplog.sh index d8b5f9d..ce94f5c 100644 --- a/sources/lib/platform/linux/check_linux_hplog.sh +++ b/sources/lib/platform/linux/check_linux_hplog.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_linux_hplog # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-04-22: initial version [Patrick Van der Veken] # @(#) 2018-05-21: added dump_logs() & STDERR fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,14 +37,14 @@ function check_linux_hplog # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _STATE_FILE="${STATE_PERM_DIR}/discovered.hplog" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_hpssacli.sh b/sources/lib/platform/linux/check_linux_hpssacli.sh index 78aeae5..999699a 100644 --- a/sources/lib/platform/linux/check_linux_hpssacli.sh +++ b/sources/lib/platform/linux/check_linux_hpssacli.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_linux_hpssacli # DOES: _show_usage() # EXPECTS: _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2016-04-01: initial version [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,14 +36,14 @@ function check_linux_hpssacli { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC_COUNT=0 diff --git a/sources/lib/platform/linux/check_linux_httpd_status.sh b/sources/lib/platform/linux/check_linux_httpd_status.sh index 978ade6..948fa8d 100644 --- a/sources/lib/platform/linux/check_linux_httpd_status.sh +++ b/sources/lib/platform/linux/check_linux_httpd_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_httpd_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), linux_get_init(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), linux_get_init(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-04-23: initial version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) 2017-05-17: removed _MSG dupe [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-11-18: add linux_has_systemd_service() [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -37,14 +38,14 @@ function check_linux_httpd_status # ------------------------- CONFIGURATION starts here ------------------------- typeset _HTTPD_INIT_SCRIPT="/etc/init.d/httpd" typeset _HTTPD_SYSTEMD_SERVICE="httpd.service" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _CHECK_SYSTEMD_SERVICE=0 typeset _HTTPD_BIN="" diff --git a/sources/lib/platform/linux/check_linux_named_status.sh b/sources/lib/platform/linux/check_linux_named_status.sh index c1c5678..b6372ba 100644 --- a/sources/lib/platform/linux/check_linux_named_status.sh +++ b/sources/lib/platform/linux/check_linux_named_status.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_linux_named_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), linux_get_init(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), linux_get_init(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-12-01: initial version [Patrick Van der Veken] # @(#) 2017-05-08: fix fall-back for sysv->pgrep [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-11-18: add linux_has_systemd_service() [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -34,14 +35,14 @@ function check_linux_named_status { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_ntp_status.sh b/sources/lib/platform/linux/check_linux_ntp_status.sh index 167d21e..ce66710 100644 --- a/sources/lib/platform/linux/check_linux_ntp_status.sh +++ b/sources/lib/platform/linux/check_linux_ntp_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_ntp_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc(), +# REQUIRES: data_comma2space(), init_hc(), log_hc(), # linux_has_systemd_service(), warn() # # @(#) HISTORY: @@ -33,6 +33,7 @@ # @(#) 'force_chrony', added check on chronyd service alive, added # @(#) run user for chronyd+ntpd, added forced IPv4 support for ntpq, # @(#) fixed problem with offset calculation [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #------------------------------------------------------------------------------ @@ -48,7 +49,7 @@ typeset _CHRONYD_SYSTEMD_SERVICE="chronyd.service" typeset _NTPD_SYSTEMD_SERVICE="ntpd.service" typeset _CHRONYD_USER="chrony" typeset _NTPD_USER="ntp" -typeset _VERSION="2019-01-10" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match typeset _CHRONYC_BIN="/bin/chronyc" typeset _NTPQ_BIN="/usr/sbin/ntpq" @@ -58,7 +59,7 @@ typeset _NTPQ_OPTS="-pn" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 @@ -448,17 +449,19 @@ return 0 function _show_usage { cat <<- EOT -NAME : $1 -VERSION : $2 -CONFIG : $3 with: - log_healthy= - max_offset= - force_chrony= - force_ntp= - ntpq_use_ipv4= -PURPOSE : Checks the status of NTP service & synchronization. - Supports chronyd & ntpd. - Assumes chronyd is the preferred time synchronization. +NAME : $1 +VERSION : $2 +CONFIG : $3 with: + log_healthy= + max_offset= + force_chrony= + force_ntp= + ntpq_use_ipv4= +EXTRA OPTS : --hc-args=force_chrony, --hc-args=force_ntp +PURPOSE : Checks the status of NTP service & synchronization. + Supports chronyd & ntpd. + Assumes chronyd is the preferred time synchronization. +LOG HEALTHY : Supported EOT diff --git a/sources/lib/platform/linux/check_linux_postfix_status.sh b/sources/lib/platform/linux/check_linux_postfix_status.sh index 780c9ec..288016b 100644 --- a/sources/lib/platform/linux/check_linux_postfix_status.sh +++ b/sources/lib/platform/linux/check_linux_postfix_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_postfix_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), linux_get_init(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), linux_get_init(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2016-12-01: initial version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) for sysv->pgrep[Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-11-18: add linux_has_systemd_service() [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -37,14 +38,14 @@ function check_linux_postfix_status # ------------------------- CONFIGURATION starts here ------------------------- typeset _POSTFIX_INIT_SCRIPT="/etc/init.d/postfix" typeset _POSTFIX_SYSTEMD_SERVICE="postfix.service" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _POSTFIX_BIN="" typeset _MSG="" diff --git a/sources/lib/platform/linux/check_linux_process_limits.sh b/sources/lib/platform/linux/check_linux_process_limits.sh index b0a1b0e..e12fe1f 100644 --- a/sources/lib/platform/linux/check_linux_process_limits.sh +++ b/sources/lib/platform/linux/check_linux_process_limits.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_linux_process_limits # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc(), data_is_numeric() # # @(#) HISTORY: # @(#) 2018-07-10: original version [Patrick Van der Veken] # @(#) 2018-07-12: better log_healthy handling [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,14 +36,14 @@ function check_linux_process_limits { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _LINE_COUNT=1 diff --git a/sources/lib/platform/linux/check_linux_root_crontab.sh b/sources/lib/platform/linux/check_linux_root_crontab.sh index c55e12d..522e503 100644 --- a/sources/lib/platform/linux/check_linux_root_crontab.sh +++ b/sources/lib/platform/linux/check_linux_root_crontab.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_linux_root_crontab # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-09-19: initial version [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -33,14 +34,14 @@ function check_linux_root_crontab { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-05-21" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_samba_status.sh b/sources/lib/platform/linux/check_linux_samba_status.sh index 7198414..de4e847 100644 --- a/sources/lib/platform/linux/check_linux_samba_status.sh +++ b/sources/lib/platform/linux/check_linux_samba_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_samba_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), linux_get_init(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), linux_get_init(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-17: initial version [Patrick Van der Veken] @@ -28,6 +28,7 @@ # @(#) 2017-07-23: fix for systemd service names [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-11-18: add linux_has_systemd_service() [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -39,14 +40,14 @@ function check_linux_samba_status typeset _SMB_INIT_SCRIPT="/etc/init.d/samba" typeset _SMB_SYSTEMD_SERVICE="smb.service" typeset _NMB_SYSTEMD_SERVICE="nmb.service" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_sg_cluster_config.sh b/sources/lib/platform/linux/check_linux_sg_cluster_config.sh index ebf0cf4..327bd8b 100644 --- a/sources/lib/platform/linux/check_linux_sg_cluster_config.sh +++ b/sources/lib/platform/linux/check_linux_sg_cluster_config.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_linux_sg_cluster_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2017-04-01: initial version [Patrick Van der Veken] # @(#) 2018-05-21: added dump_logs() & other fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,7 +36,7 @@ function check_linux_sg_cluster_config { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match typeset _SG_DAEMON="/opt/cmcluster/bin/cmcld" # rubbish that cmgetconf outputs to STDOUT instead of STDERR @@ -46,7 +47,7 @@ typeset _SG_CMGETCONF_FILTER="Permission denied|Number of configured" (( 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 "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_sg_cluster_status.sh b/sources/lib/platform/linux/check_linux_sg_cluster_status.sh index b2d527e..6ed8bb4 100644 --- a/sources/lib/platform/linux/check_linux_sg_cluster_status.sh +++ b/sources/lib/platform/linux/check_linux_sg_cluster_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_sg_cluster_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2017-04-01: initial version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,7 +37,7 @@ function check_linux_sg_cluster_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match typeset _SG_DAEMON="/opt/cmcluster/bin/cmcld" # ------------------------- CONFIGURATION ends here --------------------------- @@ -45,7 +46,7 @@ typeset _SG_DAEMON="/opt/cmcluster/bin/cmcld" (( 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 "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_sg_package_config.sh b/sources/lib/platform/linux/check_linux_sg_package_config.sh index 1b7661d..32e1cd5 100644 --- a/sources/lib/platform/linux/check_linux_sg_package_config.sh +++ b/sources/lib/platform/linux/check_linux_sg_package_config.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_linux_sg_package_config # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2017-04-01: initial version [Patrick Van der Veken] # @(#) 2018-05-21: added dump_logs() & other fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] # @(#) 2018-11-18: do not trap on signal 0 [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,7 +36,7 @@ function check_linux_sg_package_config { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match typeset _SG_DAEMON="/opt/cmcluster/bin/cmcld" # rubbish that cmgetconf outputs to STDOUT instead of STDERR @@ -46,7 +47,7 @@ typeset _SG_CMGETCONF_FILTER="Permission denied|Number of configured" (( 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 "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_sg_package_status.sh b/sources/lib/platform/linux/check_linux_sg_package_status.sh index af88585..1c0c413 100644 --- a/sources/lib/platform/linux/check_linux_sg_package_status.sh +++ b/sources/lib/platform/linux/check_linux_sg_package_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_sg_package_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2017-04-01: initial version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,7 +37,7 @@ function check_linux_sg_package_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match typeset _SG_DAEMON="/opt/cmcluster/bin/cmcld" # ------------------------- CONFIGURATION ends here --------------------------- @@ -45,7 +46,7 @@ typeset _SG_DAEMON="/opt/cmcluster/bin/cmcld" (( 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 "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_sg_qs_status.sh b/sources/lib/platform/linux/check_linux_sg_qs_status.sh index 3805604..e037186 100644 --- a/sources/lib/platform/linux/check_linux_sg_qs_status.sh +++ b/sources/lib/platform/linux/check_linux_sg_qs_status.sh @@ -19,11 +19,12 @@ # @(#) MAIN: check_linux_sg_qs_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2017-05-01: initial version [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -32,7 +33,7 @@ function check_linux_sg_qs_status { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match typeset _QS_BIN="/opt/qs/bin/qsc" typeset _QS_AUTH_FILE="/opt/qs/conf/qs_authfile" @@ -41,7 +42,7 @@ typeset _QS_AUTH_FILE="/opt/qs/conf/qs_authfile" # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_shorewall_status.sh b/sources/lib/platform/linux/check_linux_shorewall_status.sh index 7453302..454b7e9 100644 --- a/sources/lib/platform/linux/check_linux_shorewall_status.sh +++ b/sources/lib/platform/linux/check_linux_shorewall_status.sh @@ -19,10 +19,11 @@ # @(#) MAIN: check_linux_shorewall_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2016-12-01: initial version [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -32,14 +33,14 @@ function check_linux_shorewall_status { # ------------------------- CONFIGURATION starts here ------------------------- typeset _SHOREWALL_BIN="/sbin/shorewall" -typeset _VERSION="2016-12-01" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0 diff --git a/sources/lib/platform/linux/check_linux_sshd_status.sh b/sources/lib/platform/linux/check_linux_sshd_status.sh index 58239f7..8ba774f 100644 --- a/sources/lib/platform/linux/check_linux_sshd_status.sh +++ b/sources/lib/platform/linux/check_linux_sshd_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_sshd_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), linux_get_init(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), linux_get_init(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2016-12-01: initial version [Patrick Van der Veken] @@ -27,6 +27,7 @@ # @(#) 2017-05-08: set init/systemd based on distro [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-11-18: add linux_has_systemd_service() [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -35,14 +36,14 @@ function check_linux_sshd_status { # ------------------------- CONFIGURATION starts here ------------------------- -typeset _VERSION="2018-11-18" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _SSHD_INIT_SCRIPT="" diff --git a/sources/lib/platform/linux/check_linux_vz_ct_status.sh b/sources/lib/platform/linux/check_linux_vz_ct_status.sh index 6db4d06..0b089bc 100644 --- a/sources/lib/platform/linux/check_linux_vz_ct_status.sh +++ b/sources/lib/platform/linux/check_linux_vz_ct_status.sh @@ -19,7 +19,7 @@ # @(#) MAIN: check_linux_vz_ct_status # DOES: see _show_usage() # EXPECTS: see _show_usage() -# REQUIRES: data_space2comma(), dump_logs(), init_hc(), log_hc(), warn() +# REQUIRES: data_comma2space(), dump_logs(), init_hc(), log_hc(), warn() # # @(#) HISTORY: # @(#) 2017-04-01: initial version [Patrick Van der Veken] @@ -29,6 +29,7 @@ # @(#) 2018-05-20: added dump_logs() [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] # @(#) 2018-10-28: fixed (linter) errors [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -39,14 +40,14 @@ function check_linux_vz_ct_status # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" typeset _VZLIST_BIN="/usr/sbin/vzlist" -typeset _VERSION="2018-10-28" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _LINE_COUNT=1 typeset _CT_ENTRY="" diff --git a/sources/lib/platform/linux/check_linux_winbind_status.sh b/sources/lib/platform/linux/check_linux_winbind_status.sh index 9c04865..11244c3 100644 --- a/sources/lib/platform/linux/check_linux_winbind_status.sh +++ b/sources/lib/platform/linux/check_linux_winbind_status.sh @@ -19,13 +19,14 @@ # @(#) MAIN: check_linux_winbind_status # DOES: see _show_usage() # EXPECTS: n/a -# REQUIRES: data_space2comma(), linux_get_init(), init_hc(), log_hc() +# REQUIRES: data_comma2space(), linux_get_init(), init_hc(), log_hc() # # @(#) HISTORY: # @(#) 2013-05-17: initial version [Patrick Van der Veken] # @(#) 2016-12-01: added systemd code [Patrick Van der Veken] # @(#) 2017-05-08: fix fall-back for sysv->pgrep [Patrick Van der Veken] # @(#) 2018-05-21: STDERR fixes [Patrick Van der Veken] +# @(#) 2019-01-24: arguments fix [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -36,14 +37,14 @@ function check_linux_winbind_status # ------------------------- CONFIGURATION starts here ------------------------- typeset _WINBIND_INIT_SCRIPT="/etc/init.d/winbind" typeset _WINBIND_SYSTEMD_SERVICE="winbind.service" -typeset _VERSION="2018-05-21" # YYYY-MM-DD +typeset _VERSION="2019-01-24" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- # set defaults (( ARG_DEBUG > 0 && ARG_DEBUG_LEVEL > 0 )) && set ${DEBUG_OPTS} init_hc "$0" "${_SUPPORTED_PLATFORMS}" "${_VERSION}" -typeset _ARGS=$(data_space2comma "$*") +typeset _ARGS=$(data_comma2space "$*") typeset _ARG="" typeset _MSG="" typeset _STC=0