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.
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).
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.
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.
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.