NCPA Process Service for 32 bit Process Does Not Work

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
wkratky
Posts: 8
Joined: Thu Apr 08, 2021 12:20 pm

NCPA Process Service for 32 bit Process Does Not Work

Post by wkratky »

Does NCPA support 32 bit processes on machines? Have had no problems with 64 bit processes. I verified the process is running on the machine, and tried different variations (with and without the *32) to no available. The workstation is unfortunately Windows 7 at the moment. See attached. Here is the full $ARG1$:

-t 'token' -P XXXX -M 'processes' -q 'name=md2tfsrv.exe *32' -c 1:1

Any ideas?
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: NCPA Process Service for 32 bit Process Does Not Work

Post by benjaminsmith »

Hi,

Thank you for contacting the support team at Nagios.

What kind of return message are you getting? Can paste the full check command into the CLI and then add -v for more information and post the full result to the thread for us to review.

See: Nagios XI - How To Test Check Commands From The Command-line

Regards,
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
wkratky
Posts: 8
Joined: Thu Apr 08, 2021 12:20 pm

Re: NCPA Process Service for 32 bit Process Does Not Work

Post by wkratky »

This is what is shows in NagiosXI GUI check:

[nagios@nagiosximon.acklie.com ~]$ /usr/local/nagios/libexec/check_ncpa.py -H 192.168.1.156 -t 'SxxxxxxxxL$4' -P 5693 -M 'processes' -q 'name=tfreader32.exe *32' -c 1:1
CRITICAL: Process count for processes named tfreader32.exe *32 was 0 | 'process_count'=0;;1:1;

I tried removing the *32 and other combinations, and it does not see the tfreader32.exe, which I confirmed is running on the machine's Task Manager. I thought maybe it was because it is 32 bit, but I had another instance that was not. The only thing that was similar was the user name is an AD user versus SYSTEM or another user.

I followed the guide you linked and I get a 'bash: -c: line 0: syntax error near unexpected token ')'. The ) is part of the password. Does Nagios not like that character for a password? It has worked for other processes. Below is what I tried.

/usr/local/nagios/libexec/check_ncpa.py -H $x.x.x.x$ -t '*NCPA Token*' -P 5693 -M 'processes' -q 'name=tfreader32.exe *32' -c 1:1

Moderator's Note: I removed the exact token since you don't really want to post that.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: NCPA Process Service for 32 bit Process Does Not Work

Post by benjaminsmith »

Hi,

Thanks for the update. I tested the password using that special character without issue. That should work, just make sure you're wrapping the token in single quotes.

I think the issue is that the process name may be different from what is in the check command.

One handy feature of NCPA is that it has a backend GUI and you can load the API data for testing. Log into the NCPA backend by going to:

Code: Select all

https://<IPaddress>:5693
ncpa-api.png
Then go to API and select Processes and search for this process, filter on the name show and then select the Run as Nagios Check option to see the results.

To get the check command select view in alternate format and test it again from the Nagios XI CLI. Let me know if that works now.

Benjamin
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
wkratky
Posts: 8
Joined: Thu Apr 08, 2021 12:20 pm

Re: NCPA Process Service for 32 bit Process Does Not Work

Post by wkratky »

I did the 'Run as Nagios Check' option and it does see it there (see attached). Same with nagios user and following the test check guide. However, I still get the ) error as root doing the same thing. I just don't understand what I am doing wrong and the discrepancy.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NCPA Process Service for 32 bit Process Does Not Work

Post by ssax »

It's likely an escaping issue, send us the full command that you're running as root.
wkratky
Posts: 8
Joined: Thu Apr 08, 2021 12:20 pm

Re: NCPA Process Service for 32 bit Process Does Not Work

Post by wkratky »

I believe I posted it in the one picture. Unless I am misunderstanding you, this is the full command I am running logged in as root:

su -c '/usr/local/nagios/libexec/check_icmp -H 192.168.1.156 -t 'SxxxxxxxxlS$4' -M 'processes' -q 'name=tfreader32.exe' -c 1:1 nagios

I found this guide that talks about Special Characters (https://support.nagios.com/kb/article/n ... s-580.html). Any ideas on how to apply this to the password I am using? I hate to change the password on every API to get this to work. It has worked on other sensors, processes, services, etc. up to this point.

Moderator's Note: I removed the exact token since you don't really want to post that.
wkratky
Posts: 8
Joined: Thu Apr 08, 2021 12:20 pm

Re: NCPA Process Service for 32 bit Process Does Not Work

Post by wkratky »

I had a ticket with support as well and they were able to figure out the *32 bit instances. This is what worked in that situation:

/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -t 'yourtoken' -M 'processes' -c 1: -q 'name=md2tfsrv.exe'

I am still having trouble with one that has capital letters I have entered, but the output shows all lower case. Don't suppose you have any ideas on that front?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NCPA Process Service for 32 bit Process Does Not Work

Post by ssax »

The output shows all lowercase on mine as well, I was working with you in that ticket. I forgot to close this one when we started the ticket for the other one.

Are the services working in Nagios XI now?

If not, try changing your token from this:

Code: Select all

-t 'SxxxxxxxxlS$4'
To this:

Code: Select all

-t "SxxxxxxxxlS$"$"4"
Then apply configuration and force a check.

Or add your token as a User Macro and use '$USERx$' instead:
- x would be the number you used in the user macro definition

https://assets.nagios.com/downloads/nag ... ponent.pdf
wkratky
Posts: 8
Joined: Thu Apr 08, 2021 12:20 pm

Re: NCPA Process Service for 32 bit Process Does Not Work

Post by wkratky »

My apologies, I did not realize I was working with the same person. :) I was just trying to maximize resources. We can focus entirely on this in the ticket. I tried your code suggestion, but I tried many different combinations and got wrong credentials. I also had tried the User Macro by using $USER3$ with the token information and same thing saying there is no name/exe.
Locked