Requirements

On the Client

  • JRE 1.3 and above

JDiagnose Web Application

  • JRE 1.3 and above
  • Servlet 2.3 or above Servlet Container (e.g. Resin 2.1+, Tomcat 4+, Jetty 5+, etc.)

Creating a simple JDiagnose Client

JDiagnose diagnostics should be embedded within applications that require monitoring. The class org.jdiagnose.example.Main in the jdiagnose-core project is an example of a simple JDiagnose client application. The main method of the Main example looks as follows:


    public static void main(String[] args) throws UnknownHostException {

        // create a new java version diagnostic
        // to check that the java version if 1.3 or above
        JavaVersionDiagnostic diagnostic = new JavaVersionDiagnostic("1.3+");
        
        // create a new runner to run the diagnostic
        DiagnosticRunner runner = new DefaultDiagnosticRunner(diagnostic);
        
        // create a new agent and initialise it
        // the agent provides information about the current host and agent
        DefaultAgent agent = new DefaultAgent("jdiagnose");
        agent.init();
        
        // create sender with a url supplied on the command line
        HttpSender httpSender = new HttpSender(args[0]);
        
        // add the httpSender and agent into the runner as listeners
        runner.addResultListener(new SendingResultListener(httpSender, agent));
        
        // run the diagnostic
        runner.run();

    }
        

If you have JDiagnose Web Application running (described in the next section), you should be able to generate jdiagnose results by running the example from the commandline e.g.:

	java -classpath jdiagnose-core.jar org.jdiagnose.example.Main "http://localhost:8080/jdiagnose/httplistener.htm"

Running the JDiagnose Web Application

The JDiagnose WAR should not require any configuration. All that you should have to do is put it into the webapps directory of your favorite Servlet 2.3 container. That's the theory anyway, so let me know if it doesn't.

Once it has started up, you should be able to browse to:

	http://${host}:${port}/jdiagnose