adding memcached_check
This commit is contained in:
parent
fdbddaadea
commit
7cadb75874
1 changed files with 23 additions and 0 deletions
23
shell/memcached_check.sh
Executable file
23
shell/memcached_check.sh
Executable 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue