[Nagiosplug-devel] Re: Native plugins (was Re: Java Plugins)
David Robinson
David.Robinson at albertsons.com
Fri Nov 19 08:48:00 CET 2004
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20041119/09a776ce/attachment.html>
More information about the Devel
mailing list