Mercurial > openvz
annotate add_vzps.pl @ 5:464dea07deb8 default tip
Add vzps replacements.
author | Peter Gervai <grin@grin.hu> |
---|---|
date | Wed, 07 May 2014 16:23:45 +0200 |
parents | |
children |
rev | line source |
---|---|
5 | 1 #!/usr/bin/perl |
2 # | |
3 # (c)Peter Gervai, 2013 | |
4 # | |
5 # use: ps awxuf | add_vzps.pl | |
6 # | |
7 | |
8 while( <> ) { | |
9 my @cmd = split /\s+/; | |
10 my $pid = $cmd[1]; | |
11 if( -r "/proc/$pid/status" ) { | |
12 my $veid_line = qx( /bin/grep 'envID:' /proc/$pid/status ); | |
13 if( $veid_line =~ /envID:\s+(\d+)/ ) { | |
14 print $1, '; ', $_; | |
15 | |
16 } else { | |
17 print "SKIP $veid_line "; | |
18 } | |
19 } | |
20 } |