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
b9f07ec5
Commit
b9f07ec5
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update for newer ceph versions
parent
0eb5c045
No related branches found
No related tags found
1 merge request
!64
update for newer ceph versions - check_cheph_osd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_ceph_osd
+12
-9
12 additions, 9 deletions
check_ceph_osd
with
12 additions
and
9 deletions
check_ceph_osd
+
12
−
9
View file @
b9f07ec5
...
...
@@ -2,7 +2,7 @@
# ======================================================================
#
# Icinga/ Nagios Check
# CEPH STATUS
/ HEALTH
# CEPH
OSD
STATUS
#
# ----------------------------------------------------------------------
#
...
...
@@ -10,12 +10,13 @@
# - ceph
#
# SYNTAX:
# - check_ceph_status
# - check_ceph_status
-w [count for warnming] -w [count for critical]
# No parameter required
#
# RESULT:
# OK = all OSDs up
# CRITITCAL = min. 1 OSD is down
# WARNING = 1 OSD is down
# CRITITCAL = min. 2 OSDs are down
# UNKNOWN = ceph osd tree is not executable
#
# ----------------------------------------------------------------------
...
...
@@ -23,11 +24,13 @@
# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> added params -w -c
# 2020-03-05 v1.2 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions
# 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
# ======================================================================
.
`
dirname
$0
`
/inc_pluginfunctions
.
$(
dirname
$0
)
/inc_pluginfunctions
tmpfile
=
/tmp/ceph_status_output_
$$
iColUpDown
=
5
# ----------------------------------------------------------------------
# FUNCTIONS
...
...
@@ -48,12 +51,12 @@ if [ $? -ne 0 ]; then
fi
# set default / override from command line params
typeset
-i
iWarnLimit
=
`
ph.getValueWithParam 1 w
"
$@
"
`
typeset
-i
iCriticalLimit
=
`
ph.getValueWithParam 2 c
"
$@
"
`
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 $
4
}'
|
grep
"down"
|
wc
-l
`
typeset
-i
iOsdUp
=
`
getOsd |
awk
'{ print $
4
}'
|
grep
"up"
|
wc
-l
`
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
)
if
[
$iOsdDown
-lt
$iWarnLimit
]
;
then
...
...
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