title: How to check if a host is unreachable?
body: <p>I am trying to get the unreachable condition of the ping host as I am getting just (0,1) value for up and down respectively, how would I get any condition "2" at which it tell me unreachable ping host?</p>
  
  <p>My code,</p>
  
  <pre><code>import java.net.InetAddress;
  
  public class PingExample 
  {
  public static void main(String[] args)
  {
  try
  {
  InetAddress address = InetAddress.getByName("172.16.2.0");
  // Try to reach the specified address within the timeout
  // periode. If during this periode the address cannot be
  // reach then the method returns false.
  boolean reachable = address.isReachable(10000);
  System.out.println("Is host reachable? " + reachable);
  } catch (Exception e)
  {
  e.printStackTrace();
  }
  }
  }
  </code></pre>
  
  <p>What is active and passive state? How can I check it?</p>
  
  <hr>
  
  <p><strong>Edit:</strong> see at this link page 26
  <a href="http://nagios.sourceforge.net/docs/ndoutils/NDOUtils_DB_Model.pdf" rel="nofollow">http://nagios.sourceforge.net/docs/ndoutils/NDOUtils_DB_Model.pdf</a></p>
  
  <p>stat column description. I want to get this result as I had posted my code, so how would I get that column "state"? Remember I am using loop for "n" hosts.</p>