3 Replies Latest reply: Jul 12, 2012 11:02 PM by Kalyan Pasupuleti-Oracle RSS

    how will welogic custom mbean get information of jmx client status?

    615811
      how will welogic custom mbean get information of jmx client status?

      Whether the jmx client has disconnected or still connected?
        • 1. Re: how will welogic custom mbean get information of jmx client status?
          Kalyan Pasupuleti-Oracle
          Hi,

          Create xyz.py file.


          set this code with in it.


          =========


          # Connect to a WebLogic Server:
          connect('weblogic','weblogic1','t3://localhost:7001')

          # Change from "serverConfig" JMX tree to "serverRuntime" tree.
          serverRuntime()

          # Use the following attribute to get the startup time,
          # Note that value returned is java long file
          # and you have to convert it to a readable date.
          actTime = get('ActivationTime')

          # Get WebLogic State
          thisState = get('State')

          # Navigate to the JVMRuntime MBean
          cd('JVMRuntime/AdminServer')

          # Use the following attribute to get the CPU of the JVM, hence the server:
          # You might want to multiply this number by 100 to get a precentage
          cpuTime = get('JvmProcessorLoad')*100

          # Disconnect from the WebLogic Server
          disconnect()

          # Import python time package
          import time
          # Use method 'gmtime' to convert 'ActivationTime' to array of
          # Year,Month,Day,Hour,and Seconds
          x = time.gmtime(actTime/1000)

          print
          print
          print "Start Time : " + str(x[0]) + "/" + str(x[1]) + "/" + str(x[2]) + " - " + str(x[3]) + ":" + str(x[4])
          print "Activation Time: " + str(actTime)
          print "State: " + thisState
          print "CPU: " + str(cpuTime) + "%"

          ===========

          java weblogic.WLST /etc/abc/xyz.py
          this will show you the JMX client status.

          Regards,
          Kal
          • 2. Re: how will welogic custom mbean get information of jmx client status?
            615811
            Hi,

            How can it be done with java? As my requirement is, if the JMX client has been terminated, then the custom mbean should get the termination status and unregister it.

            Please suggest .

            Thanks.
            • 3. Re: how will welogic custom mbean get information of jmx client status?
              Kalyan Pasupuleti-Oracle
              Hi,

              Then you need to write a JMX Mbean code please check for programming for JMX in weblogic document it would be helpful.

              Regards,
              kal