NRPE - Agent and Plugin Explained
Nagios Remote Plugin Executor (NRPE) is an agent used by Nagios XI for communicating with remote hosts. Remote hosts are operating systems like Linux and Windows.
This KB article explains:
The purpose of this KB article is to give you an understanding of how the technology works, which in turn will help you with troubleshooting problems with NRPE.
It is important to clearly define the terminology used in this KB article.
This KB article provides detailed information including screenshots from Nagios XI. The concepts explained in this documentation are also applicable to Nagios Core.
Nagios XI Server
This KB article will assume that NRPE and the plugins are installed in the default directories. If your corporate build or repo installed NRPE or the Nagios-plugins to a different directory than the default location, you will have to make note and substitute your paths for those in this KB article. The directories referenced most in this KB article are /usr/local/nagios/libexec/ and /usr/local/nagios/etc/.
Nagios XI is what sends requests to the agent so the first step is to look at an NRPE service in Core Configuration Manager (CCM). Here is a screenshot from a service definition in Nagios XI CCM.
You can see how the Command view shows the Nagios XI command being used. The variables $USER1$, $HOSTADDRESS$, $ARG1$ and $ARG2$ are dynamically inserted into the command when Nagios XI executes the check.
/usr/local/nagios/libexec/check_nrpe -H 10.25.13.30 -t 30 -c check_users -a '-w 5 -c 10'
What does a command definition look like? Using the example above, the check_users command is defined as follows:
/usr/local/nagios/libexec/check_users -w 5 -c 10
There was a statement made earlier that requires further explanation. In relation to the value of $ARG2$ in the following screenshot:
Nagios XI and NRPE both use "variables" or "macros" as a way of creating dynamic configurations.
It is important to remember that the $ARGx$ variable you see in a configuration is directly related to the configuration you are looking at.
Looking at this screenshot:
$ARG2$ in this screenshot contains the values that make up part of the Nagios XI service configuration.
Using the example above, the check_users command is defined as follows:
It can be easy to mix up the arguments on the Nagios XI server with the arguments in the agent configuration. A common mistake is:
This completes the explanation of how the NRPE Agent and Plugin works.
For any support related questions please visit the Nagios Support Forums at:
|Posted by: tlea - Fri, Jul 14, 2017 at 1:03 AM. This article has been viewed 36083 times.|
|Online URL: https://support.nagios.com/kb/article/nrpe-agent-and-plugin-explained-612.html|
Powered by PHPKB (Knowledge Base Software)