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
02ddb317
Commit
02ddb317
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add check_ceph_io
parent
6e2ac234
Branches
Branches containing commit
No related tags found
1 merge request
!73
add check_ceph_io
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_ceph_io
+82
-0
82 additions, 0 deletions
check_ceph_io
with
82 additions
and
0 deletions
check_ceph_io
0 → 100755
+
82
−
0
View file @
02ddb317
#!/bin/bash
# ======================================================================
#
# Icinga/ Nagios Check
# CEPH IO (from "ceph status")
#
# ----------------------------------------------------------------------
#
# REQUIREMENTS:
# - ceph and sudo permissions on it
#
# SYNTAX:
# - check_ceph_io
# No parameter required
#
# ----------------------------------------------------------------------
# 2023-05-09 v1.0 <axel.hahn@unibe.ch>
# ======================================================================
.
$(
dirname
$0
)
/inc_pluginfunctions
self_APPNAME
=
$(
basename
$0
|
tr
[
:lower:]
[
:upper:]
)
self_APPVERSION
=
1.0
function
showHelp
(){
cat
<<
EOF
______________________________________________________________________
$self_APPNAME
v
$self_APPVERSION
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
______________________________________________________________________
Show cheph IO as read and written bytes per second.
This check sends performance data.
SYNTAX:
$(
basename
$0
)
OPTIONS:
-h or --help show this help.
EOF
}
# --- check param -h
case
"
$1
"
in
"--help"
|
"-h"
)
showHelp
exit
0
;;
*
)
esac
# --- check required tools
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"
if
[
-z
"
${
CEPHIO
}
"
]
;
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
IO_READ
=
$(
echo
${
CEPHIO
}
|
cut
-f
1,2
-d
" "
|
sed
-E
"s#([0-9]*) (.).*#
\1\2
#g"
)
IO_WRITE
=
$(
echo
${
CEPHIO
}
|
cut
-f
4,5
-d
" "
|
sed
-E
"s#([0-9]*) (.).*#
\1\2
#g"
)
ph.status
"
$CEPHIO
"
# echo "read: $IO_READ"
# echo "write: $IO_WRITE"
ph.perfadd
"cephio-read"
"
$IO_READ
"
""
""
ph.perfadd
"cephio-write"
"
$IO_WRITE
"
""
""
fi
ph.exit
\ No newline at end of file
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