diff --git a/checkmk/custom-files/local/gluster b/checkmk/custom-files/local/gluster
index 0c5e97860168af6b3857a0481479ad8e572b3e70..8e96abc4285843e4e2d058caeafd6fcfccab7093 100644
--- a/checkmk/custom-files/local/gluster
+++ b/checkmk/custom-files/local/gluster
@@ -1,15 +1,21 @@
#!/bin/bash
-
-# we parse the output of gluster volume heal [vol] info split-brain
+# we parse the output of gluster volume heal [vol] info summary
# which looks like that:
#
-# Brick t3web-00.it.hs-hannover.de:/srv/gluster/fileadmin
-# Status: Connected
-# Number of entries in split-brain: 0
+#Brick t3backend-00.it.hs-hannover.de:/srv/gluster/fileadmin
+#Status: Connected
+#Total Number of entries: 0
+#Number of entries in heal pending: 0
+#Number of entries in split-brain: 0
+#Number of entries possibly healing: 0
#
-# Brick t3web-01.it.hs-hannover.de:/srv/gluster/fileadmin
-# Status: Connected
-# Number of entries in split-brain: 0
+#Brick t3backend-01.it.hs-hannover.de:/srv/gluster/fileadmin
+#Status: Connected
+#Total Number of entries: 0
+#Number of entries in heal pending: 0
+#Number of entries in split-brain: 0
+#Number of entries possibly healing: 0
+# [...]
hostname=$(hostname)
entries_warn=500
@@ -20,18 +26,19 @@ entries_max=2000
# iterate over all available volumns
for volume in $(gluster volume list)
do
+ # check /tmp/gluster_heal_summary for the last parsed output.
gluster volume heal $volume info summary > /tmp/gluster_heal_summary
- # check heal info summary
- while read -r brickline; do
- read -r statusline
- read -r entriesline
+ # check heal info summary -> below you see sample lines
+ while read -r brickline; do # 'Brick [hostname]:[path_on_the_host]'
+ read -r statusline # 'Status: Connected'
+ read -r entriesline # 'Total Number of entries: [num]'
# we do not use the 3 lines below - may use them for more detailed metrics
read -r entriespendingline
read -r entriessplitbrainline
read -r entrieshealingline
# bricks are separated by empty line
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"* ]]
then
continue
@@ -46,6 +53,7 @@ do
esac
metrics="healing_entries=$entries;$entries_warn;$entries_crit;$entries_min;$entries_max"
msg="Online status of volume '$volume' brick '$brick' is: '$heal_status'"
+ # echo chmk local check output
echo "$chmk_status gluster_volume:$volume $metrics $msg"
done < /tmp/gluster_heal_summary
done