Target Audience
This document is intended or admins who are having issues with the NRPE agent on "inu# plat orms. It assumes that you have some basic !nowledge o how NRPE wor!s, that you have installed and created a base con iguration.
"SClient(( "#PE Specific Errors' 'I<. 0N9N-CN; No handler or that command '<. ERR-R; Dissing argument e#ception )*I+ ,eneral Troubleshooting Steps
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page ,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
<+ 4+
II+ #eturn code of -87 is out of bounds 0 plugin may not be e ecutable
Dany times when a plugin is downloaded rom the e#change and copied to the remote host, it will not have e#ecutable permissions. )ou can veri y this by getting a long$listing o the libe#ec plugin directory; ls -l /usr/local/nagios/libexec )ou should see a listing similar to; -rwxr-xr-x 1 apache apache 1! -rwxr-xr-x. 1 root root $)*#1* -rwxr-xr-x. 1 root root *,') -rwxr-xr-x. 1 root root &1)$ -rw-r--r--. 1 root root ,' /......0truncated1.......... "eb +an -o. -o. -o. # & 1 1 1 1$%&' !1%1* !1%$, !1%$' !1%$' check_apachere(uests.pl check_apt check_asterisk.pl check_bl check_foo.sh
The ar le t column o the listing are the permissions or each ile. I you noticed, %chec!: oo.sh& is missing an %#& in a ew places. These are e#ecutable permissions and can easily be added to the ile by typing; chmod 2x /usr/local/nagios/libexec/check_foo.sh Remember that %chec!: oo.sh& is Bust an e#ample and you will change that to the actual name and path to your plugin that is missing e#ecutable permissions.
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page 8
,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page <
,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
I you are using the init$script method, or i your distribution does not use the %service& command, you can always grep a process listing; ps -aef = grep nrpe )ou should see output similar to the ollowing .important bits in bold2; nagios #$ 1$ 1 ! "eb * > !!%!!%!) /usr/libexec/nrpe -c /etc/nagios/nrpe.cfg --daemon
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page 4
,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page 3
,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
*+ C>EC?@"#PE' #ecei&ed 5 bytes from daemon+ ChecA the remote ser&er logs for error messages
Nirst, ma!e sure that NRPE is running as this is a common cause o this error. Nor instructions on how to do so, re er to part I< o this document under the section %,hec! the NRPE (ervice (tatus&. The other causes all deal with arguments. I you are passing arguments to the remote host through nrpe, the argument usage should be consistent between the 'I service chec! and the arguments declared in the command directive in the remote host*s nrpe.c g. Additionally, ,hec! the remote host*s nrpe.c g or the %dont:blame:nrpe& directive. cat /usr/local/nagios/etc/nrpe.cfg = grep blame The e#pected output should be; dont_blame_nrpe=1 Cithout this directive set to %5&, arguments will not be accepted or any chec!s other than those speci ied in the nrpe.c g ile itsel . "o Arguments To chec! it your argument usage is consistent, compare the chec! in 'I to the command directive in the remote host*s nrpe.c g ile. I you have declared all the arguments or a chec! in the nrpe.c g ile, then 'I should pass no arguments other than the command itsel ; nrpe.c g; command[check_users]=/usr/local/nagios/libexec/check_users -w # -c 1! 'I service chec!; check_command% check_nrpe IB@J1I check_users IB@J I2 4blank5 Separate Arguments I you have setup multiple arguments or each threshold/option, 'I should pass them in the same order; nrpe.c g; command[check_users]=/usr/local/nagios/libexec/check_users -w IB@J1I -c IB@J I 'I service chec!; check_command% check_nrpe IB@J1I check_users IB@J I # IB@J$I 1! IB@J&I2 4blank5 Notice how the command directive e#pects HAR15H and HAR16H even though in 'I they are actually HAR16H and HAR1FH. This trips up beginners, as 'I passes all F arguments to chec!:nrpe, where chec!:nrpe then passes the command and it*s 6 arguments to NRPE on the remote host. Oust something to be aware o . Combined Arguments The inal ormat is to encapsulate all o the arguments into one ield in 'I and one HAR15H in the remote host*s nrpe.c g ile. This is how 'I sets up chec!s con igured through the linu#$server and nrpe wiPards, so i you compiled NRPE rom source or the remote host but are using the 'I wiPards to create chec!s, you will have to edit the command directive in the remote host*s nrpe.c g ile.
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page 7
,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page =
,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
I your plugin re4uires another binary on the system that is restricted to root, you will have to create an additional rule .replace */path/to/binary* with the actual path to the re4uired binary2; nagios B77 = -FABGGD<%/path/to/binary
This will allow the user nagios .the user that nrpe runs under2 to run the speci ied plugin as root .through sudo2 without a password. )ou should be very care ul with these settings, as incorrectly con iguring it with lead to "AR1E security vulnerabilities. The inal step is to add %sudo& to the command in the remote host*s nrpe.c g; command[check_raid]=sudo /usr/local/nagios/libexec/check_raid Now restart NRPE and veri y the plugin is wor!ing correctly.
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page 1
,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
I not, change ownership to user/group %nagios& and i# up the permissions; chown nagios%nagios /usr/local/nagios/libexec/check_nrpe chmod u2rwx /usr/local/nagios/libexec/check_nrpe chmod u2rx /usr/local/nagios/libexec/check_nrpe This should be setup by de ault during the 'I install process, but enough people have had the issues that it was worth noting here. Missing Plugin Another cause is a missing plugin ile, though, in order to receive this error, you usually have to also be e#periencing a secondary con iguration issue. In order to resolve issues relating to missing plugins, see the section; %I. Return code o 567 is out o bounds $ plugin may be missing& o this document or possible solutions. The inal cause, and usually the secondary issue or those who ound their plugin missing rom the e#pected location, is an argument usage mismatch between the remote host*s nrpe.c g command directive and the arguments passed by 'I through chec!:nrpe. This was covered in this document under the section; %<. ,+E,9:NRPE; Received = bytes rom daemon. ,hec! the remote server logs or error messages& and the possible solutions can be ound there.
)I+ Error !hile loading shared libraries' libssl+so+5+9+1' cannot open shared obJect file' "o such file or directory
)ou are probably missing the ssl libraries. This is an easy i#, as all you need to do is install openssl rom the host*s distribution repos. Nor e#ample, in ,ent-(/R+E"; yum install openssl )ou can veri y that it installed correctly with; which openssl The output should be similar to; /usr/bin/openssl I you use another distribution other than ,ent-( or R+E", you may need to consult with their orums or run a search with the distribution*s pac!age manager to locate the correct pac!age.
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page 9
,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
"SClient(( "#PE Specific Errors' )I*+ U"?"%W"' "o handler for that command
This is usually caused by a missing or incorrectly spelled handler .e#ternal alias2 in the remote host*s nsclient.ini/nsc.ini. ,hec! the spelling o the chec!:nrpe command or the service chec! in 'I .the name o the command a ter the %$c&2. It should match the spelling o the e#ternal alias in the nsclient con ig. Nor e#ample; [;xternal Blias] alias_cpu=checkCA6 warn=,! crit='! time=#m time=1m time=$!s ...[truncated]... In the e#ample above, the bolded %alias:cpu& is the handler and there ore the service chec! in 'I should speci y the chec!:nrpe command as %alias:cpu&.
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page -5
,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F
"agios Enterprises. //C P+%+ 2o 1-34 Saint Paul. M" 33-51 USA
Page -,opyright E 6=5F Nagios Enterprises, "", Revision 5.= G Darch, 6=5F