Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#452 closed defect (fixed)

CheckProcState: Check if there's any notepad.exe running. OK if there's none

Reported by: tknaller Owned by: mickem
Priority: 1 Milestone: 0.3.9
Component: CheckSystem Version: 0.3.8
Severity: Bugs Keywords: CheckProcState
Cc:

Description

http://nsclient.org/nscp/wiki/CheckProcState states the following:
More process counts

Check if there's any notepad.exe running. OK if there's none, warn if there's 4, critical when there's 10:

Sample Command:

CheckProcState MaxWarnCount?=4 MaxCritCount?=10 ShowAll notepad.exe=started
OK: ...

But this is actually not working! Always returns critical!

Change History (5)

comment:1 Changed 2 years ago by tknaller

just found out that this issue had already been reported some time ago: http://nsclient.org/nscp/ticket/371

back then it was 0.3.7, it also applies to 0.3.8 and 0.3.9!

comment:2 Changed 2 years ago by mickem

  • Resolution set to worksforme
  • Status changed from new to closed

Humm...

I use the following command successfully:

checkProcState MaxWarnCount=$ARG2$ MaxCritCount=$ARG3$ "$ARG1$=started"

Could you show me some log information from when you run the command?

Michael Medin

comment:3 Changed 2 years ago by mickem

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Wait...

If no process is running it reports critical which is I guess bad... interesting... never tried that one :)

Michael Medin

comment:4 Changed 2 years ago by mickem

  • Milestone set to 0.3.9
  • Resolution set to fixed
  • Status changed from reopened to closed
  • Version set to 0.3.8

Problem is the syntax is ambigous.
...notepad.ex=started means we want to have a process started right?
Where as ...MaxWarnCount?... means we dont...
So I fixed it by adding the a flag ignore-state like so:

checkProcState MaxWarnCount=1 MaxCritCount=3 "notepad.exe=started"
CRITICAL:CRITICAL: notepad.exe: stopped (critical)|'notepad.exe'=0;1;3

checkProcState ignore-state MaxWarnCount=1 MaxCritCount=3 "notepad.exe=started"
OK:OK: All processes are running.|'notepad.exe'=0;1;3

checkProcState ignore-state MaxWarnCount=1 MaxCritCount=3 "notepad.exe=started"
WARNING:WARNING: notepad.exe: 2 > warning|'notepad.exe'=2;1;3

As you can see the ignore-state will make it work the way you want it (I hope).
(Will be in next nightly in I guess a week or so, depending on when I have the time to build it, am traveling in London right now...

Michael Medin

comment:5 Changed 2 years ago by tknaller

awesome, thanks :)

Note: See TracTickets for help on using tickets.