This commit is contained in:
patvdv 2019-03-10 12:05:43 +01:00
parent cf4683d6b8
commit 7371dc12da
25 changed files with 38 additions and 30 deletions

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# specify file details # specify file details
# Format: # Format:

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# name of the state file to use (will be relative to /var/opt/hc/state/persistent # name of the state file to use (will be relative to /var/opt/hc/state/persistent
# [default: discovered.file_change] # [default: discovered.file_change]

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# specify whether to perform inode usage check # specify whether to perform inode usage check
# [default: yes] # [default: yes]

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# location of 'hpacucli' tool # location of 'hpacucli' tool
hpacucli_bin="/usr/sbin/hpacucli" hpacucli_bin="/usr/sbin/hpacucli"

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# location of 'hpasmcli' tool # location of 'hpasmcli' tool
hpasmcli_bin="/sbin/hpasmcli" hpasmcli_bin="/sbin/hpasmcli"

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# location of 'hpacucli' tool # location of 'hpacucli' tool
hplog_bin="/sbin/hplog" hplog_bin="/sbin/hplog"

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# location of 'hpssacli' tool # location of 'hpssacli' tool
hpssacli_bin="/usr/sbin/hpssacli" hpssacli_bin="/usr/sbin/hpssacli"

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# specify whether to perform table checks (mysqlcheck) # specify whether to perform table checks (mysqlcheck)
# MySQL privileges required: SHOW DATABASES, SELECT (global or per database) # MySQL privileges required: SHOW DATABASES, SELECT (global or per database)

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# whether to force the use of chronyd? # whether to force the use of chronyd?
# [default: no] # [default: no]

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="no" log_healthy="yes"
# -- user stanzas -- # -- user stanzas --
# supported limit checks: Max open files; Max processes # supported limit checks: Max open files; Max processes

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# list of commands (or strings) that should appear in active cron entries # list of commands (or strings) that should appear in active cron entries
# Format: # Format:

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# list of required cluster statuses # list of required cluster statuses
# Format: # Format:

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# list of required package statuses # list of required package statuses
# Format: # Format:

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# specify containers for which to check the UBC # specify containers for which to check the UBC
# Format: # Format:

View File

@ -9,7 +9,7 @@
# specify whether to also log passed health checks # specify whether to also log passed health checks
# (warning: this may rapidly grow the HC log) # (warning: this may rapidly grow the HC log)
# [default: no] # [default: no]
log_healthy="yes" log_healthy="no"
# specify properties as displayed by the 'vzlist -a -H -o ctid,status,onboot' command # specify properties as displayed by the 'vzlist -a -H -o ctid,status,onboot' command
# Format: # Format:

View File

