def doit(channel):

    cpu_pc = psutil.cpu_percent()
    mem_avail_mb = psutil.virtual_memory().percent

    try:
        response = channel.update({1: cpu_pc, 2: mem_avail})
        print(cpu_pc)
        print(mem_avail_mb)
        print(strftime("%a, %d %b %Y %H:%M:%S", localtime()))
        print(response)
    except:
        print("connection failed")