Created
June 1, 2018 08:12
-
-
Save justdoit0823/24ce984a381f3b58cd1be19b464d60a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function show_haproxy_socket_info(){ | |
ret=$(ss -tnlp|grep haproxy) | |
echo $ret | |
pstr=$(echo $ret | awk -F'\t' '{split($NF, a, ","); split(a[2], b, "="); split(a[3], c, "="); split(c[2], d, ")"); print b[2], d[1]}') | |
IFS=' ' | |
read -r -a array <<< "$pstr" | |
pid="${array[0]}" | |
fd="${array[1]}" | |
stat /proc/$pid/fd/$fd | |
#lsof -p $pid |grep -v REG|grep -v DIR|grep -v ESTABLISHED | |
#lsof -p 3529 |grep -v REG|grep -v DIR|grep -v ESTABLISHED | |
#stat /proc/3529/fd/5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment