Skip to content
Snippets Groups Projects
Commit 4c7b746b authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

ceph diskfree - add help

parent 2b54629d
Branches
No related tags found
1 merge request!77update docs
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment