WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Remote Jconsole connection with Websphere Security enabled

  • 1.  Remote Jconsole connection with Websphere Security enabled

    Posted Wed November 28, 2012 11:09 AM
    I am starting a new thread on Jconsole connection .

    I am trying to connect to a websphere app server 7 instance remotely via VPN connection.   I want to connect with Jconsole.  They have security enabled in their prod environment.

    Their envionment is a Websphere 7 on unix box.   

    Every post or instruction i see sets the evnironment variables from the local machine ie my machine.   I do not have websphere 7 installed on my local machine.  

    How can I set this up from my machine to connect to theirs with security enabled?
     
    Note: I am able to connect to their staging environment with Jconsole with security disabled by using the hostname:port url string.

    Do I need websphere installed on my machine?

    Can I set the variables from their machine and if so what would those strings look like?

    Do i need to create a .bat file on my windows machine ?    

         




  • 2.  Remote Jconsole connection with Websphere Security enabled

    Posted Thu November 29, 2012 07:22 AM
    one way is to put the credentials in sas.client.props file but it is not advisable to do in PRD environment.

    not sure if the string you use to connect supports the use of -username -password to authenticate while making a JMX call.

    What exactly are looking at in Jconsole?

    If your usage is specific to WebSphere , you may consider looking at "HealthCenter" or Performance Tuning toolkit"


  • 3.  Remote Jconsole connection with Websphere Security enabled

    Posted Thu November 29, 2012 04:44 PM
    Thank you for the info.  I was able to connect using jconsole.  I found a script online and modified for my environment. 

    heres the link where I found the script:
    stackoverflow.com/questions/357095/how-d...



    The script works... However I am only able to see the mbeans tab in jconsole.   The memory, threads, etc are all greyed out/disabled.

    What I am asking is it possible to use websphere's mbeans in Jconsole so I could see threads, memory, etc.  As of now those are greyed out/disabled.

    I've heard you can but I can't find any documention( besides the script ) that shows how to do it.

    Keep in mind security is enabled.


    Here's the script:

    @echo off

    set HOST=prdWS7AS03
    set PORT=2813

    REM - #### Change Line below to your location of Websphere Install

    set WAS_HOME="C:\Program Files (x86)\IBM\WebSphere\AppServer"



    REM - #### Change the line below to your location of property files

    set PROPERTYFILES=C:\Users\bfinkeldei\Documents\suncountry


    set CLIENTSAS=-Dcom.ibm.CORBA.ConfigURL=file:/%PROPERTYFILES%/sas.client.props
    set SSLCLIENT=-Dcom.ibm.SSL.ConfigURL=file:/%PROPERTYFILES%/ssl.client.props
    set PROVIDER=-Djava.naming.provider.url=corbaname:iiop:%HOST%:
    %PORT%
    set EXTDIRS=-
    Djava.ext.dirs=/%WAS_HOME%/plugins;/%WAS_HOME%/plugins/com.ibm

    .ws.security.crypto;/%WAS_HOME%/lib;/%WAS_HOME%/
    java/jre/lib;/
    %WAS_HOME%/java/jre/lib/ext


    set PROPS=
    set PROPS=%PROPS% %CLIENTSAS%
    set PROPS=%PROPS% %PROVIDER%
    set PROPS=%PROPS% %SSLCLIENT%
    set PROPS=%PROPS% %EXTDIRS%


    set CLASSPATH=
    set CLASSPATH=%CLASSPATH%;%WAS_HOME%\java\lib\tools.jar
    set CLASSPATH=%CLASSPATH%;%WAS_HOME%\runtimes
    \com.ibm.ws.admin.client_7.0.0.jar
    set CLASSPATH=%CLASSPATH%;%WAS_HOME%\runtimes\com.ibm.

    ws.ejb.thinclient_7.0.0.jar
    set CLASSPATH=%CLASSPATH%;%WAS_HOME%\runtimes\
    com.ibm.ws.orb_7.0.0.
    jar
    set CLASSPATH=%CLASSPATH%;%WAS_HOME%\java\lib\jconsole.jar

    set CLASSPATH=%CLASSPATH%;%WAS_HOME%\plugins\com.ibm.ws.
    security.crypto.jar


    set URL=service:jmx:iiop://%HOST%:%PORT%/jndi/JMXConnector


    @echo on


    :: %WAS_HOME%\java\bin\
    java -classpath %CLASSPATH% %PROPS%
    sun.tools.jconsole.JConsole %URL%



  • 4.  Remote Jconsole connection with Websphere Security enabled

    Posted Thu November 29, 2012 08:12 PM
    Hi bfinkeldei,

      I've got your tabs in the next way, the problem is that works fine although security is enabled or disabled

      I'm trying to get a security prompt from websphere or a way to use security
     
      Go to Servers->Server Types->WebSphere Application Servers->SERVER->Java and Process Management-> Process Definition->Java Virtual Machine->Generic JVM Arguments
     
      Put this arguments:
     
      -Djavax.management.builder.initial= -Dcom.sun.management.jmxremote

      Save the changes but not restart the server.
     
      Edit the next file in REMOTE_HOST (where you are connecting), first backup it.
     
        WAS_HOME/AppServer/java/jre/lib/management/management.properties
     
      Uncomment or add the next lines:
     
        com.sun.management.jmxremote.port=3333 -> THE_PORT you want
        com.sun.management.jmxremote.authenticate=false
        com.sun.management.jmxremote.ssl=false

      When you have changed the file, restart the server.

      Open jConsole from your machine (without script, directly).  
     
      in remote host, type:
     
        REMOTE_HOST:THE_PORT
        
      As Joseph's suggest with those products you can get the same information (with ot without security)
     
      IBM Monitoring and Diagnostic Tools for Java - Health Center Version 2.0
      www.ibm.com/developerworks/java/jdk/tool...
     
      Or
     
      WebSphere Application Server Performance Tuning Toolkit
      www.ibm.com/developerworks/websphere/dow...
     
      Hope this helps.

    Regards


  • 5.  Remote Jconsole connection with Websphere Security enabled

    Posted Fri November 30, 2012 09:23 AM
    Thank you for the info.     Let me ask a question though.   By adding the generic jvm argument this invocates sun's mbeans right?

    How can the websphere mbeans be invocated?


  • 6.  Remote Jconsole connection with Websphere Security enabled

    Posted Sat December 01, 2012 11:30 AM
    bfinkeldei

      I think that with this generic arguments you enable sun's JMX mbeans. So they can be invoked from Jconsole, VMConsole, or your custom program using JMX
     
      In this post you have examples of how to invoke websphere mbeans using JMX from your own program

      www.websphereusergroup.org/go/thread/vie...
     
      Another way is using wsadmin.

      tell us if you need more suppport.

    regards


  • 7.  Remote Jconsole connection with Websphere Security enabled

    Posted Mon December 03, 2012 09:42 AM
    Thanks for more info.

    Can the IBM websphere mbeans be invoked though not the sun ones ?


  • 8.  Remote Jconsole connection with Websphere Security enabled

    Posted Mon December 03, 2012 10:51 AM
    Sure, sun has its MBeans and WebSphere theirs

    Using wsadmin scripting with Java Management Extensions (JMX)
    publib.boulder.ibm.com/infocenter/wasinf...

    are you saying this?




  • 9.  Remote Jconsole connection with Websphere Security enabled

    Posted Thu December 13, 2012 03:31 PM
    Forgot to say thanks for the info.   Have a great holiday season!!


  • 10.  Remote Jconsole connection with Websphere Security enabled

    Posted Fri December 14, 2012 12:33 PM
    Hi Brad,

      The same for you

    regards,