Page 1 of 1

NCPA checks for lowercase version of command, thus fails

Posted: Tue May 07, 2024 5:40 pm
by raskolnikov88
I'm trying to replace the nagios check_procs plugin with the native ncpa facility, but it seems to have some limitations.

One of them is described thusly:

I'm checking for a process called "Autosched.bora9.bsh" -

$ ssh drslinap3d ps -ef|grep Autosched.bora9.bsh
espbatch 9714 1 0 Apr08 ? 00:00:00 /bin/ksh /opt/softwareag/cronus/scripts/Autosched.bora9.bsh

So, the process is there. Now let's check with ncpa:

$ check_ncpa.py -H drslinap3d -t linux -M 'processes' -q 'name=Autosched.bora9.bsh' -c1:
CRITICAL: Process count for processes named autosched.bora9.bsh was 0 | 'process_count'=0;;1:;

ncpa searches for a lower case version of the process, which is not found.

Any workarounds for this?

Re: NCPA checks for lowercase version of command, thus fails

Posted: Wed May 08, 2024 11:13 am
by bbahn
Hello @raskolnikov88,

A quick glance at the code indicates that NCPA shouldn't be having a problem with lowercase service as it converts the list of services it checks against to lowercase as well. What OS are you running NCPA on? I can file a bug report for this issue if you'd like.

Re: NCPA checks for lowercase version of command, thus fails

Posted: Fri Jun 07, 2024 2:28 am
by Jacobjsdhfg
raskolnikov88 wrote: Tue May 07, 2024 5:40 pm I'm trying to replace the nagios check_procs plugin with the native ncpa facility, but it seems to have some limitations.

One of them is described thusly:

I'm checking for a process called "Autosched.bora9.bsh" - slope game

$ ssh drslinap3d ps -ef|grep Autosched.bora9.bsh
espbatch 9714 1 0 Apr08 ? 00:00:00 /bin/ksh /opt/softwareag/cronus/scripts/Autosched.bora9.bsh

So, the process is there. Now let's check with ncpa:

$ check_ncpa.py -H drslinap3d -t linux -M 'processes' -q 'name=Autosched.bora9.bsh' -c1:
CRITICAL: Process count for processes named autosched.bora9.bsh was 0 | 'process_count'=0;;1:;

ncpa searches for a lower case version of the process, which is not found.

Any workarounds for this?
Maybe you should
a. Check if there is a configuration setting or option in NCPA to make the process name matching case-insensitive.
b. Try using a regular expression or wildcard in the process name query to match the correct case.
c. Use a different monitoring tool or plugin that can handle the process name correctly.
d. Write a custom script or plugin that interfaces with NCPA and handles the process name matching correctly.