1 ." Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. |
1 '\" t |
2 ." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2 .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. |
3 ." |
3 .\" |
4 ." This code is free software; you can redistribute it and/or modify it |
4 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 ." under the terms of the GNU General Public License version 2 only, as |
5 .\" |
6 ." published by the Free Software Foundation. |
6 .\" This code is free software; you can redistribute it and/or modify it |
7 ." |
7 .\" under the terms of the GNU General Public License version 2 only, as |
8 ." This code is distributed in the hope that it will be useful, but WITHOUT |
8 .\" published by the Free Software Foundation. |
9 ." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9 .\" |
10 ." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
10 .\" This code is distributed in the hope that it will be useful, but WITHOUT |
11 ." version 2 for more details (a copy is included in the LICENSE file that |
11 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
12 ." accompanied this code). |
12 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
13 ." |
13 .\" version 2 for more details (a copy is included in the LICENSE file that |
14 ." You should have received a copy of the GNU General Public License version |
14 .\" accompanied this code). |
15 ." 2 along with this work; if not, write to the Free Software Foundation, |
15 .\" |
16 ." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
16 .\" You should have received a copy of the GNU General Public License version |
17 ." |
17 .\" 2 along with this work; if not, write to the Free Software Foundation, |
18 ." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
18 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
19 ." or visit www.oracle.com if you need additional information or have any |
19 .\" |
20 ." questions. |
20 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
21 ." |
21 .\" or visit www.oracle.com if you need additional information or have any |
22 .TH jstatd 1 "10 May 2011" |
22 .\" questions. |
|
23 .\" |
|
24 .\" Arch: generic |
|
25 .\" Software: JDK 8 |
|
26 .\" Date: 21 November 2013 |
|
27 .\" SectDesc: Monitoring Tools |
|
28 .\" Title: jstatd.1 |
|
29 .\" |
|
30 .if n .pl 99999 |
|
31 .TH jstatd 1 "21 November 2013" "JDK 8" "Monitoring Tools" |
|
32 .\" ----------------------------------------------------------------- |
|
33 .\" * Define some portability stuff |
|
34 .\" ----------------------------------------------------------------- |
|
35 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
36 .\" http://bugs.debian.org/507673 |
|
37 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
|
38 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
39 .ie \n(.g .ds Aq \(aq |
|
40 .el .ds Aq ' |
|
41 .\" ----------------------------------------------------------------- |
|
42 .\" * set default formatting |
|
43 .\" ----------------------------------------------------------------- |
|
44 .\" disable hyphenation |
|
45 .nh |
|
46 .\" disable justification (adjust text to left margin only) |
|
47 .ad l |
|
48 .\" ----------------------------------------------------------------- |
|
49 .\" * MAIN CONTENT STARTS HERE * |
|
50 .\" ----------------------------------------------------------------- |
23 |
51 |
24 .LP |
52 .SH NAME |
25 .SH "Name" |
53 jstatd \- Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs\&. This command is experimental and unsupported\&. |
26 jstatd \- Virtual Machine jstat Daemon |
54 .SH SYNOPSIS |
27 .LP |
55 .sp |
28 .SH "SYNOPSIS" |
56 .nf |
29 .LP |
|
30 .nf |
|
31 \f3 |
|
32 .fl |
|
33 jstatd [ \fP\f4options\fP\f3 ]\fP |
|
34 .br |
|
35 \f3 |
|
36 .fl |
|
37 \fP |
|
38 .fi |
|
39 |
57 |
40 .LP |
58 \fBjstatd\fR [ \fIoptions\fR ] |
41 .SH "PARAMETERS" |
59 .fi |
42 .LP |
60 .sp |
43 .RS 3 |
61 .TP |
44 .TP 3 |
62 \fIoptions\fR |
45 options |
63 The command-line options\&. See Options\&. |
46 Command\-line options. The options may be in any order. If there are redundant or contradictory options, the last option specified will take precedence. |
64 .SH DESCRIPTION |
|
65 The \f3jstatd\fR command is an RMI server application that monitors for the creation and termination of instrumented Java HotSpot VMs and provides an interface to enable remote monitoring tools to attach to JVMs that are running on the local host\&. |
|
66 .PP |
|
67 The \f3jstatd\fR server requires an RMI registry on the local host\&. The \f3jstatd\fR server attempts to attach to the RMI registry on the default port, or on the port you specify with the \f3-p\fR\f3port\fR option\&. If an RMI registry is not found, then one is created within the \f3jstatd\fR application that is bound to the port that is indicated by the \f3-p\fR\f3port\fR option or to the default RMI registry port when the \f3-p\fR\f3port\fR option is omitted\&. You can stop the creation of an internal RMI registry by specifying the \f3-nr\fR option\&. |
|
68 .SH OPTIONS |
|
69 .TP |
|
70 -nr |
|
71 .br |
|
72 Does not attempt to create an internal RMI registry within the \f3jstatd\fR process when an existing RMI registry is not found\&. |
|
73 .TP |
|
74 -p \fIport\fR |
|
75 .br |
|
76 The port number where the RMI registry is expected to be found, or when not found, created if the \f3-nr\fR option is not specified\&. |
|
77 .TP |
|
78 -n \fIrminame\fR |
|
79 .br |
|
80 Name to which the remote RMI object is bound in the RMI registry\&. The default name is \f3JStatRemoteHost\fR\&. If multiple \f3jstatd\fR servers are started on the same host, then the name of the exported RMI object for each server can be made unique by specifying this option\&. However, doing so requires that the unique server name be included in the monitoring client\&'s \f3hostid\fR and \f3vmid\fR strings\&. |
|
81 .TP |
|
82 -J\fIoption\fR |
|
83 .br |
|
84 Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&. |
|
85 .SH SECURITY |
|
86 The \f3jstatd\fR server can only monitor JVMs for which it has the appropriate native access permissions\&. Therefore, the \f3jstatd\fR process must be running with the same user credentials as the target JVMs\&. Some user credentials, such as the root user in UNIX-based systems, have permission to access the instrumentation exported by any JVM on the system\&. A \f3jstatd\fR process running with such credentials can monitor any JVM on the system, but introduces additional security concerns\&. |
|
87 .PP |
|
88 The \f3jstatd\fR server does not provide any authentication of remote clients\&. Therefore, running a \f3jstatd\fR server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fR process has access permissions to any user on the network\&. This exposure might be undesirable in your environment, and therefore, local security policies should be considered before you start the \f3jstatd\fR process, particularly in production environments or on networks that are not secure\&. |
|
89 .PP |
|
90 The \f3jstatd\fR server installs an instance of \f3RMISecurityPolicy\fR when no other security manager is installed, and therefore, requires a security policy file to be specified\&. The policy file must conform to Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html |
|
91 .PP |
|
92 The following policy file allows the \f3jstatd\fR server to run without any security exceptions\&. This policy is less liberal than granting all permissions to all code bases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fR server\&. |
|
93 .sp |
|
94 .nf |
|
95 \f3grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { \fP |
|
96 .fi |
|
97 .nf |
|
98 \f3 permission java\&.security\&.AllPermission;\fP |
|
99 .fi |
|
100 .nf |
|
101 \f3};\fP |
|
102 .fi |
|
103 .nf |
|
104 \f3\fP |
|
105 .fi |
|
106 .sp |
|
107 To use this policy setting, copy the text into a file called \f3jstatd\&.all\&.policy\fR and run the \f3jstatd\fR server as follows: |
|
108 .sp |
|
109 .nf |
|
110 \f3jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy\fP |
|
111 .fi |
|
112 .nf |
|
113 \f3\fP |
|
114 .fi |
|
115 .sp |
|
116 For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP address spoofing attacks\&. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fR server and use the \f3jstat\fR and \f3jps\fR tools locally\&. |
|
117 .SH REMOTE\ INTERFACE |
|
118 The interface exported by the \f3jstatd\fR process is proprietary and guaranteed to change\&. Users and developers are discouraged from writing to this interface\&. |
|
119 .SH EXAMPLES |
|
120 The following are examples of the \f3jstatd\fR command\&. The \f3jstatd\fR scripts automatically start the server in the background |
|
121 .SS INTERNAL\ RMI\ REGISTRY |
|
122 This example shows hos to start a \f3jstatd\fR session with an internal RMI registry\&. This example assumes that no other server is bound to the default RMI registry port (port 1099)\&. |
|
123 .sp |
|
124 .nf |
|
125 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP |
|
126 .fi |
|
127 .nf |
|
128 \f3\fP |
|
129 .fi |
|
130 .sp |
|
131 .SS EXTERNAL\ RMI\ REGISTRY |
|
132 This example starts a \f3jstatd\fR session with a external RMI registry\&. |
|
133 .sp |
|
134 .nf |
|
135 \f3rmiregistry&\fP |
|
136 .fi |
|
137 .nf |
|
138 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP |
|
139 .fi |
|
140 .nf |
|
141 \f3\fP |
|
142 .fi |
|
143 .sp |
|
144 This example starts a \f3jstatd\fR session with an external RMI registry server on port 2020\&. |
|
145 .sp |
|
146 .nf |
|
147 \f3jrmiregistry 2020&\fP |
|
148 .fi |
|
149 .nf |
|
150 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP |
|
151 .fi |
|
152 .nf |
|
153 \f3\fP |
|
154 .fi |
|
155 .sp |
|
156 This example starts a \f3jstatd\fR session with an external RMI registry on port 2020 that is bound to \f3AlternateJstatdServerName\fR\&. |
|
157 .sp |
|
158 .nf |
|
159 \f3rmiregistry 2020&\fP |
|
160 .fi |
|
161 .nf |
|
162 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP |
|
163 .fi |
|
164 .nf |
|
165 \f3 \-n AlternateJstatdServerName\fP |
|
166 .fi |
|
167 .nf |
|
168 \f3\fP |
|
169 .fi |
|
170 .sp |
|
171 .SS STOP\ THE\ CREATION\ OF\ AN\ IN-PROCESS\ RMI\ REGISTRY |
|
172 This example starts a \f3jstatd\fR session that does not create an RMI registry when one is not found\&. This example assumes an RMI registry is already running\&. If an RMI registry is not running, then an error message is displayed\&. |
|
173 .sp |
|
174 .nf |
|
175 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr\fP |
|
176 .fi |
|
177 .nf |
|
178 \f3\fP |
|
179 .fi |
|
180 .sp |
|
181 .SS ENABLE\ RMI\ LOGGING |
|
182 This example starts a \f3jstatd\fR session with RMI logging capabilities enabled\&. This technique is useful as a troubleshooting aid or for monitoring server activities\&. |
|
183 .sp |
|
184 .nf |
|
185 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP |
|
186 .fi |
|
187 .nf |
|
188 \f3 \-J\-Djava\&.rmi\&.server\&.logCalls=true\fP |
|
189 .fi |
|
190 .nf |
|
191 \f3\fP |
|
192 .fi |
|
193 .sp |
|
194 .SH SEE\ ALSO |
|
195 .TP 0.2i |
|
196 \(bu |
|
197 java(1) |
|
198 .TP 0.2i |
|
199 \(bu |
|
200 jps(1) |
|
201 .TP 0.2i |
|
202 \(bu |
|
203 jstat(1) |
|
204 .TP 0.2i |
|
205 \(bu |
|
206 rmiregistry(1) |
47 .RE |
207 .RE |
48 |
208 .br |
49 .LP |
209 'pl 8.5i |
50 .SH "DESCRIPTION" |
210 'bp |
51 .LP |
|
52 .LP |
|
53 The \f3jstatd\fP tool is an RMI server application that monitors for the creation and termination of instrumented HotSpot Java virtual machines (JVMs) and provides a interface to allow remote monitoring tools to attach to JVMs running on the local host. |
|
54 .LP |
|
55 .LP |
|
56 The \f3jstatd\fP server requires the presence of an RMI registry on the local host. The \f3jstatd\fP server will attempt to attach to the RMI registry on the default port, or on the port indicated by the \f2\-p port\fP option. If an RMI registry is not found, one will be created within the \f3jstatd\fP application bound to the port indicated by the \f2\-p port\fP option or to the default RMI registry port if \f2\-p port\fP is omitted. Creation of an internal RMI registry can be inhibited by specifying the \f2\-nr\fP option. |
|
57 .LP |
|
58 .LP |
|
59 \f3NOTE:\fP This utility is unsupported and may or may not be available in future versions of the JDK. It is not currently available on the Windows 98 and Windows ME platforms. |
|
60 .LP |
|
61 .SH "OPTIONS" |
|
62 .LP |
|
63 .LP |
|
64 The \f3jstatd\fP command supports the following options: |
|
65 .LP |
|
66 .RS 3 |
|
67 .TP 3 |
|
68 \-nr |
|
69 Do not attempt to create an internal RMI registry within the \f2jstatd\fP process when an existing RMI registry is not found. |
|
70 .TP 3 |
|
71 \-p\ port |
|
72 Port number where the RMI registry is expected to be found, or, if not found, created if \f2\-nr\fP is not specified. |
|
73 .TP 3 |
|
74 \-n\ rminame |
|
75 Name to which the remote RMI object is bound in the RMI registry. The default name is \f2JStatRemoteHost\fP. If multiple \f3jstatd\fP servers are started on the same host, the name of the exported RMI object for each server can be made unique by specifying this option. However, doing so will require that the unique server name be included in the monitoring client's \f2hostid\fP and \f2vmid\fP strings. |
|
76 .TP 3 |
|
77 \-Joption |
|
78 Pass \f2option\fP to the \f3java\fP launcher called by \f3javac\fP. For example, \f3\-J\-Xms48m\fP sets the startup memory to 48 megabytes. It is a common convention for \f3\-J\fP to pass options to the underlying VM executing applications written in Java. |
|
79 .RE |
|
80 |
|
81 .LP |
|
82 .SH "SECURITY" |
|
83 .LP |
|
84 .LP |
|
85 The \f3jstatd\fP server can only monitor JVMs for which it has the appropriate native access permissions. Therefor the \f3jstatd\fP process must be running with the same user credentials as the target JVMs. Some user credentials, such as the \f2root\fP user in UNIX(TM) based systems, have permission to access the instrumentation exported by any JVM on the system. A \f3jstatd\fP process running with such credentials can monitor any JVM on the system, but introduces additional security concerns. |
|
86 .LP |
|
87 .LP |
|
88 The \f3jstatd\fP server does not provide any authentication of remote clients. Therefore, running a \f3jstatd\fP server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fP process has access permissions to any user on the network. This exposure may be undesireable in your environment and local security policies should be considered before starting the \f3jstatd\fP process, particularly in production environments or on unsecure networks. |
|
89 .LP |
|
90 .LP |
|
91 The \f3jstatd\fP server installs an instance of RMISecurityPolicy if no other security manager has been installed and therefore requires a security policy file to be specified. The policy file must conform to the default policy implementation's |
|
92 .na |
|
93 \f2Policy File Syntax\fP @ |
|
94 .fi |
|
95 http://download.oracle.com/javase/7/docs/technotes/guides/security/PolicyFiles.html. |
|
96 .LP |
|
97 .LP |
|
98 The following policy file will allow the \f3jstatd\fP server to run without any security exceptions. This policy is less liberal then granting all permissions to all codebases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fP server. |
|
99 .LP |
|
100 .nf |
|
101 \f3 |
|
102 .fl |
|
103 grant codebase "file:${java.home}/../lib/tools.jar" {\fP |
|
104 .br |
|
105 \f3 |
|
106 .fl |
|
107 permission java.security.AllPermission;\fP |
|
108 .br |
|
109 \f3 |
|
110 .fl |
|
111 };\fP |
|
112 .br |
|
113 \f3 |
|
114 .fl |
|
115 \fP |
|
116 .fi |
|
117 |
|
118 .LP |
|
119 .LP |
|
120 To use this policy, copy the text into a file called \f2jstatd.all.policy\fP and run the \f3jstatd\fP server as follows: |
|
121 .LP |
|
122 .nf |
|
123 \f3 |
|
124 .fl |
|
125 jstatd \-J\-Djava.security.policy=jstatd.all.policy\fP |
|
126 .br |
|
127 \f3 |
|
128 .fl |
|
129 \fP |
|
130 .fi |
|
131 |
|
132 .LP |
|
133 .LP |
|
134 For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP addreess spoofing attacks. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fP server and use the \f3jstat\fP and \f3jps\fP tools locally. |
|
135 .LP |
|
136 .SH "REMOTE INTERFACE" |
|
137 .LP |
|
138 .LP |
|
139 The interface exported by the \f3jstatd\fP process is proprietary and is guaranteed to change. Users and developers are discouraged from writing to this interface. |
|
140 .LP |
|
141 .SH "EXAMPLES" |
|
142 .LP |
|
143 .LP |
|
144 Here are some examples of starting \f3jstatd\fP. Note that the \f3jstatd\fP scripts automatically start the server in the background. |
|
145 .LP |
|
146 .SS |
|
147 Using Internal RMI Registry |
|
148 .LP |
|
149 .LP |
|
150 This example demonstrates starting \f3jstatd\fP with an internal RMI registry. This example assumes that no other server is bound to the default RMI Registry port (port 1099). |
|
151 .LP |
|
152 .nf |
|
153 \f3 |
|
154 .fl |
|
155 jstatd \-J\-Djava.security.policy=all.policy |
|
156 .fl |
|
157 \fP |
|
158 .fi |
|
159 |
|
160 .LP |
|
161 .SS |
|
162 Using External RMI Registry |
|
163 .LP |
|
164 .LP |
|
165 This example demonstrates starting \f3jstatd\fP with a external RMI registry. |
|
166 .LP |
|
167 .nf |
|
168 \f3 |
|
169 .fl |
|
170 rmiregistry& |
|
171 .fl |
|
172 jstatd \-J\-Djava.security.policy=all.policy |
|
173 .fl |
|
174 \fP |
|
175 .fi |
|
176 |
|
177 .LP |
|
178 .LP |
|
179 This example demonstrates starting \f3jstatd\fP with an external RMI registry server on port 2020. |
|
180 .LP |
|
181 .nf |
|
182 \f3 |
|
183 .fl |
|
184 rmiregistry 2020& |
|
185 .fl |
|
186 jstatd \-J\-Djava.security.policy=all.policy \-p 2020 |
|
187 .fl |
|
188 \fP |
|
189 .fi |
|
190 |
|
191 .LP |
|
192 .LP |
|
193 This example demonstrates starting \f3jstatd\fP with an external RMI registry on port 2020, bound to name AlternateJstatdServerName. |
|
194 .LP |
|
195 .nf |
|
196 \f3 |
|
197 .fl |
|
198 rmiregistry 2020& |
|
199 .fl |
|
200 jstatd \-J\-Djava.security.policy=all.policy \-p 2020 \-n AlternateJstatdServerName |
|
201 .fl |
|
202 \fP |
|
203 .fi |
|
204 |
|
205 .LP |
|
206 .SS |
|
207 Inhibiting creation of an in\-process RMI registry |
|
208 .LP |
|
209 .LP |
|
210 This example demonstrates starting \f3jstatd\fP such that it will not create a RMI registry if one is not found. This example assumes an RMI registry is already running. If it is not, an appropriate error message is emitted. |
|
211 .LP |
|
212 .nf |
|
213 \f3 |
|
214 .fl |
|
215 jstatd \-J\-Djava.security.policy=all.policy \-nr |
|
216 .fl |
|
217 \fP |
|
218 .fi |
|
219 |
|
220 .LP |
|
221 .SS |
|
222 Enabling RMI logging capabilities. |
|
223 .LP |
|
224 .LP |
|
225 This example demonstrates starting \f3jstatd\fP with RMI logging capabilities enabled. This technique is useful as a troubleshooting aid or for monitoring server activities. |
|
226 .LP |
|
227 .nf |
|
228 \f3 |
|
229 .fl |
|
230 jstatd \-J\-Djava.security.policy=all.policy \-J\-Djava.rmi.server.logCalls=true |
|
231 .fl |
|
232 \fP |
|
233 .fi |
|
234 |
|
235 .LP |
|
236 .SH "SEE ALSO" |
|
237 .LP |
|
238 .RS 3 |
|
239 .TP 2 |
|
240 o |
|
241 java(1) \- the Java Application Launcher |
|
242 .TP 2 |
|
243 o |
|
244 jps(1) \- the Java Process Status Application |
|
245 .TP 2 |
|
246 o |
|
247 jstat(1) \- the Java Virtual Machine Statistics Monitoring Tool |
|
248 .TP 2 |
|
249 o |
|
250 .na |
|
251 \f2rmiregistry\fP @ |
|
252 .fi |
|
253 http://download.oracle.com/javase/7/docs/technotes/tools/index.html#rmi \- the Java Remote Object Registry |
|
254 .RE |
|
255 |
|
256 .LP |
|
257 |
|