Check_glusterfs

Hi,
I’ve downloaded and installed check_glusterfs trying to monitor my gluster filesystem. but icingaweb2 says UNKNOWN - no volumes found

here’s my command.conf:
object CheckCommand “check_glusterfs” {
import “plugin-check-command”
command = [PluginDir + “/check_glusterfs” ]
arguments = {
“-l” = “$volume$”
“-p” = “$performance$”
“-w” = “$warning$”
“-c” = “$critical$”
}
}

and services.conf:
apply Service “glusterfs” {
import “generic-service”
check_command = “check_glusterfs”
vars.volume = “glust-distr-rep”
vars.performance =“1”
vars.warning = “20”
vars.critical = “25”
assign where host.name == NodeName
}
check_glusterfs: SYNOPSIS
check_glusterfs [-H HOST] [-p] [-f] [-l VOLUME]
[-w DISKWARN] [-c DISKCRIT]
[-W INODEWARN] [-C INODECRIT]
nagios entry in visudo:
nagios ALL=(root) NOPASSWD: /usr/lib/nagios/plugins/check_glusterfs

the plugin would run with no argument when run from /usr/lib/nagios/plugins/
so I’m not really sure what I got wrong!
any help, or comment would be highly appreciated…
Thanks,

When the PlugIn is run without arguments, does the output look correct?
Since it does run without arguments, have you tired stripping the arguments from your CheckCommand?

Have you tired running the check, after disabling selinux?

Any information in the logs? Have you tried enabling debuglog?

1 Like

I removed my “command” and instead created a command in command description in /etc/nagios-plugins/config/ and now the “unknown volume” message is gone.
glusterfs.cfg:
define command{
command_name check_glusterfs
command_line /usr/lib/nagios/plugins/check_glusterfs -l ‘$ARG1$’ -w ‘$ARG2$’ -c ‘$ARG3$’
}
however now icingaweb2 says:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified
that clearly is a sudo misconfiguration, I added updated sudoers with the following lines but still the same error pops up in icingaweb2. any idea how I can solve this?

visduo:
Defaults:nagios !requiretty
nagios ALL=(root) NOPASSWD: /usr/lib/nagios/plugins/check_glusterfs *

Note: I don’t really think it matters cause icingaweb2 is justa front-end but I wanted to add that icingaweb2 is installed on another node (master node) and that system does not have glusterfs packages installed.

I removed my “command” and instead created a command in command description in /etc/nagios-plugins/config/ and now the “unknown volume” message is gone.
glusterfs.cfg:
define command{
command_name check_glusterfs
command_line /usr/lib/nagios/plugins/check_glusterfs -l ‘$ARG1$’ -w ‘$ARG2$’ -c ‘$ARG3$’
}
however now icingaweb2 says:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified
that clearly is a sudo misconfiguration, I added updated sudoers with the following lines but still the same error pops up in icingaweb2. any idea how I can solve this?

visduo:
Defaults:nagios !requiretty
nagios ALL=(root) NOPASSWD: /usr/lib/nagios/plugins/check_glusterfs *

Note: I don’t really think it matters cause icingaweb2 is justa front-end but I wanted to add that icingaweb2 is installed on another node (master node) and that system does not have glusterfs packages installed.

Hello @Eth0,

you forgot to add the binaries, which are called by the script. This sudoers config is working for me:
nagios ALL=(root) NOPASSWD:/usr/lib/nagios/plugins/check_glusterfs, /usr/sbin/gluster volume info, /usr/sbin/gluster volume status, /usr/sbin/gluster volume heal

Thanks for the tip. I added the binaries and could get the plugin to work, however, it seems that my issues never end with this plugin.
have a question for you: were you able to set warning/critical thresholds? I have included my services.conf check definition:
apply Service “Gluster” {
import “gluster-service”
check_command = “check_glusterfs.pl”
vars.volume_name = “glust-distr-rep”
vars.perfdata = “1”
vars.DISKWARN = “10” < I lowered the thresholds to make sure I get emails>
vars.DISKCRIT = “15”
vars.inodewarn = “10”
vars.inodcrit = “15”
assign where host.name == NodeName
}

and icinga2 object list --type service shows that the “vars” are set correctly, however as I said I got no warning/critical emails…

Thanks everyone for all the help… I was able to get the plugin to work…