Mercurial > openvz
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/add_vzps.pl Wed May 07 16:23:45 2014 +0200 @@ -0,0 +1,20 @@ +#!/usr/bin/perl +# +# (c)Peter Gervai, 2013 +# +# use: ps awxuf | add_vzps.pl +# + +while( <> ) { + my @cmd = split /\s+/; + my $pid = $cmd[1]; + if( -r "/proc/$pid/status" ) { + my $veid_line = qx( /bin/grep 'envID:' /proc/$pid/status ); + if( $veid_line =~ /envID:\s+(\d+)/ ) { + print $1, '; ', $_; + + } else { + print "SKIP $veid_line "; + } + } +}