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
# (warning: this may rapidly grow the HC log)
# [default: no]
log_healthy="yes"
log_healthy="no"
# specify file details
# Format:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,7 +19,8 @@
# @(#) MAIN: check_linux_burp_backup
# DOES: 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,
# BURP server must be be able to impersonate configured clients
#
@ -97,7 +98,7 @@ esac
# check for old-style configuration file (non-prefixed stanzas)
_IS_OLD_STYLE=$(grep -c -E -e "^client:" ${_CONFIG_FILE} 2>/dev/null)
if (( _IS_OLD_STYLE > 0 ))
if (( _IS_OLD_STYLE == 0 ))
then
warn "no 'client:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?"
return 1
@ -119,15 +120,12 @@ fi
# check for capable GNU date
_GNU_DATE=$(date --date="1 day ago" '+%s' 2>/dev/null)
case "${_GNU_DATE}" in
+([0-9])*(.)*([0-9]))
# numeric, OK
;;
*)
warn "no capable GNU date found here"
return 1
;;
esac
data_is_numeric "${_GNU_DATE}"
if (( $? > 0 ))
then
warn "no capable GNU date found here"
return 1
fi
# find burp
_BURP_BIN="$(which burp 2>/dev/null)"
@ -246,12 +244,14 @@ do
# first check client override
_BURP_BACKUP_DIR=""; _BURP_CLIENTCONF_DIR=""
_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}" ]]
then
_BURP_CLIENTCONF_FILE=${_BURP_CLIENTCONF_DIR}/${_BURP_CLIENT}
if [[ -r ${_BURP_CLIENTCONF_FILE} ]]
then
_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
warn "no client configuration file for client ${_BURP_CLIENT}, trying server configuration next"
fi
@ -260,6 +260,7 @@ do
if [[ -z "${_BURP_BACKUP_DIR}" ]]
then
_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}" ]]
then
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}"
return 1
fi
_CFG_HEALTHY=$(_CONFIG_FILE="${_CONFIG_FILE}" data_get_lvalue_from_config 'log_healthy')
case "${_CFG_HEALTHY}" in
yes|YES|Yes)
_LOG_HEALTHY=1
@ -87,7 +88,7 @@ esac
# check for old-style configuration file (non-prefixed stanzas)
_IS_OLD_STYLE=$(grep -c -E -e "^file:" ${_CONFIG_FILE} 2>/dev/null)
if (( _IS_OLD_STYLE > 0 ))
if (( _IS_OLD_STYLE == 0 ))
then
warn "no 'file:' stanza(s) found in ${_CONFIG_FILE}; possibly an old-style configuration?"
return 1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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