diff --git a/check_apache_requests b/check_apache_requests index 481704a00199995e6be90bbc7c356a87f6c62dd7..335ee6f390b356301419758e9abd848c1e466ae6 100755 --- a/check_apache_requests +++ b/check_apache_requests @@ -41,7 +41,7 @@ paramsWget="-T 5 -t 1 --no-check-certificate" # ---------------------------------------------------------------------- function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_ceph_diskfree b/check_ceph_diskfree index 5f5253afa77bbc433749b3fc9e13ce4e58d2acbf..9d0459c12316d3d8d8455b15cf86753da1deed21 100755 --- a/check_ceph_diskfree +++ b/check_ceph_diskfree @@ -31,7 +31,7 @@ typeset -i iCritical=0 self_APPVERSION=1.5 function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_ceph_io b/check_ceph_io index cf1701f2cf25cc7b4a3d94f8a879c513d90b2285..dce76176cb5d168534ab35bd9e2a7a811aa82b72 100755 --- a/check_ceph_io +++ b/check_ceph_io @@ -26,7 +26,7 @@ self_APPVERSION=1.4 function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_ceph_osd b/check_ceph_osd index d5c45220494f033291d0ddbd8e1f33621a820f42..f2f0a67d0a5b2ee1eb67f09b01074afbdfb53f08 100755 --- a/check_ceph_osd +++ b/check_ceph_osd @@ -41,7 +41,7 @@ iColUpDown=5 # ---------------------------------------------------------------------- function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_ceph_status b/check_ceph_status index 3e8b6bd026ee825847d049766cc22d841312ce81..2a2959fe949ff811b7b9bd3644b64db8da2ff6b7 100755 --- a/check_ceph_status +++ b/check_ceph_status @@ -43,7 +43,7 @@ line="__________________________________________________________________________ # ---------------------------------------------------------------------- function showHelp(){ - _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF ______________________________________________________________________ diff --git a/check_clientbackup b/check_clientbackup index a3aad97e94acd1bad08e8f7888d40ba0facbf773..be1f56d93c96f01b93e1be446217f131d2f9f4a1 100755 --- a/check_clientbackup +++ b/check_clientbackup @@ -31,7 +31,7 @@ sInstalldir=/opt/imlbackup/client/ # ---------------------------------------------------------------------- function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_cpu b/check_cpu index 3e160cec45e707ffdcce3e7a792e2b1428fc86b6..034bb719ee5bf30579d4b154d3adaf628856d72d 100755 --- a/check_cpu +++ b/check_cpu @@ -35,7 +35,7 @@ self_APPVERSION=1.14 # ---------------------------------------------------------------------- function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_cronstatus b/check_cronstatus index ffc4b1d834c7494265a1715b59a9afb1529290c6..0fd56b5a34e557f184c8ca62dcf092a99a3b4e8d 100755 --- a/check_cronstatus +++ b/check_cronstatus @@ -37,7 +37,7 @@ statusScript=/opt/cronwrapper/cronstatus.sh # ---------------------------------------------------------------------- function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_disk-io b/check_disk-io index 4dcdc2514ec3e15c9da4241a51d94b857336b842..8b8feceb4ec76dd6f70b77a70ba20016c8e8320f 100755 --- a/check_disk-io +++ b/check_disk-io @@ -45,7 +45,7 @@ function getDisks(){ # show help function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_dns_responsetime b/check_dns_responsetime index 88d07d9c4202b871e596f9aa729df6c85941877b..d468953c4c4cbb5075cadb3f6656fd66bf39449e 100755 --- a/check_dns_responsetime +++ b/check_dns_responsetime @@ -37,7 +37,7 @@ typeset -i iNotReachable=0 # show help function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_eol b/check_eol index 37e73281279dfb381c84b3570ce66c8df275ff6f..c471ed5dd003f1fd41c711ca03c5392ccd2135bd 100755 --- a/check_eol +++ b/check_eol @@ -43,18 +43,19 @@ # # ---------------------------------------------------------------------- # 2020-02-21 v1.0 <axel.hahn@iml.unibe.ch> -# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions -# 2021-03-26 v1.2 <axel.hahn@iml.unibe.ch> test major version if minor version was not detected -# 2021-11-02 v1.3 <axel.hahn@iml.unibe.ch> detect centos stream -# 2022-02-28 v1.4 <axel.hahn@iml.unibe.ch> remove negative performance data -# 2022-08-29 v1.5 <axel.hahn@iml.unibe.ch> fix help; shell syntax updates -# 2023-01-30 v1.6 <axel.hahn@unibe.ch> add max value in performance data +# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions +# 2021-03-26 v1.2 <axel.hahn@iml.unibe.ch> test major version if minor version was not detected +# 2021-11-02 v1.3 <axel.hahn@iml.unibe.ch> detect centos stream +# 2022-02-28 v1.4 <axel.hahn@iml.unibe.ch> remove negative performance data +# 2022-08-29 v1.5 <axel.hahn@iml.unibe.ch> fix help; shell syntax updates +# 2023-01-30 v1.6 <axel.hahn@unibe.ch> add max value in performance data +# 2023-07-27 v1.7 <axel.hahn@unibe.ch> update help page # ====================================================================== . "$( dirname $0 )/inc_pluginfunctions" eolcfg="${0}-data/*.cfg" -_version="1.5" +self_APPVERSION=1.7 # --- limits typeset -i iDaysWarn=365 @@ -110,8 +111,8 @@ function getDaysLeft(){ local mydate=$1 echo $mydate | grep "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" >/dev/null if [ $? -eq 0 ]; then - typeset -i local tsend=$(date --date="$mydate" +%s) - typeset -i local daysLeft=($tsend - $(date +%s))/60/60/24 + typeset -i tsend; tsend=$(date --date="$mydate" +%s) + typeset -i daysLeft; daysLeft=($tsend - $(date +%s))/60/60/24 echo $daysLeft fi } @@ -138,22 +139,10 @@ function findEolDate(){ } -# ---------------------------------------------------------------------- -# MAIN -# ---------------------------------------------------------------------- - -# --- no param? show help - -if [ $# -lt 2 ]; then - _self=$( basename $0 ) - cat <<EOH -______________________________________________________________________ - -CHECK EOL :: v${_version} - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ +function showHelp(){ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Check and of support of an OS or a product. The dates are defined in the files check_eol-*.cfg @@ -183,8 +172,27 @@ EXAMPLES $_self os detect $_self php detect -EOH +EOF +} + +# ---------------------------------------------------------------------- +# MAIN +# ---------------------------------------------------------------------- +# --- no param? show help + +# --- check param -h +case "$1" in + "--help"|"-h") + showHelp + exit 0 + ;; + *) +esac + +if [ $# -lt 2 ]; then + echo "ERROR: Not enough parameters." + showHelp ph.abort fi diff --git a/check_fs_errors b/check_fs_errors index 426c1866b336dc91e8a62fdf160d54caa74580a7..96385539d79426c6ca9378985a360a82c9c4793e 100755 --- a/check_fs_errors +++ b/check_fs_errors @@ -24,7 +24,7 @@ self_APPVERSION=1.2 # ---------------------------------------------------------------------- function showHelp(){ - local _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader ) diff --git a/check_fs_writable b/check_fs_writable index 9470f60c30bf1407a6e57dd86a0574c99afbdf92..a5578f60ed81200c8defc428974fd8af4f0a66d3 100755 --- a/check_fs_writable +++ b/check_fs_writable @@ -24,7 +24,7 @@ out="" # ---------------------------------------------------------------------- function showHelp(){ - _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF $( ph.showImlHelpHeader )