Page 1 of 1
How do I change the NRPE port on a monitored Windows server
Posted: Tue Feb 28, 2012 2:03 pm
by lonnie.thomas
My company produces software that utilizes port 5666. In most cases, this does not interfere with our monitoring, but in a few, Nagios prevents our software from listening properly. We've decided to alter the port being use by Nagios to 15666 to eliminate the problem. I've found instructions for making this change on the Nagios server and a Linux client. Using those, I hoped I could figure out how to make the change in Windows. To test my theory, I chose to leave the Nagios XI server as is and change the client settings, hoping to see an alert, as the server should not be able to communicate with the client. I tried to affect the change on a Windows client by modifying the NSC.ini file. I stopped and restarted the NSClient++ service, pushed an immediate check, and discovered that the check came back green.
First, is my assumption correct that a change in the port on the client should return a "connection refused" or some other error?
Second, is there another config file on my Windows server that needs to be change?
Any guidance would be greatly appreciated.
Thank you.
Re: How do I change the NRPE port on a monitored Windows ser
Posted: Tue Feb 28, 2012 2:31 pm
by scottwilkerson
What check command did you use?
The NSClient++ can use both check_nrpe (normal port 5666) and check_nt (normal port 12489)
It is possible you may not even be using NRPE for the windows boxes, if this is the case you could just comment out the line
making it
Re: How do I change the NRPE port on a monitored Windows ser
Posted: Tue Feb 28, 2012 3:47 pm
by lonnie.thomas
Thank you. It looks like we're using port 12489, after checking the service command. I know that the NSClient++ is causing our port 5666 problem, because as soon as we kill the service, our other software works just fine. I guess my next question would be, if I change the 5666 entries in the NSC.ini file on my monitored Windows server, to anything else, will that prevent Nagios from working properly and free up port 5666 on the server? I ran a test of this on one server and it appeared to be fine. Active Ports does not see Nagios listening on that port, but I want to make sure there isn't something else I'd need to change.
Thanks.
Re: How do I change the NRPE port on a monitored Windows ser
Posted: Tue Feb 28, 2012 4:08 pm
by yancy
give it a test by passing the port number to check_nrpe
/usr/local/nagios/libexec/check_nrpe -H 192.168.5.104 5666
I (0.3.9.327 2011-08-16) seem to be doing fine...
Notice the last argument is the port number.
Re: How do I change the NRPE port on a monitored Windows ser
Posted: Tue Feb 28, 2012 4:29 pm
by lonnie.thomas
Awesome. Thanks. Test returned a "Connection refused or timed out" and I threw a different IP in, one that still has 5666 in the ini file and it gave me the "seem to be doing fine..." reply.
Thanks for your help.