Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
checkmk-formula
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
salt
checkmk-formula
Commits
4c6d8034
Commit
4c6d8034
authored
5 years ago
by
Dennis Ahrens
Browse files
Options
Downloads
Patches
Plain Diff
Proper documentation of gluster local check
parent
ea307e93
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
checkmk/custom-files/local/gluster
+21
-13
21 additions, 13 deletions
checkmk/custom-files/local/gluster
with
21 additions
and
13 deletions
checkmk/custom-files/local/gluster
+
21
−
13
View file @
4c6d8034
#!/bin/bash
#!/bin/bash
# we parse the output of gluster volume heal [vol] info summary
# we parse the output of gluster volume heal [vol] info split-brain
# which looks like that:
# which looks like that:
#
#
#
Brick t3
web
-00.it.hs-hannover.de:/srv/gluster/fileadmin
#Brick t3
backend
-00.it.hs-hannover.de:/srv/gluster/fileadmin
#Status: Connected
#Status: Connected
#Total Number of entries: 0
#Number of entries in heal pending: 0
#Number of entries in split-brain: 0
#Number of entries in split-brain: 0
#Number of entries possibly healing: 0
#
#
#
Brick t3
web
-01.it.hs-hannover.de:/srv/gluster/fileadmin
#Brick t3
backend
-01.it.hs-hannover.de:/srv/gluster/fileadmin
#Status: Connected
#Status: Connected
#Total Number of entries: 0
#Number of entries in heal pending: 0
#Number of entries in split-brain: 0
#Number of entries in split-brain: 0
#Number of entries possibly healing: 0
# [...]
hostname
=
$(
hostname
)
hostname
=
$(
hostname
)
entries_warn
=
500
entries_warn
=
500
...
@@ -20,18 +26,19 @@ entries_max=2000
...
@@ -20,18 +26,19 @@ entries_max=2000
# iterate over all available volumns
# iterate over all available volumns
for
volume
in
$(
gluster volume list
)
for
volume
in
$(
gluster volume list
)
do
do
# check /tmp/gluster_heal_summary for the last parsed output.
gluster volume heal
$volume
info summary
>
/tmp/gluster_heal_summary
gluster volume heal
$volume
info summary
>
/tmp/gluster_heal_summary
# check heal info summary
# check heal info summary
-> below you see sample lines
while
read
-r
brickline
;
do
while
read
-r
brickline
;
do
# 'Brick [hostname]:[path_on_the_host]'
read
-r
statusline
read
-r
statusline
# 'Status: Connected'
read
-r
entriesline
read
-r
entriesline
# 'Total Number of entries: [num]'
# we do not use the 3 lines below - may use them for more detailed metrics
# we do not use the 3 lines below - may use them for more detailed metrics
read
-r
entriespendingline
read
-r
entriespendingline
read
-r
entriessplitbrainline
read
-r
entriessplitbrainline
read
-r
entrieshealingline
read
-r
entrieshealingline
# bricks are separated by empty line
# bricks are separated by empty line
read
-r
emptyline
read
-r
emptyline
# skip
chunks
that are not
ours
# skip
those
that are not
located on our host (others are monitored on their corresponding host)
if
[[
"
$brickline
"
!=
*
"
$hostname
"
*
]]
if
[[
"
$brickline
"
!=
*
"
$hostname
"
*
]]
then
then
continue
continue
...
@@ -46,6 +53,7 @@ do
...
@@ -46,6 +53,7 @@ do
esac
esac
metrics
=
"healing_entries=
$entries
;
$entries_warn
;
$entries_crit
;
$entries_min
;
$entries_max
"
metrics
=
"healing_entries=
$entries
;
$entries_warn
;
$entries_crit
;
$entries_min
;
$entries_max
"
msg
=
"Online status of volume '
$volume
' brick '
$brick
' is: '
$heal_status
'"
msg
=
"Online status of volume '
$volume
' brick '
$brick
' is: '
$heal_status
'"
# echo chmk local check output
echo
"
$chmk_status
gluster_volume:
$volume
$metrics
$msg
"
echo
"
$chmk_status
gluster_volume:
$volume
$metrics
$msg
"
done
< /tmp/gluster_heal_summary
done
< /tmp/gluster_heal_summary
done
done
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