The AS400JPing allows your java program to query the host servers to see which services are running and which ports are in service. To query the servers from a command line, use the JPing class.
The AS400JPing class provides several methods:
Example: Using AS400JPing within a Java program to ping the iSeries Remote Command Service:
AS400JPing pingObj = new AS400JPing("myAS400", AS400.COMMAND, false); if (pingObj.ping()) System.out.println("SUCCESS"); else System.out.println("FAILED");