Pnsclient + ports questions, comments

OK - so I have been running Nagios for some time now very successfully monitoring various m$ servers, routers, etc. Setting up was a bit of a bear to get going, but I beat the configs into submission and they finally started being more friendly :).

ANYWAY: Here’s my latest adventure-

So we have a server running windows server 2000 which we recently had to reboot. When it came back online Nagios decided that it no longer wanted to monitor any of the services that were being checked via pnsclient, however it was still watching for DNS and actual ping.

Seemed a bit odd at first but I quickly realized all of the things that were no longer working were all things that were being watched via pnsclient. A bit more digging later I find that port 1248 (default port for pnsclient) has been taken over by LDAP on the server before the pnsclient could launch.

So I’m ok to change the port for pnsclient but that would require doing it on all of the machines I monitor (shudder), or making another custom check plugin specific to this server that used a higher port.

Question time:

Is there a way for me to get the server to let go of port 1248 and reserve it for pnsclient?

If so, how and what would be the consequences of doing so being that LDAP is whats currently using it?

*To quote my buddy whom I asked about this “NO, you can not ever ever change the port that LDAP uses, that will make your servers stop authenticating” - True?

Any thoughts, feedback welcome. I am just trying to keep this simple and prevent it from happening in the future.

ADVICE TO THE NAGIOS NOOBS: If/when you decide to use any of the remote plugins that use check_nt for disk, services, etc, be sure to make the port it operates on above 5000 so windows does not try to jack with it.

-Jimi

PS- Big thanks to Evert and all the Nagios gurus around here who have been so mega helpful int he past.

Random thought that would make my life easier: Does anyone know where the pnsclient stores the port information once configured to run as a service? Is it a registry entry or a config file?

Think I found it myself, that or I just really like responding to my own post. I will post the solution once I see for sure that it works.

Well, unfortunately the port switch did not fix my problem. I did figure out a pretty kewl trick should anyone ever feel the need to change the port pnsclient talks on on a bunch of servers with the least amount of hassle:


Kill Nagios and change the plugins using port information to the new port number you decide on.
(mine are in /usr/local/nagios/etc/checkcommands.cfg)

pnsclient stores the config information in the registry under this registry entry: HKEY_LOCAL_MACHINE/SOFTWARE/NSClient/Params

The value for port is called, well… port :wink:

This value is in hex, but if you change it to decimal, enter a new port, then change it back to hex it works peachy.

At this point you can export a registry value for that specific key to whatever.reg (preferably on a network share you can see from all the servers needing to be changed)

Then you RDC (or vnc, whatever) from server to server that needs to be changed, merge the key then restart the service.

Restart Nagios and voila - new port in effect.

Hope this helps someone else out.

Anyway, my problem remains. Now it seems that the new port I picked (54321) does not even show up on a netstat on the server in question. I changed the port on a whole bunch of servers tho and nagios picked them right back up…

Suggestions?

Suggestion? Yea, install snmpd on the remote machines, and use check_snmp on the nagios machine. I know nothing of these other clients/daemons like nsclient.
Perhaps you don’t have the port defined in /etc/services

Hmm. Well the thing that gets me is it works on all the other machines. Has been working on this one till the last reboot. SNMP is something im still trying to wrap my brain around. So for the time being, this plugin was working just fine.