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

ceph_diskfree harden sudo command execution

parent 486a0e1d
No related branches found
No related tags found
1 merge request!1926723 sudo
......@@ -21,11 +21,12 @@
# 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
# 2023-10-20 v1.6 <axel.hahn@unibe.ch> harden sudo command execution
# ======================================================================
. $(dirname $0)/inc_pluginfunctions
export self_APPVERSION=1.5
export self_APPVERSION=1.6
typeset -i iWarning=0
typeset -i iCritical=0
......@@ -68,7 +69,7 @@ typeset -i iWarnLimit=$( ph.getValueWithParam 70 w "$@")
typeset -i iCriticalLimit=$( ph.getValueWithParam 90 c "$@")
if ! data=$( sudo /bin/ceph df 2>&1 )
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."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment