In this article we are going to see the jstatd commands.
What is jstatd?
jstatd is a RMI server application that monitors creation/termination of instrumented JVMs and provides an interface to allow remote monitoring tools to attach to JVMs(running local host).
That is why, jstatd server needs and RMI registry at local host. If not found, it will create in jstatd application bound(-p port/ default registry port)
- nr : Does not create an internal RMI registry within the jstatd process when an existing RMI registry is not found.
- p (port) : RMI registry port. (if not found, port will be created on, no -nr specified)
- n (rmiName) : Remote RMI object name which is bound in RMI registry(Default is JStatRemoteHost). If multiple jstatd servers are started at a host, RMI object name for each server can unique by this option (the unique server name should be included at monitoring client’s hostid and vmid strings).
- J (option) : Pass option to the java launcher
- jstatd server and monitor JVMs should be running with same user credentials(for access permissions, better to use root)
- jstatd server does not provide any authentication of remote clients. So, local security policies should be considered before starting jstatd.
The jstatd server installs an instance of RMISecurityPolicy which requires a security policy. To run a policy file in server
jstatd -J-Djava.security.policy=[file location]
- We can use custom policy file for strong security