diff --git a/check_ceph_diskfree b/check_ceph_diskfree index d285efe5f5cb88a199fcf885fdda91f98afc4c4b..3167e17742ec969fe5b1ccf452b6740241686a08 100755 --- a/check_ceph_diskfree +++ b/check_ceph_diskfree @@ -18,6 +18,7 @@ # 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 # ====================================================================== . $(dirname $0)/inc_pluginfunctions @@ -28,10 +29,48 @@ outfile=/tmp/check_ceph_df_out__$$ typeset -i iWarning=0 typeset -i iCritical=0 + +self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) +self_APPVERSION=1.3 + +function showHelp(){ +cat <<EOF +______________________________________________________________________ + +$self_APPNAME +v$self_APPVERSION + +(c) Institute for Medical Education - University of Bern +Licence: GNU GPL 3 +______________________________________________________________________ + +Show available and free space on a ceph cluster. +This check sends performance data. + +It uses 'ceph df' to parse data. + +SYNTAX: +$(basename $0) + +OPTIONS: + -h or --help show this help. + +EOF +} + # ---------------------------------------------------------------------- # MAIN # ---------------------------------------------------------------------- +# --- check param -h +case "$1" in + "--help"|"-h") + showHelp + exit 0 + ;; + *) +esac + # set default / override from command line params typeset -i iWarnLimit=$( ph.getValueWithParam 70 w "$@") typeset -i iCriticalLimit=$( ph.getValueWithParam 90 c "$@") @@ -40,7 +79,7 @@ typeset -i iCriticalLimit=$( ph.getValueWithParam 90 c "$@") if ! sudo /bin/ceph df > $tmpfile 2>&1 then rm -f $tmpfile -ph.abort "UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands." + ph.abort "UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands." fi rm -f $outfile 2>/dev/null