def METHOD_NAME(total_agents):
    for i in range(total_agents):
        id = i + 1
        name = 'Agent-test' + str(id)
        date = time.time()
        command = f'global insert-agent {{"id":{id},"name":"{name}","date_add":{date}}}'
        results = query_wdb(command)
        assert results == 'ok'
        command = f'''global set-agent-groups {{"mode":"append","sync_status":"syncreq",
                   "source":"remote","data":[{{"id":{id},"groups":["Test_group{id}"]}}]}}'''
        results = query_wdb(command)
        assert results == 'ok'