[Nagiosplug-help] Plugin error (no output!)

Rui Moura rmoura at finibanco.pt
Mon Jun 19 19:37:07 CEST 2006


Hi,



I'm try to code a java plugin and i have a "(no output!)" error
 in web interface.



The code is the following one:



// java class Teste

import java.util.*;

import java.io.*;

import java.text.*;



public class Teste

{

    static String productVersion = "Teste 1.0";



    // nagios return codes:

    static int STATE_OK = 0;

    static int STATE_WARNING = 1;

    static int STATE_CRITICAL = 2;

    static int STATE_UNKNOWN = 3;

    static int STATE_DEPENDENT = 4;



    public static void main(String[] args) {

    

	if ( args.length > 0 && (args[0].equals("--help"))) {

		System.out.println(productVersion);

		System.out.println("usage: java Teste ");

		System.exit(STATE_OK);

	} else if (args.length > 0 && args[0].equals("--version")){

		System.out.println(productVersion);

		System.exit(STATE_OK);

	} else {

		int retVal = teste();

		System.out.println("OK : sem erros\n");

		System.exit(retVal);



	    }

    }// end public static void main(String[] args)

	

    public static int teste()

    {

	

	return STATE_OK;



    }// end public int teste()





}// end public class Teste

----------



the checkcommands and services configurations are:



define command{

	command_name 	testejava

	command_line	/usr/bin/gij $USER1$/Teste

}



define service{

        use                            generic-service

        host_name                       localhost

        service_description             TesteJava

        is_volatile                     0

        check_period                    24x7

        max_check_attempts              3

        normal_check_interval           1

        retry_check_interval            1

        contact_groups                  Administradores

	notification_options		w,u,c,r

        notification_interval           960

        notification_period             24x7

	check_command			testejava

        }



somebody can help me? 

Thanks in advance!



- Rui Moura (rmoura)



-----------------------

The mailing list archive is found here:

http://www.nagiosexchange.org/nagiosplug-help.32.0.html

				




More information about the Help mailing list