Ejemplo n.º 1
0
 def run(self):
     logger.info('p_transmit_server_source_thread...')
     while True:
         if g_wal_ip!=None and g_clc_ip!=None:                        
             hdSource = utility.utility_get_current_resource()
             g_source_switch.acquire()
             hdSource.net_receiverate = g_server_resource['recvRate']
             hdSource.net_sendrate = g_server_resource['sendRate']
             hdSource.cpu_utilization = g_server_resource['cpuUtilization']
             g_source_switch.release()
             hdSource.state = 'HW_STATUS_OK'
             if hdSource.cpu_utilization > VM_CPU_UTILIZATION:
                 hdSource.state = 'HW_STATUS_WARN'            
             OpenLdap.p_transmit_hard_source(g_clc_ip,g_wal_ip,hdSource)
         time.sleep(SERVER_SOURCE_INTV)
Ejemplo n.º 2
0
 def run(self):
     logger.debug('p_transmit_server_source_thread...')
     global g_nc_source
     global g_cc_ip
     global g_clc_ip
     while True:                        
         hdSource = utility.utility_get_current_resource()
         g_source_switch.acquire()
         hdSource.net_receiverate = g_server_resource['recvRate']
         hdSource.net_sendrate = g_server_resource['sendRate']
         hdSource.cpu_utilization = g_server_resource['cpuUtilization']
         g_source_switch.release()
         hdSource.state = 'HW_STATUS_OK'
         if hdSource.cpu_utilization > VM_CPU_UTILIZATION:
             hdSource.state = 'HW_STATUS_WARN'
         if g_cc_ip!=None:    
             g_nc_source[g_cc_ip] = hdSource
         logger.info(g_nc_source)
         nc_source = g_nc_source.copy()
         for ip in nc_source:
             if g_clc_ip!=None:
                 OpenLdap.p_transmit_hard_source(g_clc_ip,ip,nc_source[ip])
         time.sleep(SERVER_SOURCE_INTV)