diff --git a/.gitignore b/.gitignore index ec00e31fbe6c87cbaa30be4619a98c493798761a..0b47eeb0543f75e9d533f9a17756eb075caafda9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ check_smart.pl paramtest check_snmp_syno.sh check-cpu.sh -static/* \ No newline at end of file +static/* +check_conn.cfg +check_snmp_hello +check_snmp_switch diff --git a/check_apache_requests b/check_apache_requests index 7945cead09f5dde8980f06ebc6c0e9f91f1b0e03..af9f8d17419422fb67e8867db576eeb059693371 100755 --- a/check_apache_requests +++ b/check_apache_requests @@ -12,11 +12,11 @@ # 2022-08-31 v1.3 <axel.hahn@iml.unibe.ch> add help; shellfix corrections # 2022-08-31 v1.4 <axel.hahn@iml.unibe.ch> add help; shellfix corrections # 2023-06-19 v1.5 <axel.hahn@unibe.ch> no more tmpfile +# 2023-07-27 v1.6 <axel.hahn@unibe.ch> update help page # ====================================================================== . $(dirname $0)/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.5 +export self_APPVERSION=1.6 # url=`hostname -f`/server-status url=localhost/server-status @@ -41,15 +41,9 @@ paramsWget="-T 5 -t 1 --no-check-certificate" # ---------------------------------------------------------------------- function showHelp(){ -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Get Apache httpd server-status page $url. You get output with the server status and values for each slot type. @@ -80,7 +74,7 @@ Slot types of apache httpd: SYNTAX: -$(basename $0) [-w WARN_LIMIT] [-c CRITICAL_LIMIT] +$_self [-w WARN_LIMIT] [-c CRITICAL_LIMIT] OPTIONS: @@ -95,7 +89,7 @@ PARAMETERS: EXAMPLE: -$(basename $0) -w 60 -c 80 +$_self -w 60 -c 80 EOF } diff --git a/check_ceph_diskfree b/check_ceph_diskfree index 749bf1f70c91d2e723bddac7a4e3c4255166b8c4..ce3f84787a245a701a40cda0c4e65b7d2e296a81 100755 --- a/check_ceph_diskfree +++ b/check_ceph_diskfree @@ -16,31 +16,25 @@ # # ---------------------------------------------------------------------- # 2020-03-04 v1.0 <axel.hahn@iml.unibe.ch> -# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions -# 2023-04-24 v1.2 <axel.hahn@unibe.ch> update for newer ceph versions -# 2023-05-09 v1.3 <axel.hahn@unibe.ch> add help -# 2023-06-19 v1.4 <axel.hahn@unibe.ch> no more tmpfile +# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions +# 2023-04-24 v1.2 <axel.hahn@unibe.ch> update for newer ceph versions +# 2023-05-09 v1.3 <axel.hahn@unibe.ch> add help +# 2023-06-19 v1.4 <axel.hahn@unibe.ch> no more tmpfile +# 2023-07-27 v1.5 <axel.hahn@unibe.ch> update help page # ====================================================================== . $(dirname $0)/inc_pluginfunctions +export self_APPVERSION=1.5 + typeset -i iWarning=0 typeset -i iCritical=0 -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.4 - function showHelp(){ -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Show available and free space on a ceph cluster. This check sends performance data. diff --git a/check_ceph_io b/check_ceph_io index e5b65a88ea9da87904851ad027d8d97307eb6d50..36d5a074a1350816054576e92b763ccb93598a7a 100755 --- a/check_ceph_io +++ b/check_ceph_io @@ -18,24 +18,17 @@ # 2023-05-10 v1.1 <axel.hahn@unibe.ch> fix for small transfer rates in B/s # 2023-05-10 v1.2 <axel.hahn@unibe.ch> add tests # 2023-05-11 v1.3 <axel.hahn@unibe.ch> handle ceph status without io data in output +# 2023-07-27 v1.4 <axel.hahn@unibe.ch> update help page # ====================================================================== . $(dirname $0)/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.3 +export self_APPVERSION=1.4 function showHelp(){ - _self=$(basename $0) -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Show cheph IO as read and written bytes per second. This check sends performance data. diff --git a/check_ceph_osd b/check_ceph_osd index bbe1dd512c1f657bca971cd174f472e0a1878fab..e1224a016d1678b5d7aa4a22066b6a00bdaf76ff 100755 --- a/check_ceph_osd +++ b/check_ceph_osd @@ -31,8 +31,7 @@ . $(dirname $0)/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.6 +export self_APPVERSION=1.6 # column number in output where to find the up/ down info iColUpDown=5 @@ -42,16 +41,9 @@ iColUpDown=5 # ---------------------------------------------------------------------- function showHelp(){ - _self=$(basename $0) -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Show cheph osd status: how many OSDs exist and how many are up/ down. This check sends performance data. diff --git a/check_ceph_status b/check_ceph_status index aa18e5984925c9655b18048d483ea43919e63605..61fc8a53faf7f39e2baf248d79a1d05d15d9b6d0 100755 --- a/check_ceph_status +++ b/check_ceph_status @@ -20,14 +20,14 @@ # 2021-04-12 v1.3 <axel.hahn@iml.unibe.ch> if degraded items are 0 delete init file too # 2023-04-24 v1.4 <axel.hahn@unibe.ch> update for newer ceph versions # 2023-06-19 v1.5 <axel.hahn@unibe.ch> add help and param support; no more tmpfile +# 2023-07-27 v1.6 <axel.hahn@unibe.ch> update help page # ====================================================================== . $(dirname $0)/inc_pluginfunctions -initfile="/tmp/ceph-status-not-ok-start-$USER" +export self_APPVERSION=1.6 -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.5 +initfile="/tmp/ceph-status-not-ok-start-$USER" iSleep=3 doLoop=1 @@ -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 f0a66a44afd6451a8a33bee7cabe2b951b726da1..26da48c6c0c5d48b38b3a0d12b2adb00962a710e 100755 --- a/check_clientbackup +++ b/check_clientbackup @@ -17,13 +17,12 @@ # 2022-10-21 v1.10 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space # show last backup, prune, verify # 2023-06-22 v1.11 <axel.hahn@unibe.ch> add help and param support; add parameter for install directory -# 2023-06-22 v1.12 <axel.hahn@unibe.ch> add docs url of IML backup +# 2023-07-27 v1.12 <axel.hahn@unibe.ch> add docs url of IML backup # ====================================================================== . $( dirname $0 )/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.11 +export self_APPVERSION=1.12 sInstalldir=/opt/imlbackup/client/ @@ -32,16 +31,9 @@ sInstalldir=/opt/imlbackup/client/ # ---------------------------------------------------------------------- function showHelp(){ - _self=$(basename $0) -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Show status of IML backup. See https://os-docs.iml.unibe.ch/iml-backup/ diff --git a/check_conn b/check_conn index 1d06e5af7486efc9aeffc0114b5f209aad23cb66..78487982df2cfb20ad1556be516ed182b429e967 100755 --- a/check_conn +++ b/check_conn @@ -8,10 +8,13 @@ # # ---------------------------------------------------------------------- # 2021-11-05 v0.0 <axel.hahn@iml.unibe.ch> +# 2023-07-27 v1.1 <axel.hahn@unibe.ch> update help page # ====================================================================== -. `dirname $0`/inc_pluginfunctions +. $(dirname $0)/inc_pluginfunctions + +export self_APPVERSION=1.1 cfgfile=$( dirname $0 )/$( basename $0 ).cfg @@ -31,19 +34,12 @@ function getChecks(){ function showHelp(){ -cat <<EOF -______________________________________________________________________ - -CHECK_CONN check if is a host available on a given port via tcp or udp -from local machine $( hostname -f ). - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ - + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) SYNTAX: -`basename $0` OPTIONS +$_self OPTIONS You can create a file named $cfgfile and add your connections there. @@ -64,12 +60,12 @@ PARAMETERS: udp/host/port EXAMPLES: -`basename $0` If no param is given it checks entries in $cfgfile +$_self If no param is given it checks entries in $cfgfile -`basename $0` -t "tcp/api.example.com/443" +$_self -t "tcp/api.example.com/443" Check a single connection -`basename $0` -t "tcp/api.example.com/443 tcp/localhost/3306" +$_self -t "tcp/api.example.com/443 tcp/localhost/3306" Check multiple connections. EOF diff --git a/check_cpu b/check_cpu index 0f5bc3e4f38cb3fbaa21b5ee3d648717f40bac45..1c03b9aed94a85599dafdc201f9e4d1a3ea4effc 100755 --- a/check_cpu +++ b/check_cpu @@ -9,41 +9,35 @@ # # ---------------------------------------------------------------------- # 2020-03-10 v1.0 <axel.hahn@iml.unibe.ch> -# 2020-03-23 v1.1 <axel.hahn@iml.unibe.ch> added more data -# 2020-07-08 v1.2 <axel.hahn@iml.unibe.ch> FIX: set "ph." instead "ps." -# 2020-07-17 v1.3 <axel.hahn@iml.unibe.ch> use ph.require to check binaries -# 2021-02-10 v1.4 <axel.hahn@iml.unibe.ch> added critical io wait -# 2021-10-28 v1.5 <axel.hahn@iml.unibe.ch> Use 2nd update of top -# 2021-12-10 v1.6 <axel.hahn@iml.unibe.ch> show processes with status D to find cpu waits -# 2022-03-09 v1.7 <axel.hahn@iml.unibe.ch> show most cpu intensive processes -# 2022-03-10 v1.8 <axel.hahn@iml.unibe.ch> add cli param -p; update help -# 2022-03-22 v1.9 <axel.hahn@iml.unibe.ch> fix syntax error on 100% idle -# 2022-04-14 v1.10 <axel.hahn@iml.unibe.ch> show consuming cpu processes with top and ps -# 2022-08-29 v1.11 <axel.hahn@iml.unibe.ch> replace pipe to prevent start of metrics section -# 2022-08-29 v1.12 <axel.hahn@iml.unibe.ch> fix: replace pipe -# 2023-02-13 v1.13 <axel.hahn@iml.unibe.ch> small shell fixes +# 2020-03-23 v1.1 <axel.hahn@iml.unibe.ch> added more data +# 2020-07-08 v1.2 <axel.hahn@iml.unibe.ch> FIX: set "ph." instead "ps." +# 2020-07-17 v1.3 <axel.hahn@iml.unibe.ch> use ph.require to check binaries +# 2021-02-10 v1.4 <axel.hahn@iml.unibe.ch> added critical io wait +# 2021-10-28 v1.5 <axel.hahn@iml.unibe.ch> Use 2nd update of top +# 2021-12-10 v1.6 <axel.hahn@iml.unibe.ch> show processes with status D to find cpu waits +# 2022-03-09 v1.7 <axel.hahn@iml.unibe.ch> show most cpu intensive processes +# 2022-03-10 v1.8 <axel.hahn@iml.unibe.ch> add cli param -p; update help +# 2022-03-22 v1.9 <axel.hahn@iml.unibe.ch> fix syntax error on 100% idle +# 2022-04-14 v1.10 <axel.hahn@iml.unibe.ch> show consuming cpu processes with top and ps +# 2022-08-29 v1.11 <axel.hahn@iml.unibe.ch> replace pipe to prevent start of metrics section +# 2022-08-29 v1.12 <axel.hahn@iml.unibe.ch> fix: replace pipe +# 2023-02-13 v1.13 <axel.hahn@iml.unibe.ch> small shell fixes +# 2023-07-27 v1.14 <axel.hahn@unibe.ch> update help page # ====================================================================== . $(dirname $0)/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.13 +export self_APPVERSION=1.14 # ---------------------------------------------------------------------- # functions # ---------------------------------------------------------------------- function showHelp(){ -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) check cpu usage and cpu wait Cpu infos are taken from output of top command. diff --git a/check_cronstatus b/check_cronstatus index e6752649828742276ba6fcc0342bde86e0af9fa3..1d1a7516e6189a27232aba3ba14fc1a058c0df7a 100755 --- a/check_cronstatus +++ b/check_cronstatus @@ -17,19 +17,20 @@ # ds=daniel.schueler@iml.unibe.ch # # 2017-10-13 v1.0 ah,ds -# 2017-10-17 v1.1 ah,ds remove PIPESTATUS for Debian8 compatibility -# 2019-04-30 v1.2 ah,ds show scriptlabel of failed jobs in 1st line -# 2020-02-28 v1.3 ah,ds ouput with separated error jobs and OK jobs -# 2020-03-05 v1.4 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions -# 2022-02-28 v1.5 <axel.hahn@iml.unibe.ch> fix output of error counter -# 2022-08-23 v2.0 <axel.hahn@iml.unibe.ch> simplify it: use cronstatus.sh (it has exitcode >0 on errors now) +# 2017-10-17 v1.1 ah,ds remove PIPESTATUS for Debian8 compatibility +# 2019-04-30 v1.2 ah,ds show scriptlabel of failed jobs in 1st line +# 2020-02-28 v1.3 ah,ds ouput with separated error jobs and OK jobs +# 2020-03-05 v1.4 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions +# 2022-02-28 v1.5 <axel.hahn@iml.unibe.ch> fix output of error counter +# 2022-08-23 v2.0 <axel.hahn@iml.unibe.ch> simplify it: use cronstatus.sh (it has exitcode >0 on errors now) +# 2023-07-27 v2.1 <axel.hahn@unibe.ch> update help page # ====================================================================== . $( dirname $0 )/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=2.0 +export self_APPVERSION=2.1 + statusScript=/opt/cronwrapper/cronstatus.sh # ---------------------------------------------------------------------- @@ -37,15 +38,9 @@ statusScript=/opt/cronwrapper/cronstatus.sh # ---------------------------------------------------------------------- function showHelp(){ -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Show status of all Cronjobs using Axels Cronwrapper https://github.com/axelhahn/cronwrapper diff --git a/check_disk-io b/check_disk-io index 31e1112c0931a95eac4465c6c7b48dd7a71804bc..82d57d797883e03cfb96c37498022b21fc481380 100755 --- a/check_disk-io +++ b/check_disk-io @@ -13,14 +13,13 @@ # # ---------------------------------------------------------------------- # 2020-07-17 v1.0 <axel.hahn@iml.unibe.ch> -# 2023-07-27 v1.1 <axel.hahn@iml.unibe.ch> shell fixes; remove unsupported warn and critical +# 2023-07-27 v1.1 <axel.hahn@unibe.ch> shell fixes; remove unsupported warn and critical # ====================================================================== . $( dirname $0 )/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.1 +export self_APPVERSION=1.1 # ---------------------------------------------------------------------- # FUNCTIONS @@ -46,18 +45,9 @@ function getDisks(){ # show help function showHelp(){ - _self=$(basename $0) -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -Check dis io and latency - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Disk infos based on /sys/block/[NAME]/stat See https://www.kernel.org/doc/Documentation/block/stat.txt diff --git a/check_dns_responsetime b/check_dns_responsetime index 6e865104787bbeade33943ccb00aa1139f8fecfa..0b73b9d94ceed525aafaf4dba8b03d2133126e4a 100755 --- a/check_dns_responsetime +++ b/check_dns_responsetime @@ -11,14 +11,13 @@ # test tcp 53 first # check result depends on 1st nameserver only # 2022-10-24 v1.2 <axel.hahn@unibe.ch> shell fixes; remove pipe char in output -# 2023-07-27 v1.3 <axel.hahn@iml.unibe.ch> shell fixes; add help page +# 2023-07-27 v1.3 <axel.hahn@unibe.ch> shell fixes; add help page # ====================================================================== . $( dirname $0 )/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.3 +exort self_APPVERSION=1.3 tmpfile=/tmp/check_netstat_out_$$ infofile=/tmp/check_netstat_out_2_$$ @@ -38,16 +37,9 @@ typeset -i iNotReachable=0 # show help function showHelp(){ - _self=$(basename $0) -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Loop over all defined dns servers (in /etc/resolv.conf) and check each: diff --git a/check_eol b/check_eol index 37e73281279dfb381c84b3570ce66c8df275ff6f..391a5335dab8fa24adef5be166b6a2aa67741968 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" +export 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 6369f4b0140bf2f12348095dd144fcff84c00b8e..5f321335bb96670eea1206ee2283cc557fbac071 100755 --- a/check_fs_errors +++ b/check_fs_errors @@ -10,14 +10,13 @@ # ---------------------------------------------------------------------- # 2021-03-23 v1.0 <axel.hahn@iml.unibe.ch> # 2021-03-30 v1.1 <axel.hahn@iml.unibe.ch> max age of detected errors: since yesterday (commented) -# 2023-07-27 v1.2 <axel.hahn@iml.unibe.ch> shell fixes; update help page +# 2023-07-27 v1.2 <axel.hahn@unibe.ch> shell fixes; update help page # ====================================================================== . $( dirname $0 )/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.2 +export self_APPVERSION=1.2 # ---------------------------------------------------------------------- @@ -25,16 +24,9 @@ self_APPVERSION=1.2 # ---------------------------------------------------------------------- function showHelp(){ - _self=$(basename $0) -cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ + local _self; _self=$(basename $0) + cat <<EOF +$( ph.showImlHelpHeader ) Check if kernel logs inconsistency messages in the journallog. It requires sudo permission on /bin/journalctl diff --git a/check_fs_writable b/check_fs_writable index 20c544313184e65bd3573d569dfc255c14a188f0..e6c354324a46f22ca1baf815df520722e7873999 100755 --- a/check_fs_writable +++ b/check_fs_writable @@ -8,14 +8,13 @@ # # ---------------------------------------------------------------------- # 2021-03-23 v0.0 <axel.hahn@iml.unibe.ch> -# 2023-07-27 v1.2 <axel.hahn@iml.unibe.ch> shell fixes; update help page +# 2023-07-27 v1.1 <axel.hahn@unibe.ch> shell fixes; update help page # ====================================================================== . $( dirname $0 )/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.2 +export self_APPVERSION=1.1 dirs2test="/tmp /var/tmp" out="" @@ -25,16 +24,9 @@ out="" # ---------------------------------------------------------------------- function showHelp(){ - _self=$(basename $0) + local _self; _self=$(basename $0) cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ +$( ph.showImlHelpHeader ) Check if a filesystem is readonly in given directories. In each of the given directories a random file will be touched. diff --git a/check_snmp_data.md b/check_snmp_data.md deleted file mode 100644 index 8b3fbf1193c2c780625c2372636ee6cacf38cc55..0000000000000000000000000000000000000000 --- a/check_snmp_data.md +++ /dev/null @@ -1,2 +0,0 @@ -# check_snmp_data - diff --git a/inc_pluginfunctions b/inc_pluginfunctions index dad46e80ad1951b54d87179bad3d32e482bcadbe..46f86fbfe096506923c79061d54956cad29bc28a 100644 --- a/inc_pluginfunctions +++ b/inc_pluginfunctions @@ -521,6 +521,24 @@ function ph.execIfReady(){ # ---------------------------------------------------------------------- +# show a header in the help for IML checks +ph.showImlHelpHeader(){ + cat <<EOF +______________________________________________________________________ + +$( basename $0 | tr [:lower:] [:upper:] ) +v$self_APPVERSION + +(c) Institute for Medical Education - University of Bern +Licence: GNU GPL 3 + +https://os-docs.iml.unibe.ch/icinga-checks/Checks/$( basename $0 ).html +______________________________________________________________________ +EOF +} + +# ---------------------------------------------------------------------- + # init ph.setStatus "ok"