* New plugin check_hpux_fs_usage + check_linux_fs_usage()

* Fix for archiving issue (not rotating until HC_LOG becomes empty)
* Fix for data_space2comma -> data_comma2space
* Report layout updates
* Smaller fixes + updates
This commit is contained in:
Patrick Van der Veken
2019-01-24 20:53:51 +01:00
parent cbddbf0eec
commit 178dcc6ad3
94 changed files with 1160 additions and 273 deletions
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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)
@@ -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:<fs_name>:<max_INODES_USAGE_in_%>:<max_space_usage_in%>
Other options:
check_inodes_usage=<yes|no>
check_space_usage=<yes|no>
max_inodes_usage=<general_inodes_usage_treshold>
max_space_usage=<general_space_usage_treshold>
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
#******************************************************************************
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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=""
@@ -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
@@ -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=<yes|no>
max_offset=<max_offset (ms)>
force_chrony=<yes|no>
force_ntp=<yes|no>
ntpq_use_ipv4=<yes|no>
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=<yes|no>
max_offset=<max_offset (ms)>
force_chrony=<yes|no>
force_ntp=<yes|no>
ntpq_use_ipv4=<yes|no>
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
@@ -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=""
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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=""
@@ -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=""
@@ -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