Execute ping and save response to the file