[Nagiosplug-devel] Re: Native plugins (was Re: Java Plugins)

Jos Visser josv at osp.nl
Fri Nov 19 10:46:00 CET 2004


I would like to venture the guess that the environment that Nagios runs
in does not contain the PATH, CLASSPATH, SHLIB_PATH, JAVA_HOME or other 
relevant environment variables.

++Jos.es

On Fri, Nov 19, 2004 at 09:47:02AM -0700 it came to pass that David Robinson wrote:
> Does anyone on this thread have any experience writing plugins in Java?
> 
>  
> 
> At this time I must use a Java process on the Nagios host in order to
> use the JMX (Java Management Extensions) protocol to communicate with my
> WebLogic Server processes on remote hosts.
> 
>  
> 
> I have successfully written Perl plugins that call Java code, but I have
> been unsuccessful with writing plugins directly in Java.
> 
>  
> 
> When I execute my draft Java plugins from the command line as the Nagios
> user, I get correct output to STDOUT and correct exit codes ... for
> example:
> 
>  
> 
> sh-2.05$ whoami
> 
> nagios
> 
> sh-2.05$ /home/bea/jdk141_05/bin/java -classpath
> /usr/lib/nagios/bea_jars/813/weblogic.jar:/usr/lib/nagios/plugins_custom
> /wls8nagios.jar com.albertsons.nagios.WLS8ThreadMonitor -H lnx074 -P
> 9193 -u beaprod -p want2gohome -D absCommonWLI -S absCommonWLIMngd1 -M
> weblogic.kernel.Default
> 
> THREADS OK: 1 thread(s) used out of 100
> 
> sh-2.05$ echo $?
> 
> 0
> 
> sh-2.05$
> 
>  
> 
>  
> 
> When the same plugin is called from the Nagios process I receive a
> message such as below in the nagios.log file:
> 
>  
> 
> [1100884674] SERVICE ALERT: lnx112;WLS-812-THREADS;WARNING;SOFT;2;(No
> output!)
> 
>  
> 
>  
> 
> Any idea why I am not receiving any output?  I am writing the status
> message using System.out.println("THREADS ..."); and
> System.exit(EXIT_CODE);
> 
>  
> 
> Thanks for the discussion,
> 
> Dave
> 

-- 
What's worth reacting to, is worth overreacting to...





More information about the Devel mailing list