first commit

This commit is contained in:
Roy
2025-06-23 21:19:51 +02:00
commit a4f9ea11f3
69 changed files with 4857 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#!/bin/bash
#Roy Cohen :roy@wondercohen.nl
#objective :Gluster check heal for Nagios
#First line of code :15/01/2019
#last update :23/01/2019
#version :1.0
######START OF SCRIPT#######
OUT=$(cat /tmp/gluster_monitoring_heal 2>/dev/null |grep -a -v volume |sed "s/^[ \t]*//"| grep -a -v ^0 > /dev/null 2>&1 )
EXIT_CODE=$?
if [ -f /tmp/gluster_monitoring_heal ]; then
if [[ $(find /tmp -name "gluster_monitoring_heal" -mmin +4 -print) ]]; then
echo "WARNING: there was an error during the gluster heal check. please check the output of /root/scripts/check_gluster.sh or the nrpe status"
exit 1
elif [ "$EXIT_CODE" -eq 0 ]; then
echo -e "WARNING: volumes healing at this moment\n$(cat /tmp/gluster_monitoring_heal |sed "s/^[ \t]*//" | grep -a -v ^0)" && rm -f /tmp/gluster_monitoring_heal
exit 1
else
echo "OK: no volumes healing at this moment" && rm -f /tmp/gluster_monitoring_heal
exit 0
fi
else
echo "WARNING: there was an error during the gluster heal check please check /tmp/gluster_monitoring_heal"
exit 1
fi