wait_for + mail with host down

Hi all,

I would like to receive an email with the hosts that don’t have port 22 (for example) open
How can I do this ?

I though of something like this: