Git Product home page Git Product logo

snclient's People

Contributors

a-pichler avatar arisneander avatar dependabot[bot] avatar jframeau avatar lausser avatar lgmu avatar mlueckert avatar rincewindshat avatar sni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snclient's Issues

check_network - metrics

check_network gives in/out bandwith as ouput.

But metrics are in bytes and associated graphes (say Grafana) are in bytes consequently.

Ex:
Name Value
enp1s0_traffic_in 737,073,236c
enp1s0_traffic_out 141,201,248c

image

Wouldn't be preferable to get bandwith directly as metrics ?

jfr

"payload length" is not working

Hi,

I have added tag of "payload length" under the " [/setting/NRPE/server] but ı got the following error.

"[2023-07-05 17:04:11.923][Error][pid:6248][listen_nrpe:80] nrpe protocol error: nrpe: response checksum failed: 3529001219 != 122204885"

image

image

Missing perfdata when using the https api

With check_nrpe it returns performance data

check_nrpe -2 -H 10.196.13.166  -c  check_uptime  -a 'warn=uptime < 180s' 'crit=uptime < 60s'
uptime: 2d 3:11h, boot: 2023-04-04 10:01:25 (UTC)|'uptime'=184288.000000s;;;;

With check_nsc_web it doesn't

check_nsc_web -k -u https://10.196.13.166:8443 -p ""  check_uptime  'warn=uptime < 180s' 'crit=uptime < 60s'
uptime: 2d 3:13h, boot: 2023-04-04 10:01:25 (UTC) 

Parse error on non-numeric Windows version

check_nsc_web -u https://127.0.0.1:18444 -p 12345 -k -t 30 check_os_version
failed to parse platform version to float: strconv.ParseFloat: parsing "10.0.17763.4252 Build 17763.4252": invalid syntax

Version info is not necessary a number (or combination of numbers and dots)

The same check with NSClient++ shows:
OK: Windows Server 2016 Technical Preview (10.0.17763) |'version'=100;50;50;;

Although it has a performance metric, it does not look very useful.
I suggest not to output any perfdata here.

check_service, service filter doesn’t seems to work

Hello,

check_service, service filter by service or name, doesn’t seems to work

$ /usr/lib64/nagios/plugins/check_nrpe -H 10.128.10.7 -c check_service service=snclient
CRITICAL: critical(RemoteRegistry=stopped (auto)), delayed (warning(sppsvc=stopped (delayed)))


$ /usr/lib64/nagios/plugins/check_nrpe -H 10.128.10.7 -c check_service 'name=snclient'
CRITICAL: critical(RemoteRegistry=stopped (auto)), delayed (warning(sppsvc=stopped (delayed)))

Installed from : snclient-0.08-windows-amd64.msi
OS : Windows Server 2019 (1809, build 17763.4851)

Regards.

Keep logon account for snclient Windows service

On version 0.03 I configured the snclient Windows service to run with a different user. (Services > snclient Properties > Log On)
After upgrading to version 0.04 this configuration was lost and reverted back to default "Local system account".
Is it possible to keep this setting on version upgrades?

no perfdata on some checks

On some of the checks there is no performance data returned while on the equivalent NSClient++ checks perfdata is returned.

Expected Behavior

snClient returns perfdata equivalent to checks on NSClient++

Current Behavior

snClient does not return perfdata

Context (Environment)

snClient Version: 0.12 Windows

Detailed Description

List of checks where I found no perfdata is returned:
check_eventlog (count)
check_service (list of services with state)
check_files (list of files with size)
check_network (list of adapters with current datatransfer speed)
check_os_version (version)
check_process (list of processes with state)
check_tasksched (has no perfdata - not sure if this check exists on NSClient++)

I'm not certain if this list is complete and/or fully correct.

runtime error with space as parameter

Hello everyone,

I'm currently running into a runtime error when i try to pass a space character via API. I need the space for backward compatibility reasons.

I have defined an external script command as follows:

[/settings/external scripts/scripts]
test = cmd /c echo '%ARG1%'

I execute an Api call as follows:

curl -k --header "password: xxx" "https://172.25.221.142:18443/query/test?%20"

I get the following error back in the console/log:

�[0;37m[2024-02-05 10:40:00.360][Trace][pid:4580][listener:379] incoming http(s) connection from 172.25.221.63:48090�[0m
�[0;37m[2024-02-05 10:40:00.360][Trace][pid:4580][listener:389] http request:
GET /query/test?%20 HTTP/1.1
Host: 172.25.221.142:18443
Accept: */*
Password: xxx
User-Agent: curl/7.58.0

�[0m
�[0;37m[2024-02-05 10:40:00.367][Trace][pid:4580][snclient:706] command: test�[0m
�[0;37m[2024-02-05 10:40:00.382][Trace][pid:4580][snclient:707] args: []string{" "}�[0m
�[0;37m[2024-02-05 10:40:00.383][Debug][pid:4580][check_wrap:64] command before macros expanded: cmd /c echo '%ARG1%'�[0m
�[0;1;31m[2024-02-05 10:40:00.399][Error][pid:4580][snclient:679] ********* PANIC *********�[0m
Panic: runtime error: invalid memory address or nil pointer dereference�[0m
�[0;1;31m[2024-02-05 10:40:00.412][Error][pid:4580][snclient:681] **** Stack:�[0m
�[0;1;31m[2024-02-05 10:40:00.412][Error][pid:4580][snclient:682] goroutine 71 [running]:
runtime/debug.Stack()
        /opt/hostedtoolcache/go/1.21.6/x64/src/runtime/debug/stack.go:24 +0x5e
pkg/snclient.(*Agent).logPanicRecover(0x0?)
        /home/runner/work/snclient/snclient/pkg/snclient/snclient.go:682 +0x168
panic({0xa55480?, 0x112c1f0?})
        /opt/hostedtoolcache/go/1.21.6/x64/src/runtime/panic.go:914 +0x21f
pkg/snclient.MakeCmd({0xc52140, 0xc00018cb60}, {0xc00012cba0, 0xf}, {0xc00012cc30, 0x9})
        /home/runner/work/snclient/snclient/pkg/snclient/snclient.go:1309 +0x209
pkg/snclient.(*Agent).runExternalCommandString(0xc0000a4370, {0xc52140, 0xc00018cb60}, {0xc00012cba0, 0xf}, 0x1?)
        /home/runner/work/snclient/snclient/pkg/snclient/snclient.go:1111 +0x19c
pkg/snclient.(*CheckWrap).Check(0xc0000a1040, {0xc52140, 0xc00018cb60}, 0xc0000a4370, 0xc00009cfc0, {0x1?, 0x1?, 0x10?})
        /home/runner/work/snclient/snclient/pkg/snclient/check_wrap.go:74 +0x6ee
pkg/snclient.(*Agent).runCheck(0xa47680?, {0xc52098, 0xc0005763f0}, {0xc00000e94b, 0x4}, {0xc000098290, 0x1, 0x1})
        /home/runner/work/snclient/snclient/pkg/snclient/snclient.go:743 +0x3f5
pkg/snclient.(*Agent).RunCheckWithContext(0xc00019b5e8?, {0xc52098?, 0xc0005763f0?}, {0xc00000e94b?, 0xc46bd8?}, {0xc000098290?, 0x0?, 0x3?})
        /home/runner/work/snclient/snclient/pkg/snclient/snclient.go:697 +0x2a
pkg/snclient.(*HandlerWebLegacy).ServeHTTP(0xc00009e1c8, {0xc50920, 0xc0000a1000}, 0xc0000dc100)
        /home/runner/work/snclient/snclient/pkg/snclient/listen_web.go:295 +0xc5
pkg/snclient.(*Listener).WrappedCheckHTTPHandler(0xc00000e944?, {0x216674c8798, 0xc000097980}, 0xc000072000, {0xc50920, 0xc0000a1000}, 0xc0000dc100)
        /home/runner/work/snclient/snclient/pkg/snclient/listener.go:441 +0x29c
pkg/snclient.(*Listener).startListenerHTTP.func2({0xc50920?, 0xc0000a1000?}, 0xc000098200?)
        /home/runner/work/snclient/snclient/pkg/snclient/listener.go:351 +0x3f
net/http.HandlerFunc.ServeHTTP(0xa50f80?, {0xc50920?, 0xc0000a1000?}, 0xc00000e944?)
        /opt/hostedtoolcache/go/1.21.6/x64/src/net/http/server.go:2136 +0x29
github.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc000202000, {0xc50920, 0xc0000a1000}, 0xc0000dc100)
        /home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:443 +0x2b4
net/http.HandlerFunc.ServeHTTP(0xc00008c960?, {0xc50920?, 0xc0000a1000?}, 0xc000098110?)
        /opt/hostedtoolcache/go/1.21.6/x64/src/net/http/server.go:2136 +0x29
pkg/snclient.(*Listener).LogWrapHTTPHandler(0xc0000e0150, {0xc4c9e0, 0xc000204050}, {0xc51310?, 0xc0000100e0}, 0xc0000dc100)
        /home/runner/work/snclient/snclient/pkg/snclient/listener.go:397 +0x3d5
pkg/snclient.(*Listener).startListenerHTTP.func1.1({0xc51310?, 0xc0000100e0?}, 0x112d301?)
        /home/runner/work/snclient/snclient/pkg/snclient/listener.go:335 +0x3b
net/http.HandlerFunc.ServeHTTP(0xc520d0?, {0xc51310?, 0xc0000100e0?}, 0x112d3a0?)
        /opt/hostedtoolcache/go/1.21.6/x64/src/net/http/server.go:2136 +0x29
github.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc000202000, {0xc51310, 0xc0000100e0}, 0xc0000dc000)
        /home/runner/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:90 +0x330
net/http.serverHandler.ServeHTTP({0xc000576330?}, {0xc51310?, 0xc0000100e0?}, 0x6?)
        /opt/hostedtoolcache/go/1.21.6/x64/src/net/http/server.go:2938 +0x8e
net/http.(*conn).serve(0xc0000d8000, {0xc52098, 0xc00003e750})
        /opt/hostedtoolcache/go/1.21.6/x64/src/net/http/server.go:2009 +0x5f4
created by net/http.(*Server).Serve in goroutine 50
        /opt/hostedtoolcache/go/1.21.6/x64/src/net/http/server.go:3086 +0x5cb

Script run into timeout

I have a number of external scripts that I run and all are running fine except one of them.
I always get a timeout from snclient although the script is successfuly started and finishes prior to reaching the defined timeout.

For example timeout set to 666, script finishes on 1min but I still get: script run into timeout after xxx

[/settings/external scripts] ; timeout - The maximum time in seconds that a command can execute. (if more then this execution will be aborted). ; NOTICE this only affects external commands not internal ones. timeout = 666

`root@nagiosserver:/usr/lib/nagios/plugins# time ./check_nrpe -d 2 -2 -t 360:unknown -H 1.1.1.1 -c generate_report
UNKNOWN - script run into timeout after 666s

real 1m0.479s
user 0m0.006s
sys 0m0.004s
`
What should be my next troubleshooting steps?
Thank you

Windows service status is printed with it's numerical value instead of text

check_nsc_web -u https://127.0.0.1:18444 -p 1234 -k -t 30 check_service 'service=Dnscache' "crit=state != 'started'" warn=none 'ok-syntax=${status}: ${ok_list}' 'top-syntax=${status}: ${crit_list}, delayed (${warn_list}), started (${ok_list})'
2: Dnscache=4, delayed (), started ()
Exitcode is CRITICAL

Same check with NSClient++
check_service 'service=Dnscache' "crit=state != 'started'" warn=none 'ok-syntax=${status}: ${ok_list}' 'top-syntax=${status}: ${crit_list}, delayed (${warn_list}), started (${ok_list})'
OK: Dnscache=running (auto) |'Dnscache'=4;0;0;;
Exitcode is OK

check_drivesize: disk usage is shown as own drive

Check_drivesize shows two drives although there is only one.

image

Command line:

-c check_drivesize
OK - All 2 drive(s) are ok |'C:\ used'=16275165184B;128763451802;144858883277;0;160954314752 'C:\ used %'=10.1%;80;90;0;100 ' used'=34463744B;83882803;94368154;0;104853504 ' used %'=32.9%;80;90;0;100

-c check_drivesize drive=C
OK - All 2 drive(s) are ok |'C:\ used'=16279162880B;128763451802;144858883277;0;160954314752 'C:\ used %'=10.1%;80;90;0;100 ' used'=34463744B;83882803;94368154;0;104853504 ' used %'=32.9%;80;90;0;100

-c check_drivesize drive=C:
OK - All 2 drive(s) are ok |'C:\ used'=16279162880B;128763451802;144858883277;0;160954314752 'C:\ used %'=10.1%;80;90;0;100 ' used'=34463744B;83882803;94368154;0;104853504 ' used %'=32.9%;80;90;0;100

snclient: v0.22
check_nrpe: v4.1.0

Admin permissions to check service state

Currently the logon account for the snClient service has to be in the administrator group in order to check a Windows service state. This is due to golang requesting "SC_MANAGER_ALL_ACCESS" when opening the service control manager:
https://cs.opensource.google/go/x/sys/+/refs/tags/v0.10.0:windows/svc/mgr/mgr.go
h, err := windows.OpenSCManager(s, nil, windows.SC_MANAGER_ALL_ACCESS)

I have found this here:
https://github.com/winlabs/gowin32/blob/0d265587d3c90d3dca04c4927c845b5334ade86f/service.go#L394
...which apparently allows to read service state with less properties and should be sufficient for monitoring.

There is also an issue open with golang about this:
golang/go#51465

Generate check_index dynamically

Would be nice if check_index on a linux only returns commands that work on linux.

So no check_wmi, check_tasksched, etc.

UNKNOWN - check_wmi is a windows only check

check_service exclude docs

Hello,

I started using check_service to check all services in autostart on my Windows server.
Services like edgeupdate, RemoteRegistry and sppsvc for example, are marked as automatic start and don't run all the time, so I want to exclude that service.

So when I do the check_service, I get the output:
WARNING - , delayed (warning(edgeupdate=stopped (delayed), RemoteRegistry=stopped (delayed), sppsvc=stopped (delayed))) |'count'=214;;;0; 'failed'=3;;;0;

I found the exclude argument in the docs, so if I want to exclude the services I mentioned before (edgeupdate, RemoteRegistry and sppsvc) I have to do it like that:
check_service exclude=edgeupdate exclude=RemoteRegistry exclude=sppsvc
This gives me the Output I want:
OK - All 211 service(s) are ok. |'count'=211;;;0; 'failed'=0;;;0;

Can you please add an example for this in the documentation?

check_nrpe UNKNOWN on status message "OK"

When running i.e. CPU check with check_nrpe the check plugin returns with status text "OK..." but the exit code is 3 which results in UNKNOWN. This happens on other check_nrpe checks too, not only on CPU check.
grafik
grafik

Expected Behavior

check_nrpe should return with exit status 0 and status text "OK..."

Current Behavior

check_nrpe returns with exit status 3 and status text "OK..."

Context (Environment)

Monitoring Host: OMD stack with naemon core
check_nrpe Plugin for Nagios Version: 4.1.0
snClient Version: 0.3 Windows

Detailed Description

Check Command: check_nrpe -H xxx -2 -c check_cpu -a 'warn=load>90' 'crit=load>95' time=1m time=10m time=30m
The same command works when running NSClient++ on the Windows machine.

misleading "client certificates" configuration option

Hi again,
I checked how client cert auth. is implemented in snclient and it seems to be OK, only thing what was not clear to me is how to enable it.
It can be enabled using client certificates configuration option in snclient, which is a little bit misleading as it should contains CA certificate(s). In original NSCP, it can be enabled using ca and verify mode options. I'd suggest add this options (and remove client certificates) into the snclient for backward compatibility - what do you think?

PS: thanks for "fixing" CheckExternalScripts

Add folder size support

Would be great if either check_files had a mode to check the size of folders or if there was a check_folder.
Right now it's only possible to check the size of individual files in the folder, but not the whole folder itself.

In Powershell this can be achieved like this:
$foldersize = (Get-ChildItem -Path "$folder" -Recurse | Measure-Object -Property Length -Sum).Sum

Windows service check is different from NSClient++

/omd/sites/snclient/lib/monitoring-plugins/check_nsc_web -u https://192.8.2.166:18444 -p HideIT123 -k -t 30 check_service 'service=Spooler' "crit=state != 'started'" warn=none 'ok-syntax=${status}: ${ok_list}' 'top-syntax=${status}: ${crit_list}, delayed (${warn_list}), started (${ok_list})':18444 -p HideIT123 -k -t 30 check_service 'service=Spooler' "crit=state != 'started'" warn=none 'ok-syntax=${status}: ${ok_list}' 'top-syntax=${status}: ${crit_list}, delayed (${warn_list}), started (${ok_list})'
returns:
CRITICAL: Spooler=running (auto), delayed (), started ()
whereas NSClient++ returns:
OK: Spooler=running (auto)

I see that in file EnumNtSrv.cpp/service_info::parse_state of NSClient++ the strings "started" and "running" are synonyms.

check_os_updates improvement

Can you add logic to check_os_updates (or maybe create a new one check_os_eol?) that detects when OS end-of-life date is and return warning/critical with message when the end-of-life date is if it is in x many days.

https://endoflife.date/docs/api has all the end-of-life dates needed. What do you think?

Clarify which OS is really supported

Hello,

Can you specify on the documentation which OS is really supported ?

I tried to to install the .deb packages on :
Debian 5 - failed
Debian 6 - failed
Debian 7 - failed
Debian 8 - failed
Debian 9 - failed
Debian 10 - failed
Debian 11 - failed

# dpkg -i snclient-0.08-linux-amd64.deb
dpkg-deb: error: archive 'snclient-0.08-linux-amd64.deb' uses unknown compression for member 'control.tar.zst', giving up
dpkg: error processing archive snclient-0.08-linux-amd64.deb (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 snclient-0.08-linux-amd64.deb

I think the question is the same for RPM on Linux and Windows (I tried on 2019, it works)

Thanks.
Regards.

Memory Consumption

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

NRPE - aliases not working

Hi,
I am trying snclient as a replacement for (old) nscp on WIndows server 2012 and have an issue with alias commands.

alias_cpu is defined in snclient.ini ( service restarted, no errors in snclient.log)

snclient.ini

...
[/modules]
NRPEServer = enabled
CheckSystem = enabled
CheckDisk = enabled

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

[/settings/external scripts/alias]
alias_cpu = check_cpu "warn=load>90" "crit=load>95"
...

Now when I call "alias_cpu" :
./check_nrpe -H myserver -c alias_cpu
result: UNKNOWN - No such check: alias_cpu

but not-alias commands works:
./check_nrpe -H myserver -c check_cpu
result: OK - CPU load is ok. 0% on 8 cores |'total 5m'=1%;80;90 'total 1m'=1%;80;90 'total 5s'=0%;80;90

version check works as well:
./check_nrpe -H myserver
result: SNClient+ v0.20 (Build: 76032af, go1.22.1) |'version'=0.2

Any idea what I am doing wrong or where the issue might be?
Thank you

Problems with wmi-checks

Hi Sven,

first of all: this is a really great and awesome project and i am thankful for your effort to have an alternative now for nsclient++!

I have tested in the last days with snclient 0.13 a little bit and recognized two problems: perfdata are not available in every case (already mentioned here) and check-wmi with performance counters are not the same as used in the old days.

Can you pls take a look at it?

Expected Behavior

snClient returns pdh data done by check-wmi equivalent to checks on NSClient++

Current Behavior

snClient does return OK instead

Context (Environment)

snClient Version: 0.13 Windows 11 Pro

Detailed Description

wmi:
select PercentIdleTime from Win32_PerfFormattedData_HvStats_HyperVHypervisorLogicalProcessor where Name="_Total"
-> e.g. results in "94" which gives us the idle time

nsclient:
check_pdh -a 'counter=\Hyper-V Hypervisor Logical Processor(_Total)\% PercentIdleTime' 'warn=value>25' 'crit=value>15' 'perf-config=*' show-all
-> e.g. results in "94" which gives us the idle time

snclient:
check_wmi -a perf-config="*(unit:%)" "query=select PercentIdleTime from Win32_PerfFormattedData_HvStats_HyperVHypervisorLogicalProcessor where Name='Total'" "warn=value<25" "crit=value<15" show-all
-> results in "OK:_"

Thank you very much,
Joachim

check_service - problem with changing default warning & critical arguments

I need to get a warning, if a service on windows is disabled and stopped but this is not the default warning arguments. So I tried different variations to change the default warning arguments but in most cases I get only "UNKNOWN - unknown argument:"

./check_nrpe -H 10.8.0.108 -c check_service -a 'service="SERVICENAME"' - works fine but not for disabled services

./check_nrpe -H 10.8.0.108 -c check_service -a 'service="SERVICENAME" warning="state!=started"' does not work and I get "UNKNOWN - unknown argument:"

Argument in external script is empty

...
CheckExternalScripts = enabled
...
allow arguments = true
...
[/settings/external scripts/scripts]
;restart_service = net start %ARGS%  <- doesn't work, %ARGS% is empty. It only shows the list of running srvices
restart_service = net start Server  <- this works, service is restarted
...

/omd/sites/snclient/lib/monitoring-plugins/check_nsc_web -u https://10.19.2.192:18444 -p HideIT123 -k -t 30 restart_service Server does not succeed.
With %ARG% the debug output of snclient shows the output of a "net start" command.

image

Service check shows ok if Service is stopped or disabled - Windows services

If I understand correctly, then I should get a warning/critical, if a service is disabled in windows.
a filter like "service=SERVICENAME" should be enough.
I get:
image

how the query should look like with nrpe, if I want to get a warning if service is stopped?
check_nrpe -H [IP] -c check_service -a 'service=CpdService' ...
tried different variations but the query seems to be not korrekt

error message improvement

Todo: When a wrong password is used, the error message could be a bit more explanatory.

RESPONSE-ERROR:
http request failed: 403 Forbidden
UNKNOWN: json error: unexpected end of JSON input

Cpu counters missing (Windows)

In check_cpu.go the loop
for _, name := range snc.Counter.Keys("cpu") {
is empty.
Snclient is running with Admin privileges (and is running long enough so that cpu samples should have been collected).

crash on ini file with only comments

If snClient+ tries to load an ini file with only comment lines starting with ";" it crashes on service start. i.e. an ini file with only one line in it:
; INI Version 1

Expected Behavior

snClient loads the ini file and starts

Current Behavior

snClient loads the ini file and crashes

Context (Environment)

snClient Version: 0.12 Windows

Detailed Description

snClient crash dump:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x38 pc=0xa3ba42]

goroutine 1 [running]:
pkg/snclient.(*Config).ParseINI(0xc000095240, {0xdc03c0?, 0xc0000f53b0?}, {0xc0000c8d40, 0x34})
        pkg/[email protected]/config.go:259 +0x8c2
pkg/snclient.(*Config).ReadINI(0xc000095240, {0xc0000c8d40, 0x34})
        pkg/[email protected]/config.go:173 +0x4b0
pkg/snclient.(*Config).parseInclude(0xc000095240, {0xc00009ac48, 0x13}, {0xc0000c8440, 0x26})
        pkg/[email protected]/config.go:280 +0x295
pkg/snclient.(*Config).ParseINI(0xc000095240, {0xdc03c0?, 0xc0000f4ab0?}, {0xc0000c8440, 0x26})
        pkg/[email protected]/config.go:251 +0x5ac
pkg/snclient.(*Config).ReadINI(0xc000095240, {0xc0000c8440, 0x26})
        pkg/[email protected]/config.go:173 +0x4b0
pkg/snclient.(*Agent).readConfiguration(0xc0000a4500, {0xc0000989f0, 0x1, 0x1})
        pkg/[email protected]/snclient.go:422 +0x110
pkg/snclient.(*Agent).Init(0xc0000a4500)
        pkg/[email protected]/snclient.go:387 +0x1e5
pkg/snclient.NewAgent(0x12deb20)
        pkg/[email protected]/snclient.go:170 +0x25b
pkg/snclient/cmd.init.5.func1(0xc0000b1900?, {0xc9a235?, 0x4?, 0xc9a24d?})
        pkg/snclient/[email protected]/server.go:19 +0x29
github.com/spf13/cobra.(*Command).execute(0xc0000ea300, {0x1336140, 0x0, 0x0})
        github.com/spf13/[email protected]/command.go:987 +0xaa3
github.com/spf13/cobra.(*Command).ExecuteC(0xc0000d0600)
        github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/[email protected]/command.go:1039
pkg/snclient/cmd.Execute()
        pkg/snclient/[email protected]/root.go:87 +0x45
main.main()
        github.com/consol-monitoring/snclient/cmd/snclient/main.go:11 +0x13

cpu usage

I was using nsclient++ querying thru the web interface status of various items to report to a home automation tool I use. Still works but noticed that the cpu info reporting back is inaccurate. Like in the server it's showing 55% utilization in Windows but NSCLient++ reports back 8%. Noticed it's hard to pull those statistics in general from a Windows computer at least thru PowerShell. How well does SNCLient handle getting current CPU utilization? This would be for modern AM5 AMD CPUs in Windows 11 or Windows 2022.

check_process shows everything ok if no process available

The check_check is used with "process=NAME.exe".
with additional warn state like "warn=state = started" I get a warning.
I also get "OK: all processes are ok." if I kill the process and no state is available.

I also can't use other filter attributes than process. "I get UNKNOWN - unknown argument: exe/filename/command_line"

check_drivesize - case sensitivity on Linux box

When checking for /home (but any directory failed in fact but /), I get:

All 0 drive(s) are ok

I think this part of code is wrong:

for _, arg := range argList {
switch arg.key {
case "drive":
drives = append(drives, strings.Split(strings.ToUpper(arg.value), ",")...)
case "exclude":
excludes = append(excludes, strings.Split(strings.ToUpper(arg.value), ",")...)
}
}

as gopsutil returns current case.

jfr

snclient doenst start after upgrade from 0.19 to 0.20 on el8

I have upgraded snclient from version 0.19 to 0.20 on my el8 test system and the service doesnt start after that.

strace output:

root@localhost ~ # strace -a 80 -s 120 -f /usr/bin/snclient --config=/etc/snclient/snclient.ini
execve("/usr/bin/snclient", ["/usr/bin/snclient", "--config=/etc/snclient/snclient.ini"], 0x7ffc2bb48b80 /* 187 vars */) = -1 ENOEXEC (Exec format error)
strace: exec: Exec format error
+++ exited with 1 +++

Windows Service Monitoring not possible if Service-Name has spaces

I am using following command line to check "my WinSerice" on Host myWinHost:

check_nsc_web -config /.../check_nsc_web.config -k -query "check_service service=my WinService" -u https://myWinhHst:8443
UNKNOWN - unknown argument: WinService

If I use %20 instead of space I get the following:

check_nsc_web -config /.../check_nsc_web.config -k -query "check_service service=my%20WinService" -u https://myWinHost:8443
UNKNOWN - failed to open service my%20WinService: failed to find service name my%20WinService: The specified service does not exist as an installed service.

How can I check Windows Services with spaces in Service-Names?

check_ntp_offset - critical escalation

I cannot understand, why I get a critical escalation here
image

The check config is default:
check_ntp_offset -a 'warn=offset > 50 || offset < -50' 'crit=offset > 100 || offset < -100'

snclient+ v0.16 ist running on windows 10.

w32tm / query /status on the windows 10 system:
image

Support for Passive Montitoring

With NSClient++ you could create internal schedulers.

This seems to currently be missing from snclient.

When running a passive setup where the agent has an internal schedule and pushes the results to a naemon/nagios that uses freshness on the configured checks/services support for some internal scheduler would be amazing!

Extra points if it works with the current nsclient++ config 👍

Defaults Arguments values

Hi,

thank you for this great project, especially for windows sysadmins that needs a new naemon client with new features.

is there a way to overwrite defaults parameters of built-in checks ?

regards

auto-update does not work since 0.21

Seems that because of the changed filenames from snclient-0.XX-windows-amd64.msi to snclient-0.XX-windows-x86_64.msi to auto-update. This is in the logs

Bildschirmfoto 2024-04-04 um 13 33 17

Current version on the clients is 0.20 windows x64

check_nrpe custom check script "not a valid Win32 application"

When running a custom check script with check_nrpe it throws status "UNKNOWN" with "...%1 is not a valid Win32 application."
grafik

Expected Behavior

check_nrpe should return with exit status 0 and status text "OK..."

Current Behavior

check_nrpe returns with exit status 3 and status text "...%1 is not a valid Win32 application."

Context (Environment)

Monitoring Host: OMD stack with naemon core
check_nrpe Plugin for Nagios Version: 4.1.0
snClient Version: 0.04 Windows

Detailed Description

snclient.ini:
grafik
The script does not need any arguments to run.

The exact same script and configuration worked on snClient version 0.03 and stopped working directly after I installed version 0.04.
grafik

SNClient+ v0.13 (Build: 34e213b) - wmi query failed: wmi: CallMethod ConnectServer failed: Exception occurred. (Not enough storage is available to process this command.)

When executing the checks check_eventlog and check_pagefile, the error message appears after some time:

UNKNOWN - wmi query failed: wmi: CallMethod ConnectServer failed: Exception occurred. (Not enough storage is available to process this command. )

the checks are executed as follows:

check_eventlog -a "filter=source='disk' and level='error'"
check_eventlog -a "filter=source='Resource-Exhaustion-Detector' and id='2004'"
check_pagefile -a "filter=name='total'" "warn=free<5%" "crit=free<5%"

and the SNClient uses round about 1,2GB Memory

SNCLient runs on a Windows Server 2016 Standard with 4GB Memory

after a few hours the SNClient crashes (depending on the available memory)

installation on Mac OSX fails

Hi,
first of: thanks for your great effort to have a new and supported client again!!

i tried to install it on my Macbook M2 Pro, OS 13.4.1(c) with your osx-arm64.pkg package.
it fails with "this package is not compatible with this mac os-version"?!

Windows's service not created anymore with the installer

Hello,

Just to let you know that with : snclient-0.13-windows-amd64.msi

The Windows's service not created anymore.

Os from the cmd line of SNclient :
SNClient+ starting (version:v0.13. - build:34e213b - host:piwv-monitoring-02 - pid:6524 - os:Microsoft Windows Server 2019 Standard 10.0.17763.4851 Build 17763.4851 - arch:amd64)

Regards.

check_tasksched timezones

Hi,

check_files supports filter keywords like:

image
(here it would also be good to define which timezone the default option uses)

It would be great if check_tasksched had similar options for "most_recent_run_time"

And in general, maybe we could add the timezone to the output, because when you just see 19:00, you have no idea what it actually is now

default configuration of an empty parameter

Hello,

I went from version 0.17 to version 0.23 on Windows.
I notice a change in the value of the arguments when no values are specified in the check_command for CheckExternalScripts.

in version 0.17, the default value for an empty argument was "$" (like nsclient by the way)
in version 0.23, the default value for an empty argument is "$ARG1$" (for the first argument)

Is this intended behavior?

I suggest not sending anything, this will allow you to better manage the arguments in the scripts, notably PowerShell

Thanks, Franck

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.