To elaborate on the previous answer, there are degrees of "up"-ness.
Connecting to a hidden service involves roughly the following steps. You could write a tool that performed any number of them and declares the service "up" if they succeed, but you won't know if subsequent steps would have failed unless you try them too.
- Connect to Tor
- Download the directory consensus
- Connect to the first HSDir node for your hidden service and fetch the HS descriptor
- If the first HSdir fails, try another. There are several HSDirs responsible for each HS (for details, read about consistent hashing, DHTs, etc)
- Try communicating with the HS via the first introduction node in the HS descriptor
- If the first introduction node fails, try another. There are several.
- Tell the hidden service (via the introduction point) about a rendezvous node, and build a circuit there. The HS should also build a circuit there, and the rendezvous node will merrily connect the two.
- Connect to the hidden service through the new circuit to rendezvous node
If the hidden service has been completely down for a while, step 3 will fail (none of the HSDirs will have a record of it).
If the hidden service went down recently, step 4 will fail (none of the introduction points will have an open circuit to it).
If the hidden service's Tor daemon is running but the service behind it (eg, a webserver) is not, then step 6 will fail.
HTH HAND