ConSol-Monitoring / snclient

SNClient+ - Cross platform monitoring agent
MIT License
47 stars 9 forks source link

Memory Consumption #117

Closed jeff8688 closed 2 months ago

jeff8688 commented 2 months ago

Hi,

I am seeing an constant increase in memory consumption on our Windows servers when I use snclient+ instead of nsclient++. I am surprised that no one else seems to have encountered this problem. Could it be related to a configuration in the ini?

I am testing the latest version.

Thank you in advance.

Best regards,

Jeff

sni commented 2 months ago

which windows version is that?

jeff8688 commented 2 months ago

Windows Server 2022 standard

jeff8688 commented 2 months ago

memory

pyves007 commented 2 months ago

After restarting the snclient service : image The memory was increasing also with previous versions, the version in place was 0.22, let's see with the version 0.23.

sni commented 2 months ago

i can see this with windows 11 as well, i bet it is connected to some wmi queries...

jeff8688 commented 2 months ago

we checks use the following checks. Nothing special.

FranckSallet commented 2 months ago

Hi

I have the same behavior on Windows 2016:

before service restart: snclient_before

after: snclient_after

Gent00157 commented 2 months ago

BTW: I do not see any problem with snclient version 0.20.0 (64bit) with NRPE checks - I have 100+ Windows servers (2012-2022) and snclient using ~100MB memory, uptime more than 1 month (using only standard checks, not any wmi).

pyves007 commented 2 months ago

Hello @Gent00157 , thnaks for your experience. could you list the checks used by snclient ? May i ask you also your snclient.ini (anonymized) then we can compare what options are activated or not. Thanks in advance, Pyves

sni commented 2 months ago

that would be helpful, but some windows checks also use wmi internally. Altough i think the leak is in the generic check_wmi, not in the others which use wmi internally. They use different libraries internally because the check_wmi cannot use fixed known objects.

Gent00157 commented 2 months ago

Hi, sure, you can find my .ini bellow used on most of the servers. I am using external command (and powershell wrapper) for networking, because I get some strange behavior with NSclient++ in past - it is not related to snclient. Also notice, that I wrap powershell scripts old way and AFAIK there is a better/cleaner way how to call it with snclient using [/settings/external scripts/wrappings]. As noted above, I am using "old" 0.20.0 (64bit) version, so it seems to be memory leak somewhere in newer version. (and btw I use ssh and nrpe on linux, not snclient).

[/paths]
exe-path =
shared-path =
scripts = ${shared-path}/scripts
certificate-path = ${shared-path}/ssl

[/modules]
NRPEServer = enabled
CheckSystem = enabled
CheckDisk = enabled
CheckExternalScripts = enabled
WEBServer = disabled
WEBAdminServer = disabled
PrometheusServer = disabled
NodeExporterServer = disabled
WindowsExporterServer = disabled
ExporterExporterServer = disabled
ManagedExporterServer = disabled
CheckBuiltinPlugins = disabled
CheckSystemUnix = disabled
CheckWMI = disabled

[/settings/default]
allowed hosts = 192.168.1.1
cache allowed hosts = true
timeout = 30
bind to =
tls min version = tls1.3
nasty characters = $|`&><'\"\"'\\[]{}
use ssl = true
certificate = ${certificate-path}/server.crt
certificate key = ${certificate-path}/server.key
client certificates = ${certificate-path}/ca.pem
password =

[/settings/NRPE/server]
insecure = false
allow nasty characters = false
port = 5666
allow arguments = false
use ssl = enabled

[/settings/external scripts]
timeout = 60
allow nasty characters = false
allow arguments = false
script root = ${scripts}
script path =
ignore perfdata = no

[/settings/external scripts/wrappings]
ps1 = powershell.exe -ExecutionPolicy Bypass -File %SCRIPT% %ARGS%

[/settings/external scripts/alias]
alias_cpu = check_cpu "warn=load > 90" "crit=load > 95"
alias_mem = check_memory "warn=used > 90%" "crit=used > 95%" "type=physical" "perf-config=*(unit:B)"
alias_uptime = check_uptime "warn=uptime<2m" "crit=uptime<1m"
alias_disk = check_drivesize "warn=free<10%" "crit=free<5%" "perf-config=*(unit:B)" drive=c:
alias_shared_disk = check_drivesize "warn=free<10%" "crit=free<5%" "perf-config=*(unit:B)" drive=f: drive=g: drive=h: drive=i:
alias_services = check_service "service=LanmanServer" "service=ClusSvc"

[/settings/external scripts/scripts]
alias_net = cmd /c echo scripts\net.ps1 "NIC1,NIC2,NIC3,NIC4,TEAM1"; exit($lastexitcode) | powershell.exe -command -
alias_wupdate = cmd /c echo scripts\wupdate.ps1; exit($lastexitcode) | powershell.exe -command -

[/settings/log]
file name = ${shared-path}/snclient.log
level = info

[/settings/log/file]
max size = 20MiB

[/settings/updates]
automatic updates = disabled
automatic restart = disabled
sni commented 2 months ago

found something in the windows check_service and check_drivesize, could you try the latest builds to see if it helped?

sni commented 2 months ago

image

I'd say it looks a bit better, but it's too early to finally say it's gone. I'll keep it open until we know...

FranckSallet commented 2 months ago

the problem seems not to be resolved in the release 0.23 snclient_before

snclient_after

sni commented 2 months ago

right, i haven't made a release yet, i was talking about the v0.23.0034 nightly build. In my tests it still seems to grow, but not as bad as before.

jeff8688 commented 2 months ago

We are going to test it next week @pyves007

Thank you very much

sni commented 2 months ago

i can still reproduce a leak when using check_drivesize. I'll let you know when it's fixed.

sni commented 2 months ago

image

Could you try the latest nightly ( >= 0.23.0041 ) now, it looks promising...

jeff8688 commented 1 month ago

Hi,

thank you for your help. Will you create a new release?

Best regards,

Jeff


Von: Sven Nierlein @.> Gesendet: Montag, 20. Mai 2024 18:22 An: ConSol-Monitoring/snclient @.> Cc: jeff8688 @.>; Author @.> Betreff: Re: [ConSol-Monitoring/snclient] Memory Consumption (Issue #117)

Closed #117https://github.com/ConSol-Monitoring/snclient/issues/117 as completed.

— Reply to this email directly, view it on GitHubhttps://github.com/ConSol-Monitoring/snclient/issues/117#event-12868412941, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2TG4NMOZCOQJI6QFTAK6T3ZDIPMLAVCNFSM6AAAAABHDRNIGKVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJSHA3DQNBRGI4TIMI. You are receiving this because you authored the thread.

sni commented 1 month ago

already done, that's the 0.24.

jeff8688 commented 1 month ago

Thanks, it was confusing because you see still version 0.23 on the main page. I have found 0.24 now.


Von: Sven Nierlein @.> Gesendet: Dienstag, 21. Mai 2024 10:16 An: ConSol-Monitoring/snclient @.> Cc: jeff8688 @.>; Author @.> Betreff: Re: [ConSol-Monitoring/snclient] Memory Consumption (Issue #117)

already done, that's the 0.24.

— Reply to this email directly, view it on GitHubhttps://github.com/ConSol-Monitoring/snclient/issues/117#issuecomment-2122036915, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2TG4NKCXUZMX2NKJ2HA4C3ZDL7EXAVCNFSM6AAAAABHDRNIGKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSGAZTMOJRGU. You are receiving this because you authored the thread.Message ID: @.***>

sni commented 1 month ago

did i forget to update something? Which main page do you mean?

jeff8688 commented 1 month ago

on this page, you still see version 23 as latest one: https://github.com/ConSol-Monitoring/snclient


Von: Sven Nierlein @.> Gesendet: Dienstag, 21. Mai 2024 10:29 An: ConSol-Monitoring/snclient @.> Cc: jeff8688 @.>; Author @.> Betreff: Re: [ConSol-Monitoring/snclient] Memory Consumption (Issue #117)

did i forget to update something? Which main page do you mean?

— Reply to this email directly, view it on GitHubhttps://github.com/ConSol-Monitoring/snclient/issues/117#issuecomment-2122063136, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2TG4NIXEVHDOK4KJX3ZS3TZDMAXFAVCNFSM6AAAAABHDRNIGKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSGA3DGMJTGY. You are receiving this because you authored the thread.Message ID: @.***>

jeff8688 commented 1 month ago

[cid:b5d69a8c-acf7-413b-a284-111461861c1f]


Von: Jeff Weitzmann @.> Gesendet: Dienstag, 21. Mai 2024 10:37 An: ConSol-Monitoring/snclient @.>; ConSol-Monitoring/snclient @.> Cc: Author @.> Betreff: AW: [ConSol-Monitoring/snclient] Memory Consumption (Issue #117)

on this page, you still see version 23 as latest one: https://github.com/ConSol-Monitoring/snclient


Von: Sven Nierlein @.> Gesendet: Dienstag, 21. Mai 2024 10:29 An: ConSol-Monitoring/snclient @.> Cc: jeff8688 @.>; Author @.> Betreff: Re: [ConSol-Monitoring/snclient] Memory Consumption (Issue #117)

did i forget to update something? Which main page do you mean?

— Reply to this email directly, view it on GitHubhttps://github.com/ConSol-Monitoring/snclient/issues/117#issuecomment-2122063136, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2TG4NIXEVHDOK4KJX3ZS3TZDMAXFAVCNFSM6AAAAABHDRNIGKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSGA3DGMJTGY. You are receiving this because you authored the thread.Message ID: @.***>

FranckSallet commented 1 month ago

already done, that's the 0.24.

where we can find the 0.24 release ?

sni commented 1 month ago

I forgot to press the release button :-) It is here now