diff --git a/check_ceph_diskfree b/check_ceph_diskfree index 28ab2ef099f81e1efe410e7ac30ab51f9eb4f954..ef608cae2e79070e600c974654e1b29d5b14599a 100755 --- a/check_ceph_diskfree +++ b/check_ceph_diskfree @@ -64,15 +64,16 @@ case "$1" in *) esac +# --- check required tools +ph.require ceph + # set default / override from command line params typeset -i iWarnLimit=$( ph.getValueWithParam 70 w "$@") typeset -i iCriticalLimit=$( ph.getValueWithParam 90 c "$@") - if ! data=$( sudo -n /bin/ceph df 2>&1 ) then - echo "$data" - ph.abort "UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands." + ph.abort "UNKNOWN: No sudo permissions to execute ceph commands." fi isHeader=0 diff --git a/check_ceph_io b/check_ceph_io index bb1e89bd0e458018d897d799ad430556da802456..a5034a568e6c1d413baec366453e1233402e143a 100755 --- a/check_ceph_io +++ b/check_ceph_io @@ -89,11 +89,7 @@ else # --- get output of ceph if ! CEPHOUT=$( sudo -n ceph status 2>&1 ); then - ph.setStatus "unknown" - ph.status "no data" - echo "There is no output from 'sudo ceph status'." - echo "No ceph here or no sudo permissions on ceph command?" - echo "$CEPHOUT" + ph.abort "UNKNOWN: No sudo permissions to execute ceph commands." fi CEPHIO=$( echo "$CEPHOUT" | grep "client:") fi diff --git a/check_proc_mem b/check_proc_mem index 91b2bbe26a082ab9e07d87cabb145204523c57ea..07428092fa9df567c093e3a0995e8c8b72968a84 100755 --- a/check_proc_mem +++ b/check_proc_mem @@ -11,10 +11,15 @@ # # ---------------------------------------------------------------------- # 2020-03-02 v1.0 initial version -# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions -# 2023-02-13 v1.2 <axel.hahn@unibe.ch> some shell fixes +# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions +# 2023-02-13 v1.2 <axel.hahn@unibe.ch> some shell fixes +# 2023-08-24 v1.3 <axel.hahn@unibe.ch> add help; do not use tmp file anymore # ====================================================================== +. $( dirname $0 )/inc_pluginfunctions + +export self_APPVERSION=1.1 + # --- tmp files for internal usage tmpfile=/tmp/processlist1_$$ tmpfile2=/tmp/processlist2_$$ @@ -31,7 +36,10 @@ typeset -i iCountCritical=0 rm -f $tmpfile $tmpfile2 $outCritical $outWarning 2>/dev/null -. $(dirname $0)/inc_pluginfunctions +# ---------------------------------------------------------------------- +# functions +# ---------------------------------------------------------------------- + # ---------------------------------------------------------------------- # MAIN