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

buggy count comparison filter in 0.4.3 and 0.4.4 #297

Closed
joba12 opened this issue May 13, 2016 · 7 comments
Closed

buggy count comparison filter in 0.4.3 and 0.4.4 #297

joba12 opened this issue May 13, 2016 · 7 comments
Assignees
Labels
Milestone

Comments

@joba12
Copy link

joba12 commented May 13, 2016

Got some problems with count and <, > and =

The following example: Want to check if 2 of 3 processes are started
nscp.exe client -q check_process "filter=exe = 'aaa.exe' or exe = 'bbb.exe' or exe = 'ccc.exe'" process=* "warn=count < 2 " "crit=count < 1 " WARNING: aaa.exe=started|'count'=2;2;1

In the result you can see that there are two processes started, but output is only processed for one and state is critical, even if 2 is not lower than 2
After alot of testing I could not find a working solution
Tested the following two examples and a lot more (!=, =, <,...":
"warn=count < 2 " "crit=count < 1 "
"warn=count = 1 " "crit=count = 0 "

Furthermore filter rules are case sensitive, it would be nice to have possibility to use them non case sensitive

@mjesse88
Copy link

I also find count cant not work..

@MikauValo
Copy link

Did som research... One of the developers confirmed that there is no workaround and that this bug wasn't fixed until the relase of 0.5.0.2 -> https://github.com/mickem/nscp/releases/tag/0.4.4.2

@mickem
Copy link
Owner

mickem commented May 30, 2016

Yes, one of the main changes in 0.5.0 was essentially the fix for this issue.

You can work around it using custom scripts in earlier versions.

@mickem mickem added the bug label May 30, 2016
@mickem mickem added this to the 0.5.0 milestone May 30, 2016
@mickem
Copy link
Owner

mickem commented May 30, 2016

As for the other issue do you mean COUNT versus count or foo = "bar" versus foo = "BAR"?

@MikauValo
Copy link

Hi mickem!
I think he means it like this:
"filter=exe = 'aaa.exe' or exe = 'AAA.exe' or exe = 'AaA.exe'"

Some processes may written differently, like explorer.exe or Explorer.exe, but mean the very same process.
So if someone wants to check "explorer.exe", but the process is called "Explorer.exe" on the system, the check wouldn't find this process.

@joba12
Copy link
Author

joba12 commented Jun 1, 2016

Thanks for the information mickem

The other issue was explained by MaskierterMuchacho very good, exactly hit the spot

@mickem
Copy link
Owner

mickem commented Jun 21, 2016

I was just about to say thats what regular expression and like are for but noticed that like did not ignore case, wil lbe fixed in the next build.

So:

"filter=exe like 'aaa.exe'"

should match:

  • aaa.exe
  • AAA.exe
  • AaA.exe

@mickem mickem self-assigned this Jun 21, 2016
@mickem mickem closed this as completed in 7c404c6 Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants