If you want to execute commands on multiple remote hosts over SSH, just run a tmux session and launch a tab on each host in a loop and execute them. It's far easier to follow the output and individually deal with prompts.
However, when you just want to execute the same command : https://clustershell.readthedocs.io/en/latest/tools/clush.ht...