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
98070025
Commit
98070025
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
checph_status harden sudo command execution + docs
parent
f62ac072
No related branches found
No related tags found
1 merge request
!192
6723 sudo
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
check_ceph_status
+4
-10
4 additions, 10 deletions
check_ceph_status
docs/20_Checks/check_ceph_status.md
+10
-2
10 additions, 2 deletions
docs/20_Checks/check_ceph_status.md
with
14 additions
and
12 deletions
check_ceph_status
+
4
−
10
View file @
98070025
...
@@ -21,11 +21,12 @@
...
@@ -21,11 +21,12 @@
# 2023-04-24 v1.4 <axel.hahn@unibe.ch> update for newer ceph versions
# 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-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> update help page
# 2023-07-27 v1.6 <axel.hahn@unibe.ch> update help page
# 2023-10-20 v1.7 <axel.hahn@unibe.ch> harden sudo command execution
# ======================================================================
# ======================================================================
.
$(
dirname
$0
)
/inc_pluginfunctions
.
$(
dirname
$0
)
/inc_pluginfunctions
export
self_APPVERSION
=
1.
6
export
self_APPVERSION
=
1.
7
initfile
=
"/tmp/ceph-status-not-ok-start-
$USER
"
initfile
=
"/tmp/ceph-status-not-ok-start-
$USER
"
...
@@ -45,14 +46,7 @@ line="__________________________________________________________________________
...
@@ -45,14 +46,7 @@ line="__________________________________________________________________________
function
showHelp
(){
function
showHelp
(){
local
_self
;
_self
=
$(
basename
$0
)
local
_self
;
_self
=
$(
basename
$0
)
cat
<<
EOF
cat
<<
EOF
______________________________________________________________________
$(
ph.showImlHelpHeader
)
$self_APPNAME
v
$self_APPVERSION
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
______________________________________________________________________
Show ceph health status.
Show ceph health status.
The state of the check switches to warning if HEALTH_WARN was detected
The state of the check switches to warning if HEALTH_WARN was detected
...
@@ -72,7 +66,7 @@ EOF
...
@@ -72,7 +66,7 @@ EOF
}
}
function
readCephStatus
(){
function
readCephStatus
(){
if
!
data
=
$(
sudo
/bin/ceph status 2>&1
)
;
then
if
!
data
=
$(
sudo
-n
/bin/ceph status 2>&1
)
;
then
echo
"
$data
"
echo
"
$data
"
ph.abort
"UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands."
ph.abort
"UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands."
fi
fi
...
...
This diff is collapsed.
Click to expand it.
docs/20_Checks/check_ceph_status.md
+
10
−
2
View file @
98070025
...
@@ -9,16 +9,22 @@ It switches the state in dependency of the HEALTH_* value.
...
@@ -9,16 +9,22 @@ It switches the state in dependency of the HEALTH_* value.
*
`ceph`
binary and sudo permission on it to get the information
*
`ceph`
binary and sudo permission on it to get the information
```
txt
icingaclient ALL=(ALL) NOPASSWD: /bin/ceph
```
## Syntax
## Syntax
```
txt
```
txt
______________________________________________________________________
______________________________________________________________________
CHECK_CEPH_STATUS
CHECK_CEPH_STATUS
v1.
5
v1.
7
(c) Institute for Medical Education - University of Bern
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
Licence: GNU GPL 3
https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_ceph_status.html
______________________________________________________________________
______________________________________________________________________
Show ceph health status.
Show ceph health status.
...
@@ -27,6 +33,8 @@ and is error of other HEALTH values than HEALTH_WARN or HEALTH_OK.
...
@@ -27,6 +33,8 @@ and is error of other HEALTH values than HEALTH_WARN or HEALTH_OK.
In the output is the complete output of the command "ceph status".
In the output is the complete output of the command "ceph status".
If degraded objects are found it shows the progress of repair process.
SYNTAX:
SYNTAX:
check_ceph_status
check_ceph_status
...
...
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