[Nagiosplug-devel] Java Plugins

Andreas Ericsson ae at op5.se
Fri Nov 19 00:11:02 CET 2004


Jos Visser wrote:
> Plugins in Java are possible, and so is calling Java from Perl. The
> performance will probably suck because it takes a long time to
> initialize the entire Java runtime environment (JVM, libraries)
> 

Indeed. Java is a hog, which should be loaded once and once only on 
every machine where it is to run.

> It would probably be better to:
> 
> - Run the check as a daemon and:
>   - control that daemon from, or
>   - use the whats-its-name protocol to communicate status directly to
>     Nagios
> 

I'd say the best you can do is have a small webapplet running on the 
weblogic server which you can fetch some info from and parse in a perl, 
C or shell-script. That way you get the info on-demand, but keep from 
loading java each time the check is run.

> If you are really brave you could extend Nagios with native Java plug-in
> support. This would entail linking libjvm.sl into Nagios and hacking
> some code to call Java methods directly as check_command's... This would
> also mean that you don't need to build up the JVM every time...
> 

I daresay this hack would never make it into the official nagios core 
though, especially considering the embedded perl support which nowadays 
require completely bewildered solutions to work properly.

> ++Jos.es
> 
> On Thu, Nov 18, 2004 at 02:28:16PM -0700 it came to pass that David Robinson wrote:
> 
>>I have written Nagios Perl plugins that invoke the weblogic.Admin java class
>>to monitor runtime information of my WebLogic Servers.  The weblogic.Admin
>>class executes JMX requests to a given WebLogic Server process.  It looks
>>like:
>>
>> 
>>
>> 
>>
>>Nagios Process --> Perl Process --> Java Process -->  JMX call across the
>>network  --> Remote WebLogic Server Process
>>
>> 
>>
>> 
>>
>>These plugins do not seem to perform very well.  Does anyone have any
>>suggestions on improving the performance of plugins for monitoring WebLogic
>>Server?  
>>
>> 
>>
>>I also tried writing a plugin directly in Java, but I'm not sure if this is
>>supported.  Nagios did not receive any output from my Java plugins even
>>though I was exiting with the proper error codes.  Has anyone created
>>plugins in Java?
>>
>> 
>>
>>Thanks for your assistance,
>>
>>Dave
>>
> 
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer




More information about the Devel mailing list