#!/usr/bin/pyhton
USER = {"username": "xxl", "password": "xxx“, "url": "t3://10.x.x.x:7001"}
connect(USER["username"], USER["password"], USER["url"])
def get_project_health():
status={'STATE_ACTIVE':1,'STATE_PREPARED':2}
app_status=dict()
app_list=list()
cd("AppDeployments")
apps=format_wr(ls())
domainRuntime()
cd('domainRuntime:/AppRuntimeStateRuntime/AppRuntimeStateRuntime')
for app in apps:
currentState = cmo.getCurrentState(app,'AdminServer')
app_list.append({'name':app,'status':status[currentState]})
app_status['project_health'] = app_list
return app_status
def get_weblogic_jvm():
cd('/ServerRuntimes/AdminServer/JVMRuntime/AdminServer')
HeapSizeCurrent = cmo.getHeapSizeCurrent()
HeapFreeCurrent = cmo.getHeapFreeCurrent()
usedjvm=(HeapSizeCurrent - HeapFreeCurrent)/1024/1024/1024
usedjvm_end=round(usedjvm,2)
used_percent = 100 - cmo.getHeapFreePercent()
#HeapSizeCurrent=round(float(HeapSizeCurrent)/1024/1024/1024,2)
return {'jvm_status':[{'used_percent':used_percent,'usedjvm':usedjvm_end}]}
project_health_result = get_project_health()
jvm_statu_result=get_weblogic_jvm()
info2=dict(project_health_result,**jvm_statu_result)
print info2
disconnect()
通过weblogic wlst获取jvm的监控信息
最新推荐文章于 2023-12-12 16:59:00 发布