Ejemplo n.º 1
0
def tmonMetricsMonitor():
		# parameter from tmon3.0.conf
		paramServerList = configparser.getServerList()
		paramAdminUser 	= configparser.getAdminUser()
		paramAdminPass	= configparser.getAdminPass()
		paramConnectString = configparser.getConnectString()
		tmonLog = []	
	
		# tmonLog variable which has the data to be printed in the log file
		for args in paramServerList:
			try:
				profile_server = args.split()
				server_name = profile_server[0]
				app_name = profile_server[5]
				gc_metrics = str(metrics.getGCmetrics( args ) )
				heap_usage =  str(metrics.getJVMmetrics( args , paramAdminUser , paramAdminPass , paramConnectString  )) 
				http_sessions =  str(metrics.getHTTPSessions( args , paramAdminUser , paramAdminPass , paramConnectString ))
				open_sockets =  str(metrics.getOpenSockets( args , paramAdminUser , paramAdminPass , paramConnectString  ))
				current_ts =  str(metrics.getTimeStamp() )
				if gc_metrics != "failed":
					tmonLog.append( [ server_name , app_name , gc_metrics , heap_usage , http_sessions , open_sockets , current_ts ])
					#container || app || gc time || gc count || heap usage || http sessions cnt || open sockets cnt || timestamp 
				else:
					print "debug: tmonMetricsMonitor - there is an issue to get attribute value, please check if server is available. \n"
			except WLSTException,e:
				print "debug: tmonMetricsMonitor " + str(e) 		
Ejemplo n.º 2
0
def tmonMetricsMonitor():
		# parameter from tmon3.0.conf
		paramServerList = configparser.getServerList()
		#paramAdminUser 	= configparser.getAdminUser()
		#paramAdminPass	= configparser.getAdminPass()
		#paramConnectString = configparser.getConnectString()
		tmonLog = []	
	
		# tmonLog variable which has the data to be printed in the log file
		for args in paramServerList:
			try:
				start = datetime.datetime.now()
				profile_server = args.split()
				server_name = profile_server[0]
				app_name = profile_server[5]
				gc_metrics = str(metrics.getGCmetrics( args ) )
				heap_usage =  str(metrics.getJVMmetrics( args )) 
				http_sessions =  str(metrics.getHTTPSessions( args ))
				open_sockets =  str(metrics.getOpenSockets( args ))
				current_ts =  str(metrics.getTimeStamp() )

				check =  threads.getThreadStucksCount( args )[0]

				if check != "failed":
					threads_info =  threads.getThreadStucksCount( args )
					 #[0] threads id list , [1] count threads hogging , [2] count threads stuck , [3] Throughput , [4] ExecuteThreadTotalCount , [5] ExecuteThreadIdleCount
					print "debug: elapsed" + str(threads_info[0])
					hogging_cnt  = threads_info[1]
					stuck_cnt    = threads_info[2] 
					thread_Throughput =  threads_info[3]
					thread_ExecuteThreadTotalCount = threads_info[4]
					thread_ExecuteThreadIdleCount = threads_info[5]
				else:
					print "debug: tmonStackMonitor - there is an issue to get attribute value, please check if server is available. \n"

				if gc_metrics != "failed":
					tmonLog.append( [ server_name , app_name , gc_metrics , heap_usage , http_sessions , open_sockets , hogging_cnt , stuck_cnt , thread_Throughput , thread_ExecuteThreadTotalCount  , thread_ExecuteThreadIdleCount ,  current_ts ])
					#container || app || gc time || gc count || heap usage || http sessions cnt || open sockets cnt || hogging cnt || stuck cnt|| Throughput || ExecuteThreadTotalCount || ExecuteThreadIdleCount || timestamp 
				else:
					print "debug: tmonMetricsMonitor - there is an issue to get attribute value, please check if server is available. \n"
				end = datetime.datetime.now()
				diff = end - start
				print "function (tmonMetricsMonitor) container: " + server_name +  " tooks about: " + str(int(round(diff.microseconds / 1000))) + " to finish."
			except WLSTException,e:
				print "debug: tmonMetricsMonitor " + str(e)