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

exe: premature return when using --environment #40

Open
simonmeggle opened this issue Jul 27, 2018 · 0 comments
Open

exe: premature return when using --environment #40

simonmeggle opened this issue Jul 27, 2018 · 0 comments

Comments

@simonmeggle
Copy link

When compiled as exe, check_logfiles returns prematurely when using --environment on the Windows commandline. Tested with version 3.9 on different Windows machines (7/8/10, 64bit)

Test scenario

logfile with 200k lines.

minimalistic cfg file:

@searches = ({
  logfile => 'alllogs.txt',
  type	=> "virtual", 
  warningpatterns => '.*',
});

OK without environment

C:\cl_exe_test>check_logfiles_neu.exe -f cl_exe_test.cfg [enter]
[~8s execution time]
WARNING - (199129 warnings) - _(null)_ ...|'default_lines'=199129 'default_warnings'=199129 'default_criticals'=0 'default_unknowns'=0
C:\cl_exe_test>

NOK with environment

C:\cl_exe_test>check_logfiles_neu.exe -f cl_exe_test.cfg --environment WEBMODULE=foo [enter]
[~1s execution time]
C:\cl_exe_test>[enter]
C:\cl_exe_test>[enter][enter][enter][enter][enter][enter]....[enter][enter][enter][enter]
C:\cl_exe_test>WARNING - (199129 warnings) - _(null)_ ...|'default_lines'=199129 'default_warnings'=199129 'defaul
t_criticals'=0 'default_unknowns'=0
C:\cl_exe_test>

summary

As a result, when called by NSclient, check_logfiles services do not contain a service output.

workaround

Replacing environment variables with macros worked for my requirement.

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

1 participant