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
39576516
Commit
39576516
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
ceph osd: shorten ceph exec; show output on error
parent
8f50cd08
No related branches found
No related tags found
1 merge request
!127
Update icinga checks and docs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
check_ceph_osd
+9
-9
9 additions, 9 deletions
check_ceph_osd
docs/20_Checks/check_ceph_osd.md
+1
-1
1 addition, 1 deletion
docs/20_Checks/check_ceph_osd.md
with
10 additions
and
10 deletions
check_ceph_osd
+
9
−
9
View file @
39576516
...
...
@@ -26,12 +26,13 @@
# 2022-10-21 v1.3 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space
# 2023-04-24 v1.4 <axel.hahn@unibe.ch> update for newer ceph versions
# 2023-06-19 v1.5 <axel.hahn@unibe.ch> add help and param support; no more tmpfile
# 2023-07-27 v1.6 <axel.hahn@unibe.ch> shorten ceph exec; show output on error; shell fixes
# ======================================================================
.
$(
dirname
$0
)
/inc_pluginfunctions
self_APPNAME
=
$(
basename
$0
|
tr
[
:lower:]
[
:upper:]
)
self_APPVERSION
=
1.
5
self_APPVERSION
=
1.
6
# column number in output where to find the up/ down info
iColUpDown
=
5
...
...
@@ -94,19 +95,18 @@ case "$1" in
*
)
esac
data
=
$(
sudo
/bin/ceph osd tree 2>&1
)
if
[
$?
-ne
0
]
;
then
if
!
data
=
$(
sudo
/bin/ceph osd tree 2>&1
)
;
then
echo
"
$data
"
ph.abort
"UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands."
fi
# set default / override from command line params
typeset
-i
iWarnLimit
=
$(
ph.getValueWithParam 1 w
"
$@
"
)
typeset
-i
iCriticalLimit
=
$(
ph.getValueWithParam 2 c
"
$@
"
)
typeset
-i
iOsdTotal
=
$(
getOsd |
wc
-l
)
typeset
-i
iOsdDown
=
$(
getOsd |
awk
'{ print $iColUpDown }'
|
grep
"down"
|
wc
-l
)
typeset
-i
iOsdUp
=
$(
getOsd |
awk
'{ print $iColUpDown }'
|
grep
"up"
|
wc
-l
)
typeset
-i
iWarnLimit
;
iWarnLimit
=
$(
ph.getValueWithParam 1 w
"
$@
"
)
typeset
-i
iCriticalLimit
;
iCriticalLimit
=
$(
ph.getValueWithParam 2 c
"
$@
"
)
typeset
-i
iOsdTotal
;
iOsdTotal
=
$(
getOsd |
wc
-l
)
typeset
-i
iOsdDown
;
iOsdDown
=
$(
getOsd |
awk
'{ print $iColUpDown }'
|
grep
"down"
|
wc
-l
)
typeset
-i
iOsdUp
;
iOsdUp
=
$(
getOsd |
awk
'{ print $iColUpDown }'
|
grep
"up"
|
wc
-l
)
if
[
$iOsdDown
-lt
$iWarnLimit
]
;
then
ph.setStatus
"ok"
...
...
This diff is collapsed.
Click to expand it.
docs/20_Checks/check_ceph_osd.md
+
1
−
1
View file @
39576516
...
...
@@ -18,7 +18,7 @@ critical level.
______________________________________________________________________
CHECK_CEPH_OSD
v1.
5
v1.
6
(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