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