I have a LB issue which I back-burnered so I can understand a bit more on NRPE, so I am testing against a single public IP with ALL ports open to the nagios server. The client has the nagios-nrpe-server binary installed, but NOT the nagios-nrpe-plugins. When I looked at installing that via apt-get, the dependencies were HUGE, including apache, nagios3, mailx, etc. (it seems that installs the whole nagios server).
From the server I can issue;
/usr/lib/nagios/plugins/check_nrpe -H <host-ip>
NRPE v2.12
on the client I see;
Jul 26 23:33:23 notices nrpe[3484]: Connection from <server-ip> port 24478
Jul 26 23:33:23 notices nrpe[3484]: Host address is in allowed_hosts
Jul 26 23:33:23 notices nrpe[3484]: Handling the connection...
Jul 26 23:33:23 notices nrpe[3484]: Host is asking for command '_NRPE_CHECK' to be run...
Jul 26 23:33:23 notices nrpe[3484]: Response: NRPE v2.12
Jul 26 23:33:23 notices nrpe[3484]: Return Code: 0, Output: NRPE v2.12
If I try to issue a cli check, I get command line arg's are not allowed (which I can see is an option when compiling, but also insecure). So I don't really need it, just need to see why I get that error. I currently have the linux box running one service test;
I have the following;
define service{
use generic-service
host_name server-name
service_description CPU Load
check_command check_nrpe!check_load
}
and I see on the client when I restated the server;
Jul 26 23:29:45 notices nrpe[3420]: Added command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
Lastly, on the client machine, if I switch user to nagios and run the command locally I get;
./check_load -w 15,10,5 -c 30,25,20
OK - load average: 0.07, 0.03, 0.01|load1=0.070;15.000;30.000;0; load5=0.030;10.000;25.000;0; load15=0.010;5.000;20.000;0;
the client nrpe is running as nagios user, and he owns the /usr/lib/nagios folder. I am not sure if it's permissions, something not installed, but I am learning a lot through this journey
Thanks for any help on this one or let me know if I am not providing something else!