Add check_multi - #451
Draft
lgmu wants to merge 7 commits into
Draft
Conversation
Contributor
Author
|
ToDo:
check_multi "check=check_dummy 2 'CRITICAL'" "check=check_dummy 3 'UNKNOWN'" "top-syntax={{ IF ok_count gt 0 }}OK - %(ok_count)/%(count) checks are OK {{ ELSE }}CRITICAL - all checks failed{{ END }}" |
lgmu
commented
Aug 14, 2026
|
|
||
| res = snc.RunCheck("check_files", []string{"path=./t/checksum.txt", "crit=md5_checksum != 3687C5D7106484CD61CDE867A2A999FA"}) | ||
| assert.Equalf(t, CheckExitCritical, res.State, "CRITICAL") | ||
| assert.Contains(t, string(res.BuildPluginOutput()), "0/1 files") |
Contributor
Author
There was a problem hiding this comment.
Discuss with @sni why it was 0 in the first place
Contributor
There was a problem hiding this comment.
This test is passing without changes on windows for the latest main commit f9a22ac
the file MD5 is 3687C5D7106484CD61CDE867A2A999FA so raising critical is correct.
Contributor
Author
There was a problem hiding this comment.
yea but problem_count is 0, while it should be 1.
CRITICAL is still expected, nothing has changed there
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By default 'CheckMulti' is enabled, but you can disable it in the '[/modules]' section of the snclient_local.ini.
You can also set a limit for the number of checks that can be executed in the '[/settings/check/multi]' section
of the snclient_local.ini.