Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

GlusterFS checks

Rating
11 votes
Favoured:
2
Current Version
1.0.0
Last Release Date
2013-12-03
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion
  • Nagios Reactor
Owner
License
BSD
Hits
51688
Files:
FileDescription
check_glusterfscheck_glusterfs
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Checks GlusterFS health on the server. Tests include:
- daemons running
- number of bricks online
- disk space
- healing status
Checks GlusterFS health on the server. Tests include:
- daemons running
- number of bricks online
- disk space
- healing status

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
Reviews (6)
@call_krushna,

You need to run this script from your Nagios libexec directory.
For my example, it is /usr/local/nagios/libexec
bywitkacy26, March 31, 2016
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 redistribute\ncopies 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 nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n" | sed -e 's/\n/ /g'
}
bymaticue, June 24, 2015
1 of 1 people found this review helpful
We had to change only one thing:

Before:
free=${freeunit:0:-2}

Returns the following error:
"line 101: -2: substring expression Molina:
byhalfinhalfout, July 15, 2014
1 of 1 people found this review helpful
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)
bycarrillm, June 3, 2014
2 of 2 people found this review helpful
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
bycall_krushna, June 2, 2014
0 of 1 people found this review helpful
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