コード例 #1
0
	def processMonitoring(monitoring):

		for action in monitoring.action:
			server = action.server
			try:
				dispatcher = MonitoringDispatcher.__getMonitoringDispatcher(server.virtualization_type)	
			except Exception as e:
				XmlRpcClient.sendAsyncMonitoringActionStatus(action.id,"FAILED",str(e))
				MonitoringDispatcher.logger.error(str(e))	
				return

			try:
				#Send async notification
				XmlRpcClient.sendAsyncMonitoringActionStatus(action.id,"ONGOING","")
				MonitoringDispatcher.logger.debug("After sending ongoing")	
				MonitoringDispatcher.__dispatchAction(dispatcher,action,server)	
			except Exception as e:
				MonitoringDispatcher.logger.error(str(e))	
				try:
					if "No route to host" in str(e):
						from settings.settingsLoader import VTAM_IP, VTAM_PORT, XMLRPC_USER, XMLRPC_PASS
						MonitoringDispatcher.logger.error("Agent cannot reach the VT AM server. Please check that the following settings are correct: https://%s:%s@%s:%s" % (XMLRPC_USER, XMLRPC_PASS, VTAM_IP, VTAM_PORT))
				except:
					pass
				raise e
コード例 #2
0
    def processMonitoring(monitoring):

        for action in monitoring.action:
            server = action.server
            try:
                dispatcher = MonitoringDispatcher.__getMonitoringDispatcher(
                    server.virtualization_type)
            except Exception as e:
                XmlRpcClient.sendAsyncMonitoringActionStatus(
                    action.id, "FAILED", str(e))
                MonitoringDispatcher.logger.error(str(e))
                return

            try:
                #Send async notification
                XmlRpcClient.sendAsyncMonitoringActionStatus(
                    action.id, "ONGOING", "")
                MonitoringDispatcher.logger.debug("After sending ongoing")
                MonitoringDispatcher.__dispatchAction(dispatcher, action,
                                                      server)
            except Exception as e:
                MonitoringDispatcher.logger.error(str(e))
                try:
                    if "No route to host" in str(e):
                        from settings.settingsLoader import VTAM_IP, VTAM_PORT, XMLRPC_USER, XMLRPC_PASS
                        MonitoringDispatcher.logger.error(
                            "Agent cannot reach the VT AM server. Please check that the following settings are correct: https://%s:%s@%s:%s"
                            % (XMLRPC_USER, XMLRPC_PASS, VTAM_IP, VTAM_PORT))
                except:
                    pass
                raise e
コード例 #3
0
	def listActiveVMs(vmid, server):
		try:		
			doms = KVMManager.retrieveActiveDomainsByUUID()
			XmlRpcClient.sendAsyncMonitoringActiveVMsInfo(vmid, "SUCCESS", doms, server)
		except Exception as e:
			# Send async notification
			XmlRpcClient.sendAsyncMonitoringActionStatus(vmid, "FAILED", str(e))
			KVMMonitoringDispatcher.logger.error(str(e))
		return
コード例 #4
0
	def listActiveVMs(id,server):
		try:		
			doms = XendManager.retrieveActiveDomainsByUUID()
			XmlRpcClient.sendAsyncMonitoringActiveVMsInfo(id,"SUCCESS",doms,server)

		except Exception as e:
			#Send async notification
			XmlRpcClient.sendAsyncMonitoringActionStatus(id,"FAILED",str(e))
			XenMonitoringDispatcher.logger.error(str(e))
			return
コード例 #5
0
ファイル: MonitoringDispatcher.py プロジェクト: cargious/ocf
	def processMonitoring(monitoring):

		for action in monitoring.action:
			server = action.server
			try:
				dispatcher = MonitoringDispatcher.__getMonitoringDispatcher(server.virtualization_type)	
			except Exception as e:
				XmlRpcClient.sendAsyncMonitoringActionStatus(action.id,"FAILED",str(e))
				MonitoringDispatcher.logger.error(str(e))	
				return

			try:
				#Send async notification
				XmlRpcClient.sendAsyncMonitoringActionStatus(action.id,"ONGOING","")
				MonitoringDispatcher.logger.debug("After sending ongoing")	
				MonitoringDispatcher.__dispatchAction(dispatcher,action,server)	
			except Exception as e:
				MonitoringDispatcher.logger.error(str(e))	
				raise e