]>
git.proxmox.com Git - ceph.git/blob - ceph/src/ps-ceph.pl
5 # ps-ceph.pl: Displays a list of ceph processes running locally
7 # Copyright (C) 2010, Dreamhost
9 # This is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public
11 # License version 2.1, as published by the Free Software
12 # Foundation. See file COPYING.
17 return 0 if $cmdline =~ /\bps-ceph.pl\b/;
19 return 1 if $cmdline =~ /\bceph\b/;
20 return 1 if $cmdline =~ /\bceph-fuse\b/;
21 return 1 if $cmdline =~ /\brbd-nbd\b/;
22 return 1 if $cmdline =~ /\brbd-fuse\b/;
23 return 1 if $cmdline =~ /\bceph-mds\b/;
24 return 1 if $cmdline =~ /\bceph-mon\b/;
25 return 1 if $cmdline =~ /\bceph-osd\b/;
26 return 1 if $cmdline =~ /\bceph-mgr\b/;
27 return 1 if $cmdline =~ /\bceph-disk\b/;
28 return 1 if $cmdline =~ /\brbd-mirror\b/;
29 return 1 if $cmdline =~ /\bradosgw\b/;
30 return 1 if $cmdline =~ /\bosdmaptool\b/;
31 return 1 if $cmdline =~ /\brados\b/;
32 return 1 if $cmdline =~ /test_/;
33 return 1 if $cmdline =~ /\bvstart.sh\b/;
38 opendir PROC
, "/proc";
39 while(my $pid = readdir PROC
) {
40 next if $pid =~ /\D/; # not a pid
41 next if !-o
"/proc/$pid"; # not ours
42 open CMDLINE
, "/proc/$pid/cmdline" or next;
43 my $cmdline = <CMDLINE
>;
44 $cmdline =~ s/[^\x20-\x7e]/ /g;
46 if (is_ceph_proc
($cmdline)) {
47 print "$pid\t$cmdline\n";