File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 99# * Modified by Doug Wilson <[email protected] >1010# * includes carrillm’s fix to support TB sized volumes
1111# * outputs all errors on a critical alarm, not just free space
12+ #
13+ # * 20/08/2014
14+ # * Modified by emitor
15+ # * fix the regular expresion where get the free space (it didn't work for me on centOS)
16+ # * fix OK status to print the free space as it is
1217
1318# This Nagios script was written against version 3.3 & 3.4 of Gluster. Older
1419# versions will most likely not work at all with this monitoring script.
@@ -114,7 +119,7 @@ while read -r line; do
114119 key=${field[@]: 0: 3}
115120 if [ " ${key} " = " Disk Space Free" ]; then
116121 freeunit=${field[@]: 4}
117- free=${freeunit: 0:- 2}
122+ free=${freeunit: 0: ${ # freeunit} -2}
118123 freeconvgb=` echo " ($free *1024)" | bc`
119124 unit=${freeunit# $free }
120125 if [ " $unit " = " TB" ]; then
@@ -173,4 +178,4 @@ if [ -n "$errors" ]; then
173178fi
174179
175180# exit with no errors
176- Exit OK " ${bricksfound} bricks; free space ${freegb} GB "
181+ Exit OK " ${bricksfound} bricks; free space ${freeunit} "
You can’t perform that action at this time.
0 commit comments