From eed20b7110300b1749df61e11ecddcf489f22799 Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Sat, 18 Apr 2020 23:14:48 +0200 Subject: [PATCH 1/8] Comment fix --- etc/opt/hc/check_hpux_autofs.conf.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/opt/hc/check_hpux_autofs.conf.dist b/etc/opt/hc/check_hpux_autofs.conf.dist index c59c10c..29e0c22 100644 --- a/etc/opt/hc/check_hpux_autofs.conf.dist +++ b/etc/opt/hc/check_hpux_autofs.conf.dist @@ -1,7 +1,7 @@ #****************************************************************************** # @(#) check_linux_autofs.conf #****************************************************************************** -# This is a configuration file for the check_linux_autofs HC plugin. +# This is a configuration file for the check_hpux_autofs HC plugin. # All lines starting with a '#' are comment lines. # [default: indicates hardcoded script values if no value is defined here] #****************************************************************************** From 6028a3ad13234823db5568f2d9a079493bc4c38c Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Sat, 18 Apr 2020 23:15:37 +0200 Subject: [PATCH 2/8] Comment fix --- etc/opt/hc/check_hpux_autofs.conf.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/opt/hc/check_hpux_autofs.conf.dist b/etc/opt/hc/check_hpux_autofs.conf.dist index 29e0c22..3808199 100644 --- a/etc/opt/hc/check_hpux_autofs.conf.dist +++ b/etc/opt/hc/check_hpux_autofs.conf.dist @@ -1,5 +1,5 @@ #****************************************************************************** -# @(#) check_linux_autofs.conf +# @(#) check_hpux_autofs.conf #****************************************************************************** # This is a configuration file for the check_hpux_autofs HC plugin. # All lines starting with a '#' are comment lines. From 36726086c26c442b56b6bad9d1c373bb613a775d Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Sat, 18 Apr 2020 23:35:04 +0200 Subject: [PATCH 3/8] Comment fix --- etc/opt/hc/check_hpux_hpvm_vpar_status.conf.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/opt/hc/check_hpux_hpvm_vpar_status.conf.dist b/etc/opt/hc/check_hpux_hpvm_vpar_status.conf.dist index 7bd2745..f79eaa5 100644 --- a/etc/opt/hc/check_hpux_hpvm_vpar_status.conf.dist +++ b/etc/opt/hc/check_hpux_hpvm_vpar_status.conf.dist @@ -11,7 +11,7 @@ # [default: no] log_healthy="no" -# specify properties as displayed by the 'vzlist -a -H -o ctid,status,onboot' command +# specify properties as displayed by the 'hpvmstatus -M' command # Format: # [vpar:::] # runtime_status should be 'on' or 'off' From c0a22a0513d0ae6cc33ec672c49930fb131e4008 Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Sun, 19 Apr 2020 11:18:51 +0200 Subject: [PATCH 4/8] Comment fix --- etc/opt/hc/check_serviceguard_package_status.conf.dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/opt/hc/check_serviceguard_package_status.conf.dist b/etc/opt/hc/check_serviceguard_package_status.conf.dist index c449f8a..f73a18a 100644 --- a/etc/opt/hc/check_serviceguard_package_status.conf.dist +++ b/etc/opt/hc/check_serviceguard_package_status.conf.dist @@ -1,7 +1,7 @@ #****************************************************************************** -# @(#) check_linux_sg_package_status.conf +# @(#) check_serviceguard_package_status.conf #****************************************************************************** -# This is a configuration file for the check_linux_sg_package_status HC plugin. +# This is a configuration file for the check_serviceguard_package_status HC plugin. # All lines starting with a '#' are comment lines. # [default: indicates hardcoded script values if no value is defined here] #****************************************************************************** From 32c8d035c0790d75758f89f932f5708e9a57b2ff Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Wed, 29 Apr 2020 19:38:39 +0200 Subject: [PATCH 5/8] Fix in conffiles --- build/linux/DEBIAN/hc-linux/conffiles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/linux/DEBIAN/hc-linux/conffiles b/build/linux/DEBIAN/hc-linux/conffiles index bab44ac..b199f59 100644 --- a/build/linux/DEBIAN/hc-linux/conffiles +++ b/build/linux/DEBIAN/hc-linux/conffiles @@ -1,4 +1,4 @@ -/etc/opt/hc/core/templates/check_health.conf +/etc/opt/hc/core/check_health.conf /etc/opt/hc/core/templates/mail_body.tpl /etc/opt/hc/core/templates/mail_footer.tpl /etc/opt/hc/core/templates/mail_header.tpl From c1896ec1c2483874cb36c3c56016a680485e9c16 Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Wed, 29 Apr 2020 19:40:59 +0200 Subject: [PATCH 6/8] Fix in conffiles --- build/linux/DEBIAN/hc-linux/conffiles | 1 - 1 file changed, 1 deletion(-) diff --git a/build/linux/DEBIAN/hc-linux/conffiles b/build/linux/DEBIAN/hc-linux/conffiles index b199f59..1202498 100644 --- a/build/linux/DEBIAN/hc-linux/conffiles +++ b/build/linux/DEBIAN/hc-linux/conffiles @@ -1,4 +1,3 @@ -/etc/opt/hc/core/check_health.conf /etc/opt/hc/core/templates/mail_body.tpl /etc/opt/hc/core/templates/mail_footer.tpl /etc/opt/hc/core/templates/mail_header.tpl From 35ffe17b65f08b8d0f2dea965bb3b6a9e03b71bf Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Fri, 8 May 2020 21:20:42 +0200 Subject: [PATCH 7/8] Add pgrep als another fallback check --- .../lib/platform/linux/check_linux_postfix_status.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/opt/hc/lib/platform/linux/check_linux_postfix_status.sh b/opt/hc/lib/platform/linux/check_linux_postfix_status.sh index c06f495..17c1bd4 100755 --- a/opt/hc/lib/platform/linux/check_linux_postfix_status.sh +++ b/opt/hc/lib/platform/linux/check_linux_postfix_status.sh @@ -31,6 +31,7 @@ # @(#) 2019-03-09: added support for --log-healthy [Patrick Van der Veken] # @(#) 2019-03-16: replace 'which' [Patrick Van der Veken] # @(#) 2019-03-25: fix for older Debian & Ubuntu [Patrick Van der Veken] +# @(#) 2020-05-08: add pgrep als fallback check [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -41,7 +42,7 @@ function check_linux_postfix_status # ------------------------- CONFIGURATION starts here ------------------------- typeset _POSTFIX_INIT_SCRIPT="/etc/init.d/postfix" typeset _POSTFIX_SYSTEMD_SERVICE="postfix.service" -typeset _VERSION="2019-03-25" # YYYY-MM-DD +typeset _VERSION="2020-05-08" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- @@ -135,7 +136,8 @@ then then if (( $(${_POSTFIX_BIN} status 2>>${HC_STDERR_LOG} | grep -c -i 'is running' 2>/dev/null) == 0 )) then - _STC=1 + _RC=1 + fi else warn "postfix is not installed here" @@ -143,6 +145,12 @@ then fi fi +# 3) try the pgrep way (note: old pgreps do not support '-c') +if (( _RC > 0 )) +then + (( $(pgrep -u postfix pickup 2>>${HC_STDERR_LOG} | wc -l 2>/dev/null) == 0 )) && _STC=1 +fi + # evaluate results case ${_STC} in 0) From 719e58d33de395f78704330b36c163972a51fe19 Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Sat, 9 May 2020 22:43:35 +0200 Subject: [PATCH 8/8] Update README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index d0dd5d1..b60ea28 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,10 @@ Additionally, there may be bundles for display or notification plugins, e.g.: * hc-notify-eif * hc-notify-sms +## Configure & deploy + +An Ansible role is available at: https://github.com/patvdv/kudos.check_health + ## Execute (examples) * **Listing** available health checks: