Java plug-in

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
joaquin
Posts: 6
Joined: Wed Jun 06, 2012 10:12 am

Java plug-in

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Java plug-in

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
joaquin
Posts: 6
Joined: Wed Jun 06, 2012 10:12 am

Re: Java plug-in

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Java plug-in

Post by scottwilkerson »

I'm not sure if this is a question or an example...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
joaquin
Posts: 6
Joined: Wed Jun 06, 2012 10:12 am

Re: Java plug-in

Post by joaquin »

It 's an example.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Java plug-in

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
joaquin
Posts: 6
Joined: Wed Jun 06, 2012 10:12 am

Re: Java plug-in

Post by joaquin »

Thanks!! :D
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Java plug-in

Post by scottwilkerson »

No problem. This all of course assumes you have the JRE or JDK installed
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked