adding memcached_check

This commit is contained in:
tengel 2024-03-20 11:28:46 -05:00
parent fdbddaadea
commit 7cadb75874

23
shell/memcached_check.sh Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
#
# SPDX-License-Identifier: MIT
MC_IP=127.0.0.1
MC_PORT=11211
MC_LOG=/var/log/memcached_stats.log
DTS=$(date -R)
/usr/bin/nc -w 5 -i 1 "$MC_IP $MC_PORT" << EOF | grep -q ^END
stats
quit
EOF
# shellcheck disable=SC2181
if [ $? -eq 0 ]; then
echo "[$DTS] OK" >> "$MC_LOG"
else
echo "[$DTS] FAILED" >> "$MC_LOG"
fi
exit 0