with some help I have things almost done, but one thing is still failing and not sure where to look. I have the client linux server running NRPE on the default 5666 port. I will be running checks against numerous webservers behind a loadbalancer with one public IP so the port will dictate which server to test.
So my host and service looks like this;
define host{
use linux-remote
host_name WS1
address 1.1.1.1
_tcport 5667
}
define service{
use generic-service,srv-pnp
host_name WS1
service_description Server Load
check_command check_nrpe!check_load
}
That service is stuck at critical, and I don't see anything on the client side (as if it's not getting there). When I run the check from the server to the client it works from the command line, here is the server check and client syslog entry;
Server
/usr/lib/nagios/plugins/check_nrpe -H n.WS1.domain.com -p 5667 -c check_load
OK - load average: 0.48, 0.51, 0.30|load1=0.480;15.000;30.000;0; load5=0.510;10.000;25.000;0; load15=0.300;5.000;20.000;0;
Client
Aug 6 16:01:12 WS1 nrpe[6952]: Running command: /usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
Aug 6 16:01:12 WS1 nrpe[6952]: Command completed with return code 0 and output: OK - load average: 0.92, 0.50, 0.33|load1=0.920;15.000;30.000;0; load5=0.500;10.000;25.000;0; load15=0.330;5.000;20.000;0;
Aug 6 16:01:12WS1 nrpe[6952]: Return Code: 0, Output: OK - load average: 0.92, 0.50, 0.33|load1=0.920;15.000;30.000;0; load5=0.500;10.000;25.000;0; load15=0.330;5.000;20.000;0;
I had some help with the _tcp entry, the PING OK works, but I am sure that's just hitting the loadbalancer. I did also test by having the nrpe-client listen on 5667, told the loadbalancer to forward to that port and had the same results, both at the GUI server level (critical) as well as command line test (passed and worked).
Any help or ideas are appreciated.
remote NRPE help on different port
Re: remote NRPE help on different port
Are you able to post up your command definition for check_nrpe as well? From commands.cfg
Re: remote NRPE help on different port
If this get's working, I will post anything you want, well, almost anythingAre you able to post up your command definition for check_nrpe as well? From commands.cfg
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Not sure if that helps, but there it is .... thanks
Re: remote NRPE help on different port
Thankfully I don't think I will require you to post anything else
I don't think I explained my previous solution particularly well, you should probably duplicate check_nrpe and have it look something like this:
In a service or host definition you can add an underscore to any string that you want and Nagios will turn them into "macros" that you can access by telling it what object the macro is attached to and what it's called. So _tcport 5668 and _Iloveunicorns 5668 are the same thing it's just you would use $_HOSTILOVEUNICORNS$ to access the value instead.
I strongly recommend reading the macros documentation, you can do some good stuff with it: http://nagios.sourceforge.net/docs/3_0/ ... tvars.html and http://nagios.sourceforge.net/docs/3_0/macros.html
I don't think I explained my previous solution particularly well, you should probably duplicate check_nrpe and have it look something like this:
Code: Select all
define command{
command_name check_nrpe_lb
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -p $_HOSTTCPORT$
}
define host{
use linux-remote
host_name WS1
address 1.1.1.1
_tcport 5667
}
define service{
use generic-service,srv-pnp
host_name WS1
service_description Server Load
check_command check_nrpe_lb!check_load
}
I strongly recommend reading the macros documentation, you can do some good stuff with it: http://nagios.sourceforge.net/docs/3_0/ ... tvars.html and http://nagios.sourceforge.net/docs/3_0/macros.html
Re: remote NRPE help on different port
HA! Thanks for the laugh. I looked at the sample and (don't answer yet) don't want a service for each port (which is why I wanted just to say, hey anytime this host does something, use this port, as then I would need a special service as well for each, but, things are nice and quiet now so I am going to sit and read up on the macro's URL and report back tomorrow with an update!
Thanks again.
Thanks again.
[solved] Re: remote NRPE help on different port
Worked perfect. I am still understanding (or trying to) how the use feature works, as some templates are called from one place, others another place, etc .but have no fear, more questions to come 
Tnx again.
Tnx again.
Re: remote NRPE help on different port
Macros are definitely one of the harder features to get your head around when you're still learning Nagios, glad that helped!