Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Checks GlusterFS health on the server. Tests include: - daemons running - number of bricks online - disk space - healing status
Current Version
1.0.0
Last Release Date
2013-12-03
Owner
Mark Ruys
License
BSD
Compatible With
Needs some sudo rights: Defaults:nagios !requiretty nagios ALL=(root) NOPASSWD:/usr/sbin/gluster volume status [[:graph:]]* detail,/usr/sbin/gluster volume heal [[:graph:]]* info
Inspired by a script of Mark Nipper.
Tested on GlusterFS 3.4.1 - feedback welcome
@call_krushna, You need to run this script from your Nagios libexec directory. For my example, it is /usr/local/nagios/libexec
You can find missing utils.sh there: http://n2rrd-wiki.diglinks.com/display/n2rrd/utils.sh #! /bin/sh STATE_OK=0 STATE_WARNING=1 STATE_CRITICAL=2 STATE_UNKNOWN=3 STATE_DEPENDENT=4 if test -x /usr/bin/printf; then ECHO=/usr/bin/printf else ECHO=echo fi print_revision() { echo "$1 v$2 (nagios-plugins 1.4.13)" $ECHO "The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistributencopies of the plugins under the terms of the GNU General Public License.nFor more information about these matters, see the file named COPYING.n" | sed -e 's/n/ /g' } support() { $ECHO "Send email to [email protected] if you have questionsnregarding use of this software. To submit patches or suggest improvements,nsend email to [email protected] include version information with all correspondence (when possible,nuse output from the --version option of the plugin itself).n" | sed -e 's/n/ /g' }
We had to change only one thing: Before: free=${freeunit:0:-2} Returns the following error: "line 101: -2: substring expression Molina:
This works very well for me. I've created a github repo for this at https://github.com/customink/nagios-nrpe-check_glusterfs I've checked in carrillm's mod to support TB sized gluster volumes, and an additional mod to output all errors on a critical alarm, not just free space. That way a lack of free space alert won't hide the fact that you're volume has bricks in a healing state, for instance. Feel free to submit pull requests via git. Thanks for the great work, Mark. Doug (halfinhalfout)
I tested with gluster 3.4.2 and it's working very well i just modificate the script to manage TB volume with freespace on TB : so on disk part of script replace this: Disk) key=${field[@]:0:3} if [ "${key}" = "Disk Space Free" ]; then freeunit=${field[@]:4} free=${freeunit:0:-2} unit=${freeunit#$free} if [ "$unit" != "GB" ]; then Exit UNKNOWN "unknown disk space size $freeunit" fi free=$(echo "${free} / 1" | bc -q) if [ $free -lt $freegb ]; then freegb=$free fi fi ;; by this : Disk) key=${field[@]:0:3} if [ "${key}" = "Disk Space Free" ]; then freeunit=${field[@]:4} free=${freeunit:0:-2} freeconvgb=`echo "($free*1024)" | bc` unit=${freeunit#$free} if [ "$unit" = "TB" ]; then free=$freeconvgb unit="GB" fi if [ "$unit" != "GB" ]; then Exit UNKNOWN "unknown disk space size $freeunit" fi free=$(echo "${free} / 1" | bc -q) if [ $free -lt $freegb ]; then freegb=$free fi fi ;; Thanks a lot
I am getting below error while running the script . ./check_glusterfs -v testvolume -n 2 ./check_glusterfs: line 27: ./utils.sh: No such file or directory ./check_glusterfs: line 54: CRITICAL: no bricks found: command not found Thanks and regards
You must be logged in to submit a review.
To:
From: