scripts/shell/memcstats.sh
2024-03-20 11:28:46 -05:00

19 lines
288 B
Bash
Executable file

#!/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