Monitor number of open sockets by a process
Example with watch
command:
watch -n 1 'ps aux | kazy -i cmproxy -e kazy | kazy -r "[\d]+" -x | xargs -I % ls -l /proc/%/fd/ | kazy -i socket | wc -l'
Example with ttyplot
command:
{ while true; do ps aux | kazy -i cmproxy -e kazy | kazy -r "[\d]+" -x | xargs -I % ls -l /proc/%/fd/ | kazy -i socket | wc -l; sleep 1; done } | ttyplot