diff options
Diffstat (limited to 'src/firemon/usage.c')
-rw-r--r-- | src/firemon/usage.c | 111 |
1 files changed, 57 insertions, 54 deletions
diff --git a/src/firemon/usage.c b/src/firemon/usage.c index 617f4dacd..37bd4e874 100644 --- a/src/firemon/usage.c +++ b/src/firemon/usage.c | |||
@@ -19,62 +19,65 @@ | |||
19 | */ | 19 | */ |
20 | #include "firemon.h" | 20 | #include "firemon.h" |
21 | 21 | ||
22 | void usage(void) { | 22 | static char *help_str = |
23 | printf("firemon - version %s\n", VERSION); | 23 | "Usage: firemon [OPTIONS] [PID]\n\n" |
24 | printf("Usage: firemon [OPTIONS] [PID]\n\n"); | 24 | "Monitor processes started in a Firejail sandbox. Without any PID specified,\n" |
25 | printf("Monitor processes started in a Firejail sandbox. Without any PID specified,\n"); | 25 | "all processes started by Firejail are monitored. Descendants of these processes\n" |
26 | printf("all processes started by Firejail are monitored. Descendants of these processes\n"); | 26 | "are also being monitored. On Grsecurity systems only root user\n" |
27 | printf("are also being monitored. On Grsecurity systems only root user\n"); | 27 | "can run this program.\n\n" |
28 | printf("can run this program.\n\n"); | 28 | "Options:\n" |
29 | printf("Options:\n"); | 29 | "\t--apparmor - print AppArmor confinement status for each sandbox.\n\n" |
30 | printf("\t--apparmor - print AppArmor confinement status for each sandbox.\n\n"); | 30 | "\t--arp - print ARP table for each sandbox.\n\n" |
31 | printf("\t--arp - print ARP table for each sandbox.\n\n"); | 31 | "\t--caps - print capabilities configuration for each sandbox.\n\n" |
32 | printf("\t--caps - print capabilities configuration for each sandbox.\n\n"); | 32 | "\t--cgroup - print control group information for each sandbox.\n\n" |
33 | printf("\t--cgroup - print control group information for each sandbox.\n\n"); | 33 | "\t--cpu - print CPU affinity for each sandbox.\n\n" |
34 | printf("\t--cpu - print CPU affinity for each sandbox.\n\n"); | 34 | "\t--help, -? - this help screen.\n\n" |
35 | printf("\t--help, -? - this help screen.\n\n"); | 35 | "\t--interface - print network interface information for each sandbox.\n\n" |
36 | printf("\t--interface - print network interface information for each sandbox.\n\n"); | 36 | "\t--list - list all sandboxes.\n\n" |
37 | printf("\t--list - list all sandboxes.\n\n"); | 37 | "\t--name=name - print information only about named sandbox.\n\n" |
38 | printf("\t--name=name - print information only about named sandbox.\n\n"); | 38 | "\t--netstats - monitor network statistics for sandboxes creating a new\n" |
39 | printf("\t--netstats - monitor network statistics for sandboxes creating a new\n"); | 39 | "\t\tnetwork namespace.\n\n" |
40 | printf("\t\tnetwork namespace.\n\n"); | 40 | "\t--nowrap - enable line wrapping in terminals.\n\n" |
41 | printf("\t--nowrap - enable line wrapping in terminals.\n\n"); | 41 | "\t--route - print route table for each sandbox.\n\n" |
42 | printf("\t--route - print route table for each sandbox.\n\n"); | 42 | "\t--seccomp - print seccomp configuration for each sandbox.\n\n" |
43 | printf("\t--seccomp - print seccomp configuration for each sandbox.\n\n"); | 43 | "\t--tree - print a tree of all sandboxed processes.\n\n" |
44 | printf("\t--tree - print a tree of all sandboxed processes.\n\n"); | 44 | "\t--top - monitor the most CPU-intensive sandboxes.\n\n" |
45 | printf("\t--top - monitor the most CPU-intensive sandboxes.\n\n"); | 45 | "\t--version - print program version and exit.\n\n" |
46 | printf("\t--version - print program version and exit.\n\n"); | 46 | |
47 | "Without any options, firemon monitors all fork, exec, id change, and exit\n" | ||
48 | "events in the sandbox. Monitoring a specific PID is also supported.\n\n" | ||
47 | 49 | ||
48 | printf("Without any options, firemon monitors all fork, exec, id change, and exit events\n"); | 50 | "Option --list prints a list of all sandboxes. The format for each entry is as\n" |
49 | printf("in the sandbox. Monitoring a specific PID is also supported.\n\n"); | 51 | "follows:\n\n" |
52 | "\tPID:USER:Command\n\n" | ||
50 | 53 | ||
51 | printf("Option --list prints a list of all sandboxes. The format for each entry is as\n"); | 54 | "Option --tree prints the tree of processes running in the sandbox. The format\n" |
52 | printf("follows:\n\n"); | 55 | "for each process entry is as follows:\n\n" |
53 | printf("\tPID:USER:Command\n\n"); | 56 | "\tPID:USER:Command\n\n" |
54 | 57 | ||
55 | printf("Option --tree prints the tree of processes running in the sandbox. The format\n"); | 58 | "Option --top is similar to the UNIX top command, however it applies only to\n" |
56 | printf("for each process entry is as follows:\n\n"); | 59 | "sandboxes. Listed below are the available fields (columns) in alphabetical\n" |
57 | printf("\tPID:USER:Command\n\n"); | 60 | "order:\n\n" |
61 | "\tCommand - command used to start the sandbox.\n" | ||
62 | "\tCPU%% - CPU usage, the sandbox share of the elapsed CPU time since the\n" | ||
63 | "\t last screen update\n" | ||
64 | "\tPID - Unique process ID for the task controlling the sandbox.\n" | ||
65 | "\tPrcs - number of processes running in sandbox, including the\n" | ||
66 | "\t controlling process.\n" | ||
67 | "\tRES - Resident Memory Size (KiB), sandbox non-swapped physical memory.\n" | ||
68 | "\t It is a sum of the RES values for all processes running in the\n" | ||
69 | "\t sandbox.\n" | ||
70 | "\tSHR - Shared Memory Size (KiB), it reflects memory shared with other\n" | ||
71 | "\t processes. It is a sum of the SHR values for all processes\n" | ||
72 | "\t running in the sandbox, including the controlling process.\n" | ||
73 | "\tUptime - sandbox running time in hours:minutes:seconds format.\n" | ||
74 | "\tUser - The owner of the sandbox.\n" | ||
75 | "\n" | ||
76 | "License GPL version 2 or later\n" | ||
77 | "Homepage: http://firejail.wordpress.com\n" | ||
78 | "\n"; | ||
58 | 79 | ||
59 | printf("Option --top is similar to the UNIX top command, however it applies only to\n"); | 80 | void usage(void) { |
60 | printf("sandboxes. Listed below are the available fields (columns) in alphabetical\n"); | 81 | printf("firemon - version %s\n", VERSION); |
61 | printf("order:\n\n"); | 82 | puts(help_str); |
62 | printf("\tCommand - command used to start the sandbox.\n"); | ||
63 | printf("\tCPU%% - CPU usage, the sandbox share of the elapsed CPU time since the\n"); | ||
64 | printf("\t last screen update\n"); | ||
65 | printf("\tPID - Unique process ID for the task controlling the sandbox.\n"); | ||
66 | printf("\tPrcs - number of processes running in sandbox, including the controlling\n"); | ||
67 | printf("\t process.\n"); | ||
68 | printf("\tRES - Resident Memory Size (KiB), sandbox non-swapped physical memory.\n"); | ||
69 | printf("\t It is a sum of the RES values for all processes running in the\n"); | ||
70 | printf("\t sandbox.\n"); | ||
71 | printf("\tSHR - Shared Memory Size (KiB), it reflects memory shared with other\n"); | ||
72 | printf("\t processes. It is a sum of the SHR values for all processes running\n"); | ||
73 | printf("\t in the sandbox, including the controlling process.\n"); | ||
74 | printf("\tUptime - sandbox running time in hours:minutes:seconds format.\n"); | ||
75 | printf("\tUser - The owner of the sandbox.\n"); | ||
76 | printf("\n"); | ||
77 | printf("License GPL version 2 or later\n"); | ||
78 | printf("Homepage: http://firejail.wordpress.com\n"); | ||
79 | printf("\n"); | ||
80 | } | 83 | } |