Using JNRPE when Nagios is already present

983 views Asked by At

I was going through JNRPE. Now in my network we have nagios tool installed which monitors the network. I want to understand how JNRPE can help me. I visited many links, went through entire JNRPE website to understand why should I use it and how useful it can be after having nagios tool but I am yet to find anything concrete on this subject.

I understand that JNRPE is used to execute Nagios plugins.

Why in the firsthand I need Nagios plugins. Suppose I have an application running on a web server. What can be the purpose of Nagios plugin in the first place ....

Inspite of having a Nagios tool how can I utilize JNRPE . Basically I am not sure what can be the possible use case behind the implementation of JNRPE and how it well help in a web application project when I am already using something of a kind of Sigar to fetch the hardware parameters of the server.

Also note my application relies heavily on HTTP traffic.

Can anyone please guide as to the possible usecase behind the implementation of JNRPE in a web application.

2

There are 2 answers

0
Massimiliano On

I'm the founder of the JNRPE project.

Everything hovanessyan says is right, however I'd like to add:

I am not sure what can be the possible use case behind the implementation of JNRPE and how it will help in a web application project...

You can find the following main use cases:

  1. You want to write a Nagios plugin that perform a custom check using the JAVA language. Since Nagios executes the plugins as external executables, without JNRPE each check would run a Virtual Machine instance
  2. You want to create a Nagios plugin that is able to run on different machines without the need of recompilation
  3. You want to monitor a machine that is behind a firewall. Infact, using JNRPE you need only one single port to be reachable from Nagios.
  4. You want to embed JNRPE so that you can query it's status directly from Nagios
0
hovanessyan On

JNRPE gives you the possibility to write Nagios plugins using Java. There's numerous third party Nagios plugins available, but very few of them are written in Java (most of the time they are written in python or perl, or simple bash script).

Why in the firsthand I need Nagios plugins?

Nagios itself is plugin based. The core nagios distribution comes with limited number of plugins (scripts) which you can execute to check different parameters on a system. There's endless possibility of things you can check on a system. There's no possible way Nagios (or any other monitoring system) to be able to cover all cases. You certainly need a way to extend a such a system - hence most of them offer plugin support.

An example that comes to mind is the plugin for detailed monitoring of Postgresql. Naigos does not offer it out of the box, but a 3rd party plugin does offer very good and detailed monitoring.

Inspite of having a Nagios tool how can I utilize JNRPE...

Having a 3rd party plugin doing monitoring for you has a double edge - you don't have control over the plugin - you're not sure how long it will be maintained, it's possible it will not work correctly and sometimes it's binary (you cannot look at the code and change it).

When you write the plugin yourself all of the above are not problems.

I am not sure what can be the possible use case behind the implementation of JNRPE and how it will help in a web application project...

For example Nagios lacks straightforward monitoring of JMX and any low-level JVM/Java app parameters. Via JMX you can check parameters in the container itself (Tomcat for example) or in the JVM - working Threads/Heap Usage etc.

There's a couple of 3rd party plugins capable of JMX monitoring but they are not perfect and a lot can be improved! So here's an area where you can utilize JNRPE and write custom plugin that interacts with JMX and does a better job than the existing plugins.