Page 1 of 1

Process Check Never Goes Critical

Posted: Tue Oct 12, 2021 2:36 pm
by jimmlegs
I am trying to check if either of two processes are running and if neither are to go critical. I appear to have all of the pieces but Nagios XI never sends a notification and appears to be in a warning state even though it says "CRITICAL: No processes found". It does recover with an OK state when it detects one of the two processes which is the correct behavior, I just need help with the critical status and notification. I am using the following syntax:

./check_nrpe -H $HOSTNAME$ -c check_process "top-syntax=%(list):%(count)" "detail-syntax=%(exe):%(state)" -a "filter=state='stopped' and exe eq 'MsSenseS.exe' or exe eq 'ccSvcHst.exe'"

Thank you in advance for any assistance.

Re: Process Check Never Goes Critical

Posted: Wed Oct 13, 2021 3:14 pm
by ssax
If you pass show-default to nsclient it can help in cases like these (I've modified yours since yours isn't the proper format):

Code: Select all

./check_nrpe -H X.X.X.X -c check_process -a "filter=state='stopped' and exe eq 'MsSenseS.exe' or exe eq 'ccSvcHst.exe'" "top-syntax=%(list):%(count)" "detail-syntax=%(exe):%(state)" show-default
"filter=state != 'unreadable'" "warning=state not in ('started')" "critical=state = 'stopped', count = 0" "empty-state=unknown" "top-syntax=${status}: ${problem_list}" "ok-syntax=%(status): all processes are ok." "empty-syntax=UNKNOWN: No processes found" "detail-syntax=${exe}=${state}" "perf-syntax=${exe}"
So you would want to use this:

Code: Select all

./check_nrpe -H X.X.X.X -c check_process -a "filter=state='stopped' and exe eq 'MsSenseS.exe' or exe eq 'ccSvcHst.exe'" "top-syntax=%(list):%(count)" "detail-syntax=%(exe):%(state)" "empty-state=critical" "empty-syntax=CRITICAL: No processes found"

Re: Process Check Never Goes Critical

Posted: Thu Oct 14, 2021 6:23 am
by jimmlegs
Thanks, that did the trick! You can close