How to view in what openvz vps a process is running

1. Login on openvz node and use ps command to find the PID

ssh root@openvz-node
ps auxwwwf

2. After finding PID execute following commands

PID=12345
for i in `vzlist -a | grep running | awk '{print $1}'`; do echo $i; ps $* -p $(grep -l "^envID:[[:space:]]*$i\$" /proc/[0-9]*/status | sed -e 's=/proc/\([0-9]*\)/.*=\1=') | grep $PID; done

Leave a Reply

Your email address will not be published. Required fields are marked *