Created
March 27, 2015 10:05
-
-
Save syndicut/f993fdbd6761d6b4d048 to your computer and use it in GitHub Desktop.
lizardfs monitoring scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
processName="mfschunkserver"; | |
processCount=`pgrep -x -c ${processName}`; | |
if [ ${processCount} -eq 2 ]; then | |
echo "PASSIVE-CHECK:${processName};0;Ok"; | |
exit 0; | |
else | |
echo "PASSIVE-CHECK:${processName};2;${processName} is NOT RUNNING"; | |
exit 2; | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MASTER=`awk -F= '/MASTER_HOST/ {print$2}' /etc/mfs/mfsmaster.cfg` | |
BROKEN_DISKS=`/usr/bin/lizardfs-probe list-disks ${MASTER} 9421 --porcelain | cut -f4 -d' '|grep -c -v 'no'` | |
if [[ ${BROKEN_DISKS} > 0 ]] | |
then | |
echo "PASSIVE-CHECK:mfs_disks;2;${BROKEN_DISKS} disks damaged"; | |
else | |
echo "PASSIVE-CHECK:mfs_disks;0;OK"; | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MASTER=`awk -F= '/MASTER_HOST/ {print$2}' /etc/mfs/mfsmaster.cfg` | |
LOST=`/usr/bin/lizardfs-probe chunks-health ${MASTER} 9421 --availability | awk ' NR == 3 {print $4}'` | |
UNSAFE=`/usr/bin/lizardfs-probe chunks-health ${MASTER} 9421 --availability | awk ' NR == 3 {print $3}'` | |
if [[ "?${LOST}" != "?-" ]] | |
then | |
echo "PASSIVE-CHECK:mfs_lostchunks;2;${LOST} chunks are lost" | |
exit 0 | |
elif [[ "?${UNSAFE}" != "?-" ]] | |
then | |
echo "PASSIVE-CHECK:mfs_lostchunks;1;${UNSAFE} chunks are unsafe" | |
exit 0 | |
else | |
echo "PASSIVE-CHECK:mfs_lostchunks;0;OK" | |
exit 0 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
processName="mfsmetalogger"; | |
processCount=`pgrep -x -c ${processName}`; | |
if [ ${processCount} -eq 1 ]; then | |
echo "PASSIVE-CHECK:${processName};0;Ok"; | |
exit 0; | |
else | |
echo "PASSIVE-CHECK:${processName};2;${processName} is NOT RUNNING"; | |
exit 2; | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
processName="mfsmount"; | |
processCount=`pgrep -x -c ${processName}`; | |
mountPoint="/mfsroot"; | |
mountCheck=`cut -d' ' -f2 /proc/mounts | grep ^${mountPoint}$`; | |
checkResult=$? | |
if [ ${processCount} -eq 0 ]; then | |
echo "PASSIVE-CHECK:${processName};2;${processName} is NOT RUNNING"; | |
exit 2; | |
elif [ ${checkResult} -ne 0 ]; then | |
echo "PASSIVE-CHECK:${processName};2;${mountPoint} is NOT MOUNTED"; | |
exit 2; | |
else | |
echo "PASSIVE-CHECK:${processName};0;Ok"; | |
exit 0; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment