in reply to Remote host back online test
Pinging might not work well for you. Computers tend to be 'pingable' soon after they boot up, but other services such as a database or webserver might start considerably later. You might want to brute force it: just send your command and try to analyze the result and resend if necessary. Or perhaps figure out some other test that tells you that the service you need is running.