Opened 6 years ago

Closed 5 years ago

#97 closed defect (fixed)

Big memory Leak

Reported by: Tony Owned by: mickem
Priority: 1 Milestone: 0.3.2
Component: None Version: 0.3.1
Severity: Bugs Keywords:
Cc:

Description

We are using NSClient++-Win32-20070925-0646 to check CPU Load and Service state.

It run fine but we have a huge memory with Windows 2003/SP1 US system NSC Ini cpu config is by default in NSC.INI.

For example on a 4 way SMP system, memory size of NSClient++ is 120 Mo physycal / 120 Mo virtual.... ! (same in a 1 way system is 32 mo physical / 32 Mo virtual).

I think the problem come from cpubuffer...

Thank you for providing us a solution.

Best regards

Attachments (1)

NSC.ini (5.9 KB) - added by anonymous 6 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 6 years ago by mickem

  • Status changed from new to assigned

could you past the config entrys for the [System] section? (the memory used for the CPU buffer is configurable, but I think that 120Mb is a very very big buffer so sounds strange, probably something else might be broken)

MickeM

Changed 6 years ago by anonymous

comment:2 Changed 6 years ago by Tony

I have just attached my NSC.ini.

The probleme happen even if I nagios don't call the service and if I comment everything in the CP section. It happen just if I uncomment the CheckSystem.dll.

For your information the windows server 2003 / SP1 is a VM running on ESX Server 3.0.1...may be it is related ?

Thank you for help.

comment:3 Changed 6 years ago by mickem

Humm,
I have now checked, I did not get any such issues on my "test bed" a VPS with 2k3 sp1 server.

If you want I could add some debug output to a build and let you try that?
But apart from that I don't really know how to help you diagnose the error :(

MickeM

comment:4 Changed 6 years ago by mickem

  • Milestone changed from 0.3.0 to 0.4.0

bump this to 0.4.0 unless someone else can report this and/or get me some more info. I dont get this problem here :(

comment:5 Changed 5 years ago by domblume@…

Hello,
have the same memory-leak problem.... after some days... usually 5-6 days,
the client crashes after taken about 800-900 megs of physical memory...

worked around with a batchfile, running once a day, which restarts the client...

please.... fix the leak ...

all machines W2K3.... some with SP1, some with SP2...

thx

comment:6 Changed 5 years ago by anonymous

What kind of checks do you run on the client and what protocol do you use?

MickeM

comment:7 Changed 5 years ago by anonymous

Hi
sorry for answering late.

The client checks cpu-load, memory-usage, existance of tasks, nt-services (if they run), drive-space, and so on and on...

Will play around with one of my servers by only checking one thing after the other.

What do you mean by "what protocol do you use" ?

thx
Andreas

comment:8 Changed 5 years ago by anonymous

There are currently two protocols:
NRPE and NSClient (ie. check_nt or check_nrpe)

But given your checks my guess is NSClient and check_nt.

MickeM

comment:9 Changed 5 years ago by anonymous

yes - it's nsclient and check_nt...

comment:10 Changed 5 years ago by sebastien.douce@…

  • Component changed from CheckSystem to None
  • testcase_result changed from pass to fail
  • Version set to 0.3.1

Hi ,
Same problem here . Many servers supervised are using between 200Mo and 1go .

All this servers are under WIN2K3. We can see that the memory used is increased of 256Ko per minute.
Restart of nsclient++ service refresh memory to 8Mo.

Sorry for my english .

comment:11 Changed 5 years ago by anonymous

Hello.

I need config file and what checks are run and how to be able to debug this issue, could you please submit those details?

MickeM

comment:12 follow-up: Changed 5 years ago by samuraipenguin

I'm using similar checks to the above. cpu load, memory use, disk space, and a few NT services. I've attatched SP_NSC.ini to the bug report as well.

comment:13 in reply to: ↑ 12 Changed 5 years ago by anonymous

Replying to samuraipenguin:

I'm using similar checks to the above. cpu load, memory use, disk space, and a few NT services. I've attatched SP_NSC.ini to the bug report as well.

Actually, it's being marked as spam so I can't post it. I can email it if it's useful... catdevrandom@… -- fix the domain part :D

comment:14 Changed 5 years ago by mickem

samuraipenguin:s post

NSC.ini from server with 250MB memory usage

SP-NSC.ini

[modules]
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
;  You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; *                                                               *
; * N O T I C E ! ! ! - Y O U   H A V E   T O   E D I T   T H I S *
; *                                                               *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll
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=
;
;# 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=xxx.xxx.xx.x/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=
;
;# SOCKET TIMEOUT
;  Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.
;socket_timeout=30


[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
;
;# CHECK ALL SERVICES
;  Configure how to check services when a CheckAll is performed.
;  ...=started means services in that class *has* to be running.
;  ...=stopped means services in that class has to be stopped.
;  ...=ignored means services in this class will be ignored.
;check_all_services[SERVICE_BOOT_START]=ignored
;check_all_services[SERVICE_SYSTEM_START]=ignored
;check_all_services[SERVICE_AUTO_START]=started
;check_all_services[SERVICE_DEMAND_START]=ignored
;check_all_services[SERVICE_DISABLED]=stopped


[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=0
;
;# 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=1
;
;# 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=
;
;# 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=
;
;# SCRIPT DIRECTORY
;  All files in this directory will become check commands.
;  *WARNING* This is undoubtedly dangerous so use with care!
;script_dir=scripts\
;
;# SOCKET TIMEOUT
;  Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.
;socket_timeout=30



[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_c=inject CheckFileSize ShowAll MaxWarn=1024M MaxCrit=4096M File:WIN=c:\ATI\*.*
;# 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
;check_multi_line=scripts\multi_line.bat
;#
;# The sample scripts
;#
;check_long=scripts\long.bat
;check_ok=scripts\ok.bat
;check_nok=scripts\xlong.bat
;check_vbs=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs


; [includes]
;# The order when used is "reversed" thus the last included file will be "first"
;# Included files can include other files (be carefull only do basic recursive checking)
;
; myotherfile.ini
; real.ini

comment:15 Changed 5 years ago by samuraipenguin

comment:16 Changed 5 years ago by mickem

  • Milestone changed from 0.4.0 to 0.3.2
  • Resolution set to fixed
  • Status changed from assigned to closed

this has (i thhink) been fixed in the latest 0.3.2

Note: See TracTickets for help on using tickets.