Page 1 of 1
Java plug-in
Posted: Wed Jun 06, 2012 10:16 am
by joaquin
Hello, I am new to the forum, I greet all.
I would like to know how to develop a plug-in in Java. Also useful are guidelines set up, tutorials or other material.
Thanks to all
Re: Java plug-in
Posted: Wed Jun 06, 2012 10:31 am
by scottwilkerson
Plugins can be developed in any language including java as long as they can be run from the command line, return a proper exit code and print the output you desire.
Here is link to a plugin developers guide
http://nagiosplug.sourceforge.net/devel ... lines.html
Re: Java plug-in
Posted: Wed Jun 06, 2012 10:37 am
by joaquin
scottwilkerson wrote:Plugins can be developed in any language including java as long as they can be run from the command line, return a proper exit code and print the output you desire.
Here is link to a plugin developers guide
http://nagiosplug.sourceforge.net/devel ... lines.html
Command type: java -jar MyPlugin.jar localhost serviceA serviceB
Re: Java plug-in
Posted: Thu Jun 07, 2012 11:38 am
by scottwilkerson
I'm not sure if this is a question or an example...
Re: Java plug-in
Posted: Thu Jun 07, 2012 3:10 pm
by joaquin
It 's an example.
Re: Java plug-in
Posted: Thu Jun 07, 2012 4:08 pm
by scottwilkerson
joaquin wrote:It 's an example.
Ok, got it, then that would be close, for the command definition you would likely want to include the full path to java as well as the full path to your .jar file, like:
Code: Select all
/usr/bin/java -jar $USER1$/MyPlugin.jar localhost serviceA serviceB
Notice I used the macro $USER1$ which by default in XI will be replaced with your plugin path ( /usr/local/nagios/libexec ) however you could just put the full path in there as well.
Finally you need to make sure the nagios user has access to your .jar file.
Re: Java plug-in
Posted: Fri Jun 08, 2012 5:08 am
by joaquin
Thanks!!

Re: Java plug-in
Posted: Fri Jun 08, 2012 9:01 am
by scottwilkerson
No problem. This all of course assumes you have the JRE or JDK installed