How to view in what openvz vps a process is running

1. Login on openvz node and use ps command to find the PID
[codesyntax lang="bash"]

ssh root@openvz-node
ps auxwwwf

[/codesyntax]

2. After finding PID execute following commands
[codesyntax lang="bash"]

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

[/codesyntax]

  1. Excellent. however I have to replace the $PID with actual process number as the complete command was not working. Anyways nice command to find the VPS responsible for a process.

Scrie si tu o vorbulita


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.