Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-checks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
icinga-checks
Commits
e12bd0bc
Commit
e12bd0bc
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
ceph_io: handle ceph status without io data
parent
515ff505
No related branches found
No related tags found
1 merge request
!81
ceph_io: handle ceph status without io data
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
check_ceph_io
+13
-6
13 additions, 6 deletions
check_ceph_io
docs/20_Checks/check_ceph_io.md
+1
-1
1 addition, 1 deletion
docs/20_Checks/check_ceph_io.md
with
14 additions
and
7 deletions
check_ceph_io
+
13
−
6
View file @
e12bd0bc
...
...
@@ -17,12 +17,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
# 2023-05-10 v1.2 <axel.hahn@unibe.ch> add tests
# 2023-05-11 v1.3 <axel.hahn@unibe.ch> handle ceph status without io data in output
# ======================================================================
.
$(
dirname
$0
)
/inc_pluginfunctions
self_APPNAME
=
$(
basename
$0
|
tr
[
:lower:]
[
:upper:]
)
self_APPVERSION
=
1.
2
self_APPVERSION
=
1.
3
function
showHelp
(){
_self
=
$(
basename
$0
)
...
...
@@ -75,6 +76,7 @@ if [ "$1" = "-t" ]; then
# TEST: client: 8.9 KiB/s rd, 887 KiB/s wr, 138 op/s rd, 140 op/s wr
# TEST: client: 255 B/s rd, 85 B/s wr, 0 op/s rd, 0 op/s
# TEST: client: 255 B/s rd, 0 op/s rd, 0 op/s wr
# TEST: no line with client
if
[
-z
"
$2
"
]
;
then
echo
;
echo
">>>>>>>>>> TESTS"
;
echo
grep
'# TEST: '
$0
|
grep
-v
grep
|
cut
-f
2-
-d
':'
|
while
read
-r
teststring
...
...
@@ -90,16 +92,20 @@ if [ "$1" = "-t" ]; then
else
# --- check required tools
ph.require ceph
CEPHIO
=
$(
sudo
ceph status 2>/dev/null |
grep
"client:"
)
fi
if
[
-z
"
${
CEPHIO
}
"
]
;
then
# --- get output of ceph
if
!
CEPHOUT
=
$(
sudo
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?"
else
echo
"
$CEPHOUT
"
fi
CEPHIO
=
$(
echo
"
$CEPHOUT
"
|
grep
"client:"
)
fi
if
[
-n
"
${
CEPHOUT
}${
CEPHIO
}
"
]
;
then
CEPHDATA
=
$(
echo
"
${
CEPHIO
}
"
|
cut
-f
2
-d
':'
)
SEG_R
=
$(
echo
"
${
CEPHDATA
}
"
|
cut
-f
1
-d
","
|
grep
"rd"
|
awk
'{ print $1 " " $2 }'
)
...
...
@@ -111,6 +117,7 @@ else
IO_READ
=
$(
echo
"
${
SEG_R
}
"
|
sed
-E
"s#([0-9]*) (.).(.).*#
\1\2\3
#g"
|
tr
-d
's'
)
IO_WRITE
=
$(
echo
"
${
SEG_W
}
"
|
sed
-E
"s#([0-9]*) (.).(.).*#
\1\2\3
#g"
|
tr
-d
's'
)
test
-z
"
$CEPHIO
"
&&
CEPHIO
=
"'ceph status' successful - but there are no io data in output."
test
-z
"
$IO_READ
"
&&
IO_READ
=
"0"
test
-z
"
$IO_WRITE
"
&&
IO_WRITE
=
"0"
ph.status
"
$(
echo
"
${
CEPHIO
}
"
|
cut
-f
2
-d
":"
)
"
...
...
This diff is collapsed.
Click to expand it.
docs/20_Checks/check_ceph_io.md
+
1
−
1
View file @
e12bd0bc
...
...
@@ -15,7 +15,7 @@ It returns a single line for the status and performance data.
______________________________________________________________________
CHECK_CEPH_IO
v1.
2
v1.
3
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment