NSClient++ Help (#1) - Problem with Network Disk in Windows 2003 Server SP2 (e c:\source\nscp\trunk\include\Socket.h(533) bind failed: 10048) (#68) - Message List

Problem with Network Disk in Windows 2003 Server SP2 (e c:\source\nscp\trunk\include\Socket.h(533) bind failed: 10048)

I have Windows Server 2003 SP2 and NSClient++ 0.2.7. I want monitoring network disk through NRPE handler. This is my config file: [modules] ;# NSCLIENT++ MODULES ;# A list with DLLs to load at startup. ;FileLogger.dll ;CheckSystem.dll CheckDisk.dll ;NSClientListener.dll NRPEListener.dll ;SysTray.dll ;CheckEventLog.dll ;CheckHelpers.dll ; ; CheckWMI IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS! ;CheckWMI.dll ; ; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS! ;RemoteConfiguration.dll

[Settings] ;# OBFUSCATED PASSWORD ; This is the same as the password option but here you can store the password in an obfuscated manner. ; *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the ; password. Its just a bit harder to do it at first glance. ;obfuscated_password=Jw0KAUUdXlAAUwASDAAB ; ;# PASSWORD ; This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly. ;password=secret-password ; ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons. ; If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password). ; The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that subnet access ;allowed_hosts=127.0.0.1/32 ; ;# USE THIS FILE ; Use the INI file as opposed to the registry if this is 0 and the use_reg in the registry is set to 1 ; the registry will be used instead. use_file=1

[log] ;# LOG DEBUG ; Set to 1 if you want debug message printed in the log file (debug messages are always printed to stdout when run with -test) debug=1 ; ;# LOG FILE ; The file to print log statements to file=NSC.log ; ;# LOG DATE MASK ; The format to for the date/time part of the log entry written to file. date_mask=%Y-%m-%d %H:%M:%S

[NSClient] ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon. ; If you leave this blank the global version will be used instead. ;allowed_hosts= ; ;# NSCLIENT PORT NUMBER ; This is the port the NSClientListener.dll will listen to. ;port=12489 ; ;# BIND TO ADDRESS ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. ; Leaving this blank will bind to all avalible IP adresses. ;bind_to_address=

[Check System] ;# CPU BUFFER SIZE ; Can be anything ranging from 1s (for 1 second) to 10w for 10 weeks. Notice that a larger buffer will waste memory ; so don't use a larger buffer then you need (ie. the longest check you do +1). ;CPUBufferSize=1h ; ;# CHECK RESOLUTION ; The resolution to check values (currently only CPU). ; The value is entered in 1/10:th of a second and the default is 10 (which means ones every second) ;CheckResolution?=10

[NRPE] ;# NRPE PORT NUMBER ; This is the port the NRPEListener.dll will listen to. port=5666 ; ;# COMMAND TIMEOUT ; This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off. command_timeout=60 ; ;# COMMAND ARGUMENT PROCESSING ; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed. allow_arguments=2 ; ;# COMMAND ALLOW NASTY META CHARS ; This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments. allow_nasty_meta_chars=0 ; ;# USE SSL SOCKET ; This option controls if SSL should be used on the socket. use_ssl=0 ; ;# BIND TO ADDRESS ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. ; Leaving this blank will bind to all avalible IP adresses. bind_to_address=130.144.216.10 ; ;# ALLOWED HOST ADDRESSES ; This is a comma-delimited list of IP address of hosts that are allowed to talk to NRPE deamon. ; If you leave this blank the global version will be used instead. allowed_hosts=130.144.205.5 ; ;# SCRIPT DIRECTORY ; All files in this directory will become check commands. ; *WARNING* This is undoubtedly dangerous so use with care! ;script_dir=scripts\

[NRPE Handlers] ;# COMMAND DEFINITIONS ;# Command definitions that this daemon will run. ;# Can be either NRPE syntax: ;command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10 ;# Or simplified syntax: ;test=c:\test.bat foo $ARG1$ bar ;check_disk1=/usr/local/nagios/libexec/check_disk -w 5 -c 10 ;# Or even loopback (inject) syntax (to run internal commands) ;# This is a way to run "NSClient" commands and other internal module commands such as check eventlog etc. ;check_cpu=inject checkCPU warn=80 crit=90 5 10 15 ;check_eventlog=inject CheckEventLog Application warn.require.eventType=error warn.require.eventType=warning critical.require.eventType=error critical.exclude.eventType=info truncate=1024 descriptions check_disk_e=inject CheckDriveSize ShowAll MaxWarnUsed?=$Arg1$ FilterType?=REMOTE Drive=e:\ check_disk_c=inject CheckDriveSize ShowAll MaxWarnUsed?=$ARG1$ Drive=c:\ ;# But be careful: ; dont_check=inject dont_check This will "loop forever" so be careful with the inject command... ;# Check some escapings... ; check_escape=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M "File: foo \" WIN=c:
WINDOWS
*.*" ;# Some real world samples ;nrpe_cpu=inject checkCPU warn=80 crit=90 5 10 15 ;nrpe_ok=scripts\ok.bat

This's NSClient in the test mode: C:\client\NSClient++-0.2.7>"NSClient++.exe" /test d .\NSClient++.cpp(305) Loading plugin: CheckDisk... d .\NSClient++.cpp(305) Loading plugin: NRPE server... l .\NSClient++.cpp(109) Using settings from: INI-file l .\NSClient++.cpp(110) Enter command to inject or exit to terminate... e c:\source\nscp\trunk\include\Socket.h(533) bind failed: 10048 d c:\source\nscp\trunk\include\Socket.h(535) Listener is preparing to shutdown..

This's NSClient in debug mode : C:\client\NSClient++-0.2.7>"NSClient++.exe" CheckDisk /debugpdh d .\NSClient++.cpp(305) Loading plugin: CheckDisk... d .\NSClient++.cpp(305) Loading plugin: NRPE server... d .\NSClient++.cpp(231) Found module: CheckDisk... e .\NSClient++.cpp(235) Could not execute command: Module does not support Comma ndLineExec in C:\client\NSClient++-0.2.7\modules\CheckDisk.dll e c:\source\nscp\trunk\include\Socket.h(533) bind failed: 10048 e .\NSClient++.cpp(239) Module not found. d c:\source\nscp\trunk\include\Socket.h(535) Listener is preparing to shutdown.. . d .\NSClient++.cpp(279) Unloading plugin: NRPE server... Thread has not terminated correctly: listenThreadManager... d .\NSClient++.cpp(279) Unloading plugin: CheckDisk...

Why I have the error e c:\source\nscp\trunk\include\Socket.h(533) bind failed: 10048?

Tree View Flat View (newer first) Flat View (older first)
  • Message #152

    first off try using the 0.3.0 version (has better error messages) and in this case: cannot bind is most likely due to the fact that someone else is already using that port.

    Try changing the ports.

    MickeM

  • Message #153

    Install 0.3.0 version, config file same. Result: This's NSClient in debug mode : C:\client\NSClient++-Win32-0.3.0>nsclient++ CheckDisk /debugpdh d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... d \NSClient++.cpp(282) Found module: CheckDisk... e \NSClient++.cpp(286) Could not execute command: Module does not support CommandLineExec? in C:\client\NSClient++-Win32-0.3.0\modules\CheckDisk.dll e \Socket.h(556) bind failed: 10048: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Thread has not terminated correctly: listenThreadManager...

    C:\client\NSClient++-Win32-0.3.0>nsclient++ CheckDisk /listpdh d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... d \NSClient++.cpp(282) Found module: CheckDisk... e \NSClient++.cpp(286) Could not execute command: Module does not support CommandLineExec? in C:\client\NSClient++-Win32-0.3.0\modules\CheckDisk.dll e \Socket.h(556) bind failed: 10048: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Thread has not terminated correctly: listenThreadManager...

    This's NSClient in test mode: C:\client\NSClient++-Win32-0.3.0>nsclient++ /test Launching test mode... d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... l \NSClient++.cpp(123) Using settings from: INI-file e \Socket.h(556) bind failed: 10048:

    If changing port (e.g. This is the port the NRPEListener.dll will listen to. port=5667;)and start 'nsclient++ /test' and no restart service nsclietpp or computer, then working. C:\client\NSClient++-Win32-0.3.0>nsclient++ /test Launching test mode... d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... l \NSClient++.cpp(123) Using settings from: INI-file l \NSClient++.cpp(124) Enter command to inject or exit to terminate... d \Socket.h(538) Bound to: 130.144.216.10:5667

    How to make what worked normally?

  • Message #154

    (just fixing syntax so I can read)

    Install 0.3.0 version, config file same. Result: This's NSClient in debug mode :

    C:\client\NSClient++-Win32-0.3.0>nsclient++ CheckDisk /debugpdh
    d \NSClient++.cpp(375) Loading plugin: CheckDisk...
    d \NSClient++.cpp(375) Loading plugin: File logger...
    d \NSClient++.cpp(375) Loading plugin: NRPE server...
    d \NSClient++.cpp(282) Found module: CheckDisk...
    e \NSClient++.cpp(286) Could not execute command: Module does not support CommandLineExec? in C:\client\NSClient++-Win32-0.3.0\modules\CheckDisk.dll
    e \Socket.h(556) bind failed: 10048: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Thread has not terminated correctly: listenThreadManager...
    
    C:\client\NSClient++-Win32-0.3.0>nsclient++ CheckDisk /listpdh
    d \NSClient++.cpp(375) Loading plugin: CheckDisk...
    d \NSClient++.cpp(375) Loading plugin: File logger...
    d \NSClient++.cpp(375) Loading plugin: NRPE server...
    d \NSClient++.cpp(282) Found module: CheckDisk...
    e \NSClient++.cpp(286) Could not execute command: Module does not support CommandLineExec? in C:\client\NSClient++-Win32-0.3.0\modules\CheckDisk.dll
    e \Socket.h(556) bind failed: 10048: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Thread has not terminated correctly: listenThreadManager...
    

    This's NSClient in test mode:

    C:\client\NSClient++-Win32-0.3.0>nsclient++ /test Launching test mode...
    d \NSClient++.cpp(375) Loading plugin: CheckDisk...
    d \NSClient++.cpp(375) Loading plugin: File logger...
    d \NSClient++.cpp(375) Loading plugin: NRPE server...
    l \NSClient++.cpp(123) Using settings from: INI-file e \Socket.h(556) bind failed: 10048:
    

    If changing port (e.g. This is the port the NRPEListener.dll will listen to. port=5667;)and start 'nsclient++ /test' and no restart service nsclietpp or computer, then working. C:\client\NSClient++-Win32-0.3.0>nsclient++ /test Launching test mode... d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... l \NSClient++.cpp(123) Using settings from: INI-file l \NSClient++.cpp(124) Enter command to inject or exit to terminate... d \Socket.h(538) Bound to: 130.144.216.10:5667

    How to make what worked normally?

  • Message #155

    ahh.. missed a chunk:

    If changing port (e.g. This is the port the NRPEListener.dll will listen to. port=5667;)and start 'nsclient++ /test' and no restart service nsclietpp or computer, then working.

    C:\client\NSClient++-Win32-0.3.0>nsclient++ /test Launching test mode...
    d \NSClient++.cpp(375) Loading plugin: CheckDisk...
    d \NSClient++.cpp(375) Loading plugin: File logger...
    d \NSClient++.cpp(375) Loading plugin: NRPE server...
    l \NSClient++.cpp(123) Using settings from: INI-file
    l \NSClient++.cpp(124) Enter command to inject or exit to terminate... d \Socket.h(538) Bound to: 130.144.216.10:5667
    
  • Message #156

    Well, first off it should *not* crash... that is a bug, I shall investigate!

    Secondly, as I understand it what you want to know is "how do I use the normal port"? And ports (in TCP/IP) work like so: the first who opens a port "owns" that port (until it is closed) so if someone else is using 5666 then you need to either use another port or figure who is using that port and make sure "it" uses another port. There is no way two program can coexist on the same port.

    Worth noticing is that if you have two instance of nsclient++ running at the same time they will also "fail" to use the "same port" so it could be that the service is running and you are trying to run it in test mode.

    MickeM

  • Message #157

    Install 0.3.0 version, config file same. Result: This's NSClient in debug mode : C:\client\NSClient++-Win32-0.3.0>nsclient++ CheckDisk /debugpdh d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... d \NSClient++.cpp(282) Found module: CheckDisk... e \NSClient++.cpp(286) Could not execute command: Module does not support CommandLineExec? in C:\client\NSClient++-Win32-0.3.0\modules\CheckDisk.dll e \Socket.h(556) bind failed: 10048: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Thread has not terminated correctly: listenThreadManager...

    C:\client\NSClient++-Win32-0.3.0>nsclient++ CheckDisk /listpdh d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... d \NSClient++.cpp(282) Found module: CheckDisk... e \NSClient++.cpp(286) Could not execute command: Module does not support CommandLineExec? in C:\client\NSClient++-Win32-0.3.0\modules\CheckDisk.dll e \Socket.h(556) bind failed: 10048: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Thread has not terminated correctly: listenThreadManager...

    This's NSClient in test mode: C:\client\NSClient++-Win32-0.3.0>nsclient++ /test Launching test mode... d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... l \NSClient++.cpp(123) Using settings from: INI-file e \Socket.h(556) bind failed: 10048:

    If changing port (e.g. This is the port the NRPEListener.dll will listen to. port=5667;)and start 'nsclient++ /test' and no restart service nsclietpp or computer, then working. C:\client\NSClient++-Win32-0.3.0>nsclient++ /test Launching test mode... d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... l \NSClient++.cpp(123) Using settings from: INI-file l \NSClient++.cpp(124) Enter command to inject or exit to terminate... d \Socket.h(538) Bound to: 130.144.216.10:5667

    How to make what worked normally?

  • Message #158

    Excuse me for my bad English, I badly speak on English.

    I take a configuration file same as in the first post, only ....[NRPE] port=5667;... Then I restart service nsclietpp. Then I change port on 5666 in config file, save file, no restart service and start command 'nsclient++ /test'. So works.

    C:\client\NSClient++-Win32-0.3.0>nsclient++ CheckDisk /listpdh d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... d \NSClient++.cpp(282) Found module: CheckDisk... e \NSClient++.cpp(286) Could not execute command: Module does not support CommandLineExec? in C:\client\NSClient++-Win32-0.3.0\modules\CheckDisk.dll d \Socket.h(538) Bound to: 130.144.216.10:5666 d \NSClient++.cpp(349) Unloading plugin: NRPE server... d \Socket.h(558) Listener is preparing to shutdown... d \NSClient++.cpp(349) Unloading plugin: File logger... d \NSClient++.cpp(349) Unloading plugin: CheckDisk...

    C:\client\NSClient++-Win32-0.3.0>nsclient++ CheckDisk /debugpdh d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... d \NSClient++.cpp(282) Found module: CheckDisk... e \NSClient++.cpp(286) Could not execute command: Module does not support CommandLineExec? in C:\client\NSClient++-Win32-0.3.0\modules\CheckDisk.dll d \Socket.h(538) Bound to: 130.144.216.10:5666 d \NSClient++.cpp(349) Unloading plugin: NRPE server... d \Socket.h(558) Listener is preparing to shutdown... d \NSClient++.cpp(349) Unloading plugin: File logger... d \NSClient++.cpp(349) Unloading plugin: CheckDisk...

    C:\client\NSClient++-Win32-0.3.0>nsclient++ /test Launching test mode... d \NSClient++.cpp(375) Loading plugin: CheckDisk... d \NSClient++.cpp(375) Loading plugin: File logger... d \NSClient++.cpp(375) Loading plugin: NRPE server... l \NSClient++.cpp(123) Using settings from: INI-file l \NSClient++.cpp(124) Enter command to inject or exit to terminate... d \Socket.h(538) Bound to: 130.144.216.10:5666 d \NSClient++.cpp(440) Injecting: check_disk_c: 50% d \NSClient++.cpp(440) Injecting: CheckDriveSize: ShowAll, MinWarnUsed?=$ARG1$, Drive=c:\ d \checkHelpers.hpp(700) Missing bounds for maxmin-bounds check: c:\ d \NSClient++.cpp(460) Injected Result: OK 'OK: c:\: 4.52G' d \NSClient++.cpp(461) Injected Performance Result: d \NSClient++.cpp(460) Injected Result: OK 'OK: c:\: 4.52G' d \NSClient++.cpp(461) Injected Performance Result: d \NSClient++.cpp(440) Injecting: check_disk_e: 80% d \NSClient++.cpp(440) Injecting: CheckDriveSize: ShowAll, MaxWarnUsed?=$Arg1$, FilterType?=REMOTE, Drive=e:\ d \checkHelpers.hpp(700) Missing bounds for maxmin-bounds check: e:\ d \NSClient++.cpp(460) Injected Result: WARNING 'WARNING: e:\: Total: 9.77G - Used: 4.98G (50%) - Free: 4.79G (50%) > warning' d \NSClient++.cpp(461) Injected Performance Result: d \NSClient++.cpp(460) Injected Result: WARNING 'WARNING: e:\: Total: 9.77G - Used: 4.98G (50%) - Free: 4.79G (50%) > warning' d \NSClient++.cpp(461) Injected Performance Result: d \NSClient++.cpp(440) Injecting: check_disk_c: 50% d \NSClient++.cpp(440) Injecting: CheckDriveSize: ShowAll, MinWarnUsed?=$ARG1$, Drive=c:\ d \checkHelpers.hpp(700) Missing bounds for maxmin-bounds check: c:\ d \NSClient++.cpp(460) Injected Result: OK 'OK: c:\: 4.52G' d \NSClient++.cpp(461) Injected Performance Result: d \NSClient++.cpp(460) Injected Result: OK 'OK: c:\: 4.52G' d \NSClient++.cpp(461) Injected Performance Result:

    But if to restart service there will be a error d \Socket.h(538) Bound to: 130.144.216.10:5666.

  • Message #159

    well... nsclient++ /test and "staring the service" does the same (they both start the service) so you can (should) not run nsclient++ /test when the service is started.

    So if you have the service set to auto-start before you do nsclient++ /test do a nsclient++ /stop ie:

    boot-computer
    nsclient++ /stop
    nsclient++ /test
    ... test ghings ...
    ... exit ...
    nsclient++ /start
    

    if you do:

    nsclient++ /start
    nsclient++ /test
    

    you will get "bind errors" as you now have two "instances" started at the same time...

    MickeM

  • Message #160

    I have understood, thanks. I a fool. Pleas help me yet. If I do nsclient++ /stop

    nsclient++ /test

    in Nagios: Service Status Last Check Duration Attempt Status Information disk_C OK 12-07-2007 15:39:26 0d 0h 19m 7s 1/4 OK: c:\: 4.52G disk_e OK 12-07-2007 15:35:26 0d 0h 16m 7s 1/4 WARNING 12-07-2007 15:36:12 0d 0h 11m 21s 4/4 WARNING: e:\: Total: 9.77G - Used: 4.99G (51%) - Free: 4.78G (49%) > warning

    If I do

    nsclient++ /stop nsclient++ /start

    in Nagios: Service Status Last Check Duration Attempt Status Information disk_C OK 12-07-2007 15:39:26 0d 0h 19m 7s 1/4 OK: c:\: 4.52G disk_e UNKNOWN 12-07-2007 15:42:12 0d 0h 0m 20s 4/4 UNKNOWN: Drive does not match the current filter: e:\ (it is a no_root drive)

    Network disk defined as the unknown. Why? Config file in first post.

  • Message #161

    what kind of drive is e: ? One other person have had "such" problems with a network drive.

    The error indicates the drive has the wrong tyme, so if it is a network drivbe check that it is still connected. if it islet me know and I shall look into it.

    MickeM

  • Message #162

    Drive e: is a shared disk on the other computer with Windows XP.

  • Message #165

    MickeM, How to solve this problem, if this is possible???

  • Message #166

    I have not been able to get the problems here...

    If the problem is just the type you can always set the type to match the one you "miss", by default it just checks for "FIXED" drives so if you want to check network drives you need to add FilterType?=REMOTE.

    MickeM

  • Message #167

    the strange thing is you get a DRIVE_NO_ROOT_DIR type... so might wanna try to add FilterType?=DRIVE_NO_ROOT_DIR as well.. but that one should be in the default

  • Message #500

    Hi mickem, i have the same problem like Denis Nikitin. I use NSClient++ ver. 0.3.2,

    my check: check_disk_z=inject CheckDriveSize ShowAll=long FilterType?=REMOTE MinWarnfree?=10% MinCritFree?=5% Drive=Z:\

    when i use 'nsclient++ /test' - debug mode everything is ok, i get response OK

    but when i use 'nsclient++ /start' - normal mode, i get response: UNKNOWN: Drive does not match the current filter: Z:\ (it is a no_root drive)

    disk Z is network disk, do you have solution for this problem now ?

    misza

  • Message #501

    is the drive connected to your profile? When in /test you run as you when as a service you run as the user connected to the service so the resources need not bee the same...

Tree View Flat View (newer first) Flat View (older first)

Subscriptions