@ -19,7 +19,8 @@
# @(#) MAIN: check_linux_burp_backup # @(#) MAIN: check_linux_burp_backup
# DOES: see _show_usage() # DOES: see _show_usage()
# EXPECTS: see _show_usage() # EXPECTS: see _show_usage()
# REQUIRES: data_comma2space(), init_hc(), log_hc(), warn() # REQUIRES: data_comma2space(), data_is_numeric(), data_strip_outer_space(),
# init_hc(), log_hc(), warn()
# GNU date that can calculate UNIX epoch seconds from given date, # GNU date that can calculate UNIX epoch seconds from given date,
# BURP server must be be able to impersonate configured clients # BURP server must be be able to impersonate configured clients
# #
@ -97,7 +98,7 @@ esac
# check for old-style configuration file (non-prefixed stanzas) # check for old-style configuration file (non-prefixed stanzas)
_IS_OLD_STYLE=$(grep -c -E -e "^client:" ${_CONFIG_FILE} 2>/dev/null) _IS_OLD_STYLE=$(grep -c -E -e "^client:" ${_CONFIG_FILE} 2>/dev/null)
if (( _IS_OLD_STYLE > 0 )) if (( _IS_OLD_STYLE == 0 ))
then then
warn "no 'client:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?" warn "no 'client:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?"
return 1 return 1
@ -119,15 +120,12 @@ fi
# check for capable GNU date # check for capable GNU date
_GNU_DATE=$(date --date="1 day ago" '+%s' 2>/dev/null) _GNU_DATE=$(date --date="1 day ago" '+%s' 2>/dev/null)
case "${_GNU_DATE}" in data_is_numeric "${_GNU_DATE}"
+([0-9])*(.)*([0-9])) if (( $? > 0 ))
# numeric, OK then
;;
*)
warn "no capable GNU date found here" warn "no capable GNU date found here"
return 1 return 1
;; fi
esac
# find burp # find burp
_BURP_BIN="$(which burp 2>/dev/null)" _BURP_BIN="$(which burp 2>/dev/null)"
@ -246,12 +244,14 @@ do
# first check client override # first check client override
_BURP_BACKUP_DIR=""; _BURP_CLIENTCONF_DIR="" _BURP_BACKUP_DIR=""; _BURP_CLIENTCONF_DIR=""
_BURP_CLIENTCONF_DIR=$(_CONFIG_FILE="${_BURP_SERVER_CONFIG_FILE}" data_get_lvalue_from_config 'clientconfdir') _BURP_CLIENTCONF_DIR=$(_CONFIG_FILE="${_BURP_SERVER_CONFIG_FILE}" data_get_lvalue_from_config 'clientconfdir')
_BURP_CLIENTCONF_DIR=$(data_strip_outer_space "${_BURP_CLIENTCONF_DIR}")
if [[ -n "${_BURP_CLIENTCONF_DIR}" ]] if [[ -n "${_BURP_CLIENTCONF_DIR}" ]]
then then
_BURP_CLIENTCONF_FILE=${_BURP_CLIENTCONF_DIR}/${_BURP_CLIENT} _BURP_CLIENTCONF_FILE=${_BURP_CLIENTCONF_DIR}/${_BURP_CLIENT}
if [[ -r ${_BURP_CLIENTCONF_FILE} ]] if [[ -r ${_BURP_CLIENTCONF_FILE} ]]
then then
_BURP_BACKUP_DIR=$(_CONFIG_FILE="${_BURP_CLIENTCONF_FILE}" data_get_lvalue_from_config 'directory') _BURP_BACKUP_DIR=$(_CONFIG_FILE="${_BURP_CLIENTCONF_FILE}" data_get_lvalue_from_config 'directory')
_BURP_BACKUP_DIR=$(data_strip_outer_space "${_BURP_BACKUP_DIR}")
else else
warn "no client configuration file for client ${_BURP_CLIENT}, trying server configuration next" warn "no client configuration file for client ${_BURP_CLIENT}, trying server configuration next"
fi fi
@ -260,6 +260,7 @@ do
if [[ -z "${_BURP_BACKUP_DIR}" ]] if [[ -z "${_BURP_BACKUP_DIR}" ]]
then then
_BURP_BACKUP_DIR=$(_CONFIG_FILE="${_BURP_SERVER_CONFIG_FILE}" data_get_lvalue_from_config 'directory') _BURP_BACKUP_DIR=$(_CONFIG_FILE="${_BURP_SERVER_CONFIG_FILE}" data_get_lvalue_from_config 'directory')
_BURP_BACKUP_DIR=$(data_strip_outer_space "${_BURP_BACKUP_DIR}")
if [[ -z "${_BURP_BACKUP_DIR}" ]] if [[ -z "${_BURP_BACKUP_DIR}" ]]
then then
warn "could not determine backup directory from 'clientconfdir' or 'directory' directives' for client ${_BURP_CLIENT}" warn "could not determine backup directory from 'clientconfdir' or 'directory' directives' for client ${_BURP_CLIENT}"

View File

@ -75,6 +75,7 @@ then
warn "unable to read configuration file at ${_CONFIG_FILE}" warn "unable to read configuration file at ${_CONFIG_FILE}"
return 1 return 1
fi fi
_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy')
case "${_CFG_HEALTHY}" in case "${_CFG_HEALTHY}" in
yes|YES|Yes) yes|YES|Yes)
_LOG_HEALTHY=1 _LOG_HEALTHY=1
@ -87,7 +88,7 @@ esac
# check for old-style configuration file (non-prefixed stanzas) # check for old-style configuration file (non-prefixed stanzas)
_IS_OLD_STYLE=$(grep -c -E -e "^file:" ${_CONFIG_FILE} 2>/dev/null) _IS_OLD_STYLE=$(grep -c -E -e "^file:" ${_CONFIG_FILE} 2>/dev/null)
if (( _IS_OLD_STYLE > 0 )) if (( _IS_OLD_STYLE == 0 ))
then then
warn "no 'file:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?" warn "no 'file:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?"
return 1 return 1

View File

@ -116,6 +116,7 @@ case "${_DO_META_CHECK}" in
log "check for meta characters is enabled" log "check for meta characters is enabled"
;; ;;
esac esac
_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy')
case "${_CFG_HEALTHY}" in case "${_CFG_HEALTHY}" in
yes|YES|Yes) yes|YES|Yes)
_LOG_HEALTHY=1 _LOG_HEALTHY=1

View File

@ -142,6 +142,7 @@ then
log "switching setting 'do_acu_controller' to 1 to fetch slot info" log "switching setting 'do_acu_controller' to 1 to fetch slot info"
_DO_ACU_CTRL=1 _DO_ACU_CTRL=1
fi fi
_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy')
case "${_CFG_HEALTHY}" in case "${_CFG_HEALTHY}" in
yes|YES|Yes) yes|YES|Yes)
_LOG_HEALTHY=1 _LOG_HEALTHY=1

View File

@ -149,6 +149,7 @@ case "${_DO_ASM_TEMP}" in
_DO_ASM_TEMP=1 _DO_ASM_TEMP=1
;; ;;
esac esac
_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy')
case "${_CFG_HEALTHY}" in case "${_CFG_HEALTHY}" in
yes|YES|Yes) yes|YES|Yes)
_LOG_HEALTHY=1 _LOG_HEALTHY=1

View File

@ -105,6 +105,7 @@ else
# delete last 'OR' # delete last 'OR'
_HPLOG_SEVERITIES=${_HPLOG_SEVERITIES%?} _HPLOG_SEVERITIES=${_HPLOG_SEVERITIES%?}
fi fi
_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy')
case "${_CFG_HEALTHY}" in case "${_CFG_HEALTHY}" in
yes|YES|Yes) yes|YES|Yes)
_LOG_HEALTHY=1 _LOG_HEALTHY=1

View File

@ -142,6 +142,7 @@ then
log "switching setting 'do_ssa_controller' to 1 to fetch slot info" log "switching setting 'do_ssa_controller' to 1 to fetch slot info"
_DO_SSA_CTRL=1 _DO_SSA_CTRL=1
fi fi
_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy')
case "${_CFG_HEALTHY}" in case "${_CFG_HEALTHY}" in
yes|YES|Yes) yes|YES|Yes)
_LOG_HEALTHY=1 _LOG_HEALTHY=1

View File

@ -71,6 +71,7 @@ then
warn "unable to read configuration file at ${_CONFIG_FILE}" warn "unable to read configuration file at ${_CONFIG_FILE}"
return 1 return 1
fi fi
_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy')
case "${_CFG_HEALTHY}" in case "${_CFG_HEALTHY}" in
yes|YES|Yes) yes|YES|Yes)
_LOG_HEALTHY=1 _LOG_HEALTHY=1
@ -83,7 +84,7 @@ esac
# check for old-style configuration file (non-prefixed stanzas) # check for old-style configuration file (non-prefixed stanzas)
_IS_OLD_STYLE=$(grep -c -E -e "^cron:" ${_CONFIG_FILE} 2>/dev/null) _IS_OLD_STYLE=$(grep -c -E -e "^cron:" ${_CONFIG_FILE} 2>/dev/null)
if (( _IS_OLD_STYLE > 0 )) if (( _IS_OLD_STYLE == 0 ))
then then
warn "no 'cron:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?" warn "no 'cron:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?"
return 1 return 1

View File

@ -91,7 +91,7 @@ esac
# check for old-style configuration file (non-prefixed stanzas) # check for old-style configuration file (non-prefixed stanzas)
_IS_OLD_STYLE=$(grep -c -E -e "^sg:" ${_CONFIG_FILE} 2>/dev/null) _IS_OLD_STYLE=$(grep -c -E -e "^sg:" ${_CONFIG_FILE} 2>/dev/null)
if (( _IS_OLD_STYLE > 0 )) if (( _IS_OLD_STYLE == 0 ))
then then
warn "no 'sg:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?" warn "no 'sg:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?"
return 1 return 1

View File

@ -92,7 +92,7 @@ esac
# check for old-style configuration file (non-prefixed stanzas) # check for old-style configuration file (non-prefixed stanzas)
_IS_OLD_STYLE=$(grep -c -E -e "^sg:" ${_CONFIG_FILE} 2>/dev/null) _IS_OLD_STYLE=$(grep -c -E -e "^sg:" ${_CONFIG_FILE} 2>/dev/null)
if (( _IS_OLD_STYLE > 0 )) if (( _IS_OLD_STYLE == 0 ))
then then
warn "no 'sg:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?" warn "no 'sg:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?"
return 1 return 1