How to enable JMX with authentication


/ Published in: Java
Save to your folder(s)

This will enable jmx in port 5555 with authentication enabled. In windows systems you may get an exception related to file access permissions. To solve this exceptions use the command `cacls jmx.password /P :R` and `cacls jmx.access /P :R`. Ref: http://www.wowzamedia.com/forums/showthread.php?145-Receive-quot-Password-file-read-access-must-be-restricted-quot-error-on-Windows-(solution)


Copy this code and paste it in your HTML
  1. -Dcom.sun.management.jmxremote
  2. -Dcom.sun.management.jmxremote.port=5555
  3. -Dcom.sun.management.jmxremote.ssl=false
  4. -Dcom.sun.management.jmxremote.authenticate=true
  5. -Dcom.sun.management.jmxremote.access.file=d:/jmx/jmx.access
  6. -Dcom.sun.management.jmxremote.password.file=d:/jmx/jmx.password
  7.  
  8. //jmx.access
  9. user readonly
  10. admin readwrite
  11.  
  12. //jmx.password
  13. user user
  14. admin password
  15.  
  16. //In windows to resolve the exception related to file protection
  17. //In command prompt go to the folders where the jmx password and access files are kept then
  18. cacls jmx.password /P <username>:R
  19. cacls jmx.access /P <username>:R

URL: https://wiki.internet2.edu/confluence/display/CPD/Monitoring+Tomcat+with+JMX

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.