1jstatd(1) Monitoring Tools jstatd(1)
2
3
4
6 jstatd - Monitors Java Virtual Machines (JVMs) and enables remote
7 monitoring tools to attach to JVMs. This command is experimental and
8 unsupported.
9
11 jstatd [ options ]
12
13
14 options
15 The command-line options. See Options.
16
18 The jstatd command is an RMI server application that monitors for the
19 creation and termination of instrumented Java HotSpot VMs and provides
20 an interface to enable remote monitoring tools to attach to JVMs that
21 are running on the local host.
22
23 The jstatd server requires an RMI registry on the local host. The
24 jstatd server attempts to attach to the RMI registry on the default
25 port, or on the port you specify with the -pport option. If an RMI
26 registry is not found, then one is created within the jstatd
27 application that is bound to the port that is indicated by the -pport
28 option or to the default RMI registry port when the -pport option is
29 omitted. You can stop the creation of an internal RMI registry by
30 specifying the -nr option.
31
33 -nr
34 Does not attempt to create an internal RMI registry within the
35 jstatd process when an existing RMI registry is not found.
36
37 -p port
38 The port number where the RMI registry is expected to be found,
39 or when not found, created if the -nr option is not specified.
40
41 -n rminame
42 Name to which the remote RMI object is bound in the RMI
43 registry. The default name is JStatRemoteHost. If multiple
44 jstatd servers are started on the same host, then the name of
45 the exported RMI object for each server can be made unique by
46 specifying this option. However, doing so requires that the
47 unique server name be included in the monitoring client's hostid
48 and vmid strings.
49
50 -Joption
51 Passes option to the JVM, where option is one of the options
52 described on the reference page for the Java application
53 launcher. For example, -J-Xms48m sets the startup memory to 48
54 MB. See java(1).
55
57 The jstatd server can only monitor JVMs for which it has the
58 appropriate native access permissions. Therefore, the jstatd process
59 must be running with the same user credentials as the target JVMs. Some
60 user credentials, such as the root user in UNIX-based systems, have
61 permission to access the instrumentation exported by any JVM on the
62 system. A jstatd process running with such credentials can monitor any
63 JVM on the system, but introduces additional security concerns.
64
65 The jstatd server does not provide any authentication of remote
66 clients. Therefore, running a jstatd server process exposes the
67 instrumentation export by all JVMs for which the jstatd process has
68 access permissions to any user on the network. This exposure might be
69 undesirable in your environment, and therefore, local security policies
70 should be considered before you start the jstatd process, particularly
71 in production environments or on networks that are not secure.
72
73 The jstatd server installs an instance of RMISecurityPolicy when no
74 other security manager is installed, and therefore, requires a security
75 policy file to be specified. The policy file must conform to Default
76 Policy Implementation and Policy File Syntax at
77 http://docs.oracle.com/javase/8/docs/technotes/guides/security/PolicyFiles.html
78
79 The following policy file allows the jstatd server to run without any
80 security exceptions. This policy is less liberal than granting all
81 permissions to all code bases, but is more liberal than a policy that
82 grants the minimal permissions to run the jstatd server.
83
84 grant codebase "file:${java.home}/../lib/tools.jar" {
85 permission java.security.AllPermission;
86 };
87
88 To use this policy setting, copy the text into a file called
89 jstatd.all.policy and run the jstatd server as follows:
90
91 jstatd -J-Djava.security.policy=jstatd.all.policy
92
93 For sites with more restrictive security practices, it is possible to
94 use a custom policy file to limit access to specific trusted hosts or
95 networks, though such techniques are subject to IP address spoofing
96 attacks. If your security concerns cannot be addressed with a
97 customized policy file, then the safest action is to not run the jstatd
98 server and use the jstat and jps tools locally.
99
101 The interface exported by the jstatd process is proprietary and
102 guaranteed to change. Users and developers are discouraged from writing
103 to this interface.
104
106 The following are examples of the jstatd command. The jstatd scripts
107 automatically start the server in the background
108
109 INTERNAL RMI REGISTRY
110 This example shows hos to start a jstatd session with an internal RMI
111 registry. This example assumes that no other server is bound to the
112 default RMI registry port (port 1099).
113
114 jstatd -J-Djava.security.policy=all.policy
115
116
117 EXTERNAL RMI REGISTRY
118 This example starts a jstatd session with a external RMI registry.
119
120 rmiregistry&
121 jstatd -J-Djava.security.policy=all.policy
122
123 This example starts a jstatd session with an external RMI registry
124 server on port 2020.
125
126 jrmiregistry 2020&
127 jstatd -J-Djava.security.policy=all.policy -p 2020
128
129 This example starts a jstatd session with an external RMI registry on
130 port 2020 that is bound to AlternateJstatdServerName.
131
132 rmiregistry 2020&
133 jstatd -J-Djava.security.policy=all.policy -p 2020
134 -n AlternateJstatdServerName
135
136
137 STOP THE CREATION OF AN IN-PROCESS RMI REGISTRY
138 This example starts a jstatd session that does not create an RMI
139 registry when one is not found. This example assumes an RMI registry is
140 already running. If an RMI registry is not running, then an error
141 message is displayed.
142
143 jstatd -J-Djava.security.policy=all.policy -nr
144
145
146 ENABLE RMI LOGGING
147 This example starts a jstatd session with RMI logging capabilities
148 enabled. This technique is useful as a troubleshooting aid or for
149 monitoring server activities.
150
151 jstatd -J-Djava.security.policy=all.policy
152 -J-Djava.rmi.server.logCalls=true
153
154
156 · java(1)
157
158 · jps(1)
159
160 · jstat(1)
161
162 · rmiregistry(1)
163
164
165
166JDK 8 21 November 2013 jstatd(1)