Followers

Wednesday, October 29, 2014

Server Monitoring script

def reportDomainHealth(usern, passw, url):
print ""
print "===================================================================================="
connect(usern,passw,url)
domainRuntime()

print "Found Servers: "
serverList=ls('ServerRuntimes');
serverList=serverList.split()
print "%15s %15s %20s %15s %15s %40s" % ("Server","Threads","HoggingThreads","ServerState","Heap_Free","HealthState ")
print "----------------------------------------------------------------------------------------------------------------------------"
for i in range(len(serverList)):
if serverList[i] != 'dr--':
server_st=get('ServerRuntimes/' + serverList[i] + '/HealthState')
server_tc=get('ServerRuntimes/' + serverList[i] + '/ThreadPoolRuntime/ThreadPoolRuntime/ExecuteThreadTotalCount')
server_hog=get('ServerRuntimes/' + serverList[i] + '/ThreadPoolRuntime/ThreadPoolRuntime/HoggingThreadCount')
server_ql=get('ServerRuntimes/' + serverList[i] + '/State')
server_hpfp=get('ServerRuntimes/' + serverList[i] + '/JVMRuntime/' + serverList[i] + '/HeapFreePercent')
print "%15s %15s %20s %15s %15s %40s" % (serverList[i],str(server_tc),str(server_hog),str(server_ql),str(server_hpfp)+"%",str(server_st))
print "===================================================================================="


reportDomainHealth('weblogic','weblogic1','t3://localhost:7001')

No comments:

Post a Comment