This content has been marked as final. Show 3 replies
Create xyz.py file.
set this code with in it.
# Connect to a WebLogic Server:
# Change from "serverConfig" JMX tree to "serverRuntime" tree.
# 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
# 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
# Import python time package
# Use method 'gmtime' to convert 'ActivationTime' to array of
# Year,Month,Day,Hour,and Seconds
x = time.gmtime(actTime/1000)
print "Start Time : " + str(x) + "/" + str(x) + "/" + str(x) + " - " + str(x) + ":" + str(x)
print "Activation Time: " + str(actTime)
print "State: " + thisState
print "CPU: " + str(cpuTime) + "%"
java weblogic.WLST /etc/abc/xyz.pythis will show you the JMX client status.