NSClient is running but nagios cannot query the Windows 2003 / Exchange 2003 host

James McDonald james at jamesmcdonald.id.au
Thu Sep 23 15:13:24 CEST 2004


Hi Nagios List this is a problem / cause /resolution fix for a small 
nsclient problem I had... Hopefully it will help someone .... give and 
ye shall receive...

Problem:
    NSClient is installed and running but Nagios cannot query the 
Windows 2003 Server Running Microsoft Exchange 2003

Symptoms:
    NSClient starts but fails to bind to the default port 2148 on a 
Windows 2003 Server with MS Exchange 2003. An error shows up in the 
event log.

Event Type:     Error
Event Source:   NSClient
Event Category: None
Event ID:       2
Date:           21/09/2004
Time:           5:28:39 PM
User:           N/A
Computer:       SERVERNAME
Description:
Windows socket error: Only one usage of each socket address 
(protocol/network address/port) is normally permitted (10048), on API 'bind'


Cause:
    NSClients default Port 1248 is being used by Exchange' dynamic port 
mapper for something and the NSClient can't bind

More Information:
    To check to see if this the problem do the following

from a command prompt run

H:\>netstat | find "1248"
  TCP    servername:691        servername.mydomain.local:1248  ESTABLISHED
  TCP    servername:1248       servername.mydomain.local:691  ESTABLISHED

You will find that port 1248 is already being used as shown above.

Resolution:

    Using netstat find an unused port. I chose 6244 (because it spells 
nagi when using a touch pad phone)
   
    Stop the nsclient service by runing net stop nsclient

    Edit the HKEY_LOCAL_MACHINE\SOFTWARE\NSClient\Params\Port value to 
be a decimal value of whatever port you choose (In my case 6244).

    Start the nsclient service again 'net start nsclient'

On the nagios machine edit the nagios checkcommand.cfg file to include 
the new port. You can do this by hand editing each instance or just 
doing the following which will replace each instance with the new figure

    # make a backup!
    cp /etc/nagios/checkcommands.cfg /etc/nagios/checkcommands.cfg.orig
    cp /etc/nagios/checkcommands.cfg /tmp
    cat /tmp/checkcommands.cfg | sed -e s/1248/6244/g > 
/etc/nagios/checkcommands.cfg

restart your nagios service


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list