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

Merge branch '6361-fix-ceph-io' into 'master'

ceph_io: fix for small transfer rates in B/s

See merge request !79
parents 02dd8b36 a288b19f
No related branches found
No related tags found
1 merge request!79ceph_io: fix for small transfer rates in B/s
......@@ -15,12 +15,13 @@
#
# ----------------------------------------------------------------------
# 2023-05-09 v1.0 <axel.hahn@unibe.ch>
# 2023-05-10 v1.1 <axel.hahn@unibe.ch> fix for small transfer rates in B/s
# ======================================================================
. $(dirname $0)/inc_pluginfunctions
self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] )
self_APPVERSION=1.0
self_APPVERSION=1.1
function showHelp(){
cat <<EOF
......@@ -59,6 +60,8 @@ ph.require ceph
CEPHIO=$( sudo ceph status 2>/dev/null | grep "client:.* rd,.* wr," | cut -f 2 -d ":" )
# CEPHIO="8.9 KiB/s rd, 887 KiB/s wr, 138 op/s rd, 140 op/s wr"
# CEPHIO="255 B/s rd, 85 B/s wr, 0 op/s rd, 0 op/s"
if [ -z "${CEPHIO}" ]; then
ph.setStatus "unknown"
......@@ -67,8 +70,11 @@ if [ -z "${CEPHIO}" ]; then
echo "No ceph here or no sudo permissions on ceph command?"
else
IO_READ=$( echo ${CEPHIO} | cut -f 1,2 -d " " | sed -E "s#([0-9]*) (.).(.).*#\1\2\3#g")
IO_WRITE=$( echo ${CEPHIO} | cut -f 4,5 -d " " | sed -E "s#([0-9]*) (.).(.).*#\1\2\3#g")
# remark:
# - the sed transforms "NN KiB/s" --> "NN KB" (cut "i")
# - the tr is for small values "NN B/s" and removes "s"
IO_READ=$( echo ${CEPHIO} | cut -f 1,2 -d " " | sed -E "s#([0-9]*) (.).(.).*#\1\2\3#g" | tr -d 's' )
IO_WRITE=$( echo ${CEPHIO} | cut -f 4,5 -d " " | sed -E "s#([0-9]*) (.).(.).*#\1\2\3#g" | tr -d 's' )
ph.status "$CEPHIO"
# echo "read: $IO_READ"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment