<commit_before>Check_Gluster
=============

#Gluster Check Plugin#
Nagios health check for GlusterFS 3.3.  It checks a volumes status, and if all the bricks are present.

#CLI Usage#
```
nagios@monitor:~/> ./check_gluster.pl -v data -n 2
GLUSTER OK - Volume data is Stable
```
Where -v is the volume name, and -n is the expected number of bricks.

#Called via NRPE#
```
nagios@monitor:~/> ./check_nrpe -H 10.4.20.69 -c check_gluster
```

#Deployment#
Add to nrpe.cfg.
````
command[check_gluster]=/usr/local/nagios/libexec/check_gluster.pl -v data -n 4 
````
The script wraps a call to gluster, and that command needs to be run as root, 
so you might need to add something similar to your sudoers.
````
nagios ALL=NOPASSWD:/usr/sbin/gluster volume info data
````
Put this in command.cfg on your nagios server.
````
define command{ command_name check-gluster-status command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_gluster }
````
Define the service, and you're done.
````
define service{ 
       use generic-service 
     hostgroup_name gluster-hosts
     service_description gluster_status
     check_command check-gluster-status
     notifications_enabled 0
     }
````
<commit_msg>Added mention of sudo-switch to the readme<commit_after>Check_Gluster
=============

#Gluster Check Plugin#
Nagios health check for GlusterFS 3.3.  It checks a volumes status, and if all the bricks are present.

#CLI Usage#
```
nagios@monitor:~/> ./check_gluster.pl -v data -n 2 [-s|--sudo]
GLUSTER OK - Volume data is Stable
```
Where -v is the volume name, and -n is the expected number of bricks.
If you want your privileges escalated, use -s or --sudo respectively.

#Called via NRPE#
```
nagios@monitor:~/> ./check_nrpe -H 10.4.20.69 -c check_gluster
```

#Deployment#
Add to nrpe.cfg.
````
command[check_gluster]=/usr/local/nagios/libexec/check_gluster.pl -v data -n 4 
````
The script wraps a call to gluster, and that command needs to be run as root, 
so you might need to add something similar to your sudoers.
````
nagios ALL=NOPASSWD:/usr/sbin/gluster volume info data
````
Put this in command.cfg on your nagios server.
````
define command{ command_name check-gluster-status command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_gluster }
````
Define the service, and you're done.
````
define service{ 
       use generic-service 
     hostgroup_name gluster-hosts
     service_description gluster_status
     check_command check-gluster-status
     notifications_enabled 0
     }
````

{'fraction_non_alphanumeric': 0.11873245086241477, 'fraction_numerical': 0.010429201764941836, 'mean_word_length': 3.9191321499013805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1130328', 'n_tokens_mistral': 875, 'n_tokens_neox': 806, 'n_words': 290}