adding memcstats

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

19
shell/memcstats.sh Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
#
# SPDX-License-Identifier: MIT
MC_IP=10.183.37.110
MC_PORT=11211
MC_LOG=/var/log/memcstats.log
MC_CON=""
DTS=$(date -R)
MC_CON=$(/bin/nc -w 5 -i 1 "$MC_IP $MC_PORT" << EOF | grep "STAT curr_connections"
stats
quit
EOF
)
echo "[$DTS] $MC_CON" >> "$MC_LOG"
exit 0