The script checks if a droplet is alive by opening a specified port. If the connection is successful, then it tries to retrieve a php file which locally checks the services on the droplet (in our example, just the MySQL server).
The sources are available here: