Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPRE check_files with latin characters in folder name #827

Open
JMelek opened this issue Feb 21, 2024 · 1 comment
Open

NPRE check_files with latin characters in folder name #827

JMelek opened this issue Feb 21, 2024 · 1 comment

Comments

@JMelek
Copy link

JMelek commented Feb 21, 2024

Hello everyone,

I need to monitor a folder in the Windows and it has a "latin character" in her name.
I know that this is not a good practice and a wrong ideia, but I can not to change her name .
In the NRPE Server I already tryed to use "encoding = utf8 ", and too commented this line, both without success.

Which argument, option, configuration I need to change for perform this query?

I searched in the documentation, forums, internet and do not found anything about this.

In the Windows, using shell "nscp test"

check_files path=C:\\SAR\\OpenRoad\ SAR\\Server\ Nível\ 2\\log pattern=*.log detail-syntax=%(filename): show-all
E       disk Invalid file specified: C:\SAR\OpenRoad SAR\Server N¡vel 2\log

Details

  • NSClient++ version: 0.5.2.41
  • OS and Version: Windows Server 2012 / Windows 10 Pro
  • Checking from: Centreon, Windwos
  • Checking with: check_nrpe, check_centreon_nrpe3

Additional Details

NSClient++ log:

2024-02-21 09:40:24: error:c:\source\0.5.2\modules\CheckDisk\file_finder.cpp:107: Invalid file specified: C:\SAR\OpenRoad SAR\Server Nível 2\log
2024-02-21 09:40:24: debug:c:\source\0.5.2\modules\CheckDisk\file_finder.cpp:112: Found a file won't do recursive scan: C:\SAR\OpenRoad SAR\Server Nível 2\log
2024-02-21 09:40:24: debug:c:\source\0.5.2\modules\CheckDisk\file_finder.cpp:112: Path is: C:\SAR\OpenRoad SAR\Server Nível 2
2024-02-21 09:40:24: error:c:\source\0.5.2\modules\CheckDisk\file_finder.cpp:107: File was NOT found!

nsclient.ini

# If you want to fill this file with all available options run the following command:
#   nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
#   nscp settings --activate-module <MODULE NAME> --add-defaults
# For details run: nscp settings --help


; in flight - TODO
[/settings/default]
;encoding = utf8

; Undocumented key
password = xxxxxx

; Undocumented key
allowed hosts = 127.0.0.1,172.31.1.50,172.25.1.160

; TIMEOUT - Timeout when reading packets on incoming sockets. If the data has not arrived within this time we will bail out.
timeout = 30


; in flight - TODO
[/settings/NRPE/server]

; Undocumented key
;;;;; insecure = true
;encoding = utf8

insecure = true
certificate key = 
certificate = ${certificate-path}/certificate.pem
ssl options = 
allowed ciphers = ADH
ssl = true
use ssl = true
allow arguments = true
verify mode = none

; PORT NUMBER - Port to use for NRPE.
port = 5666

; COMMAND ALLOW NASTY META CHARS - This option determines whether or not the we will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments.
allow nasty characters = true

; EXTENDED RESPONSE - Send more then 1 return packet to allow response to go beyond payload size (requires modified client if legacy is true this defaults to false).
extended response = true

; Undocumented key
payload length = 1024

Thanks so much.

@mickem
Copy link
Owner

mickem commented Feb 9, 2025

It depends on who you check things. NRPE does not really have any idea bout encoding so that can be an issue.
There are some way to manage that:

  1. you can define aliases in nsclient.ini file.
  2. You can configure encoding on Server side (to ensure your using utf8)
  3. You can configure encoding in nsclient.ini to match the server side encoding you have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants