diff options
author | Colin Patrick McCabe <cmccabe@alumni.cmu.edu> | 2010-11-09 23:32:49 +0100 |
---|---|---|
committer | Colin Patrick McCabe <cmccabe@alumni.cmu.edu> | 2010-11-09 23:33:43 +0100 |
commit | 9f14dd259c8b5baae82877955191d58c28d71274 (patch) | |
tree | 8fbc5fc1c817a02e4af0bfca97f8d5bd31c7c658 /src/ps-ceph.pl | |
parent | Fix example config file (diff) | |
download | ceph-9f14dd259c8b5baae82877955191d58c28d71274.tar.xz ceph-9f14dd259c8b5baae82877955191d58c28d71274.zip |
ps-ceph.pl: display Ceph tests
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
Diffstat (limited to 'src/ps-ceph.pl')
-rwxr-xr-x | src/ps-ceph.pl | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/ps-ceph.pl b/src/ps-ceph.pl index 849d24d0a16..f4e83d7eb02 100755 --- a/src/ps-ceph.pl +++ b/src/ps-ceph.pl @@ -12,6 +12,21 @@ use strict; # Foundation. See file COPYING. # +sub is_ceph_proc { + my $cmdline = @_[0]; + return 1 if $cmdline =~ /\bceph\b/; + return 1 if $cmdline =~ /\bcfuse\b/; + return 1 if $cmdline =~ /\bcmds\b/; + return 1 if $cmdline =~ /\bcmon\b/; + return 1 if $cmdline =~ /\bcosd\b/; + return 1 if $cmdline =~ /\bosdmaptool\b/; + return 1 if $cmdline =~ /\brados\b/; + return 1 if $cmdline =~ /test_/; + return 1 if $cmdline =~ /\bvstart.sh\b/; + + return 0; +} + opendir PROC, "/proc"; while(my $pid = readdir PROC) { next if $pid =~ /\D/; # not a pid @@ -20,6 +35,7 @@ while(my $pid = readdir PROC) { my $cmdline = <CMDLINE>; $cmdline =~ s/[^\x20-\x7e]/ /g; close CMDLINE; - next unless $cmdline =~ /\b(ceph|cfuse|cmds|cmon|cosd|osdmaptool|rados|vstart\.sh)\b/; - print "$pid\t$cmdline\n"; + if (is_ceph_proc($cmdline)) { + print "$pid\t$cmdline\n"; + } } |