How do I change the NRPE port on a monitored Windows server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lonnie.thomas
Posts: 18
Joined: Wed Mar 30, 2011 7:44 am

How do I change the NRPE port on a monitored Windows server

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How do I change the NRPE port on a monitored Windows ser

Post 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

Code: Select all

NRPEListener.dll
making it

Code: Select all

;NRPEListener.dll
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
lonnie.thomas
Posts: 18
Joined: Wed Mar 30, 2011 7:44 am

Re: How do I change the NRPE port on a monitored Windows ser

Post 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.
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: How do I change the NRPE port on a monitored Windows ser

Post 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.
lonnie.thomas
Posts: 18
Joined: Wed Mar 30, 2011 7:44 am

Re: How do I change the NRPE port on a monitored Windows ser

Post 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.
Locked