Page 1 of 1

NCPA indirect checks

Posted: Thu Feb 03, 2022 2:49 pm
by rb8telitcom
with NRPE we are able to do indirect checks as explained in:
https://assets.nagios.com/downloads/nag ... e/NRPE.pdf
2. EXAMPLE USES b) Indirect Checks

Is there a way to do the same with NCPA?

I'm trying to follow the same logic with NCPA, but I seem to be stuck on the "" placements, I have tried different combinations but keep keeping errors like:

Code: Select all

2022-02-03 14:07:51,317 28968 ERROR Exception on /api/plugins/check_ncpa.py/'-H 172.31.20.38'/'-t ABCDEFG'/'-P 5693'/'-M cpu/percent'/'-w 70'/'-c 90'/'-q aggregate=avg' [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
  File "/root/ncpa/agent/listener/server.py", line 292, in token_auth_decoration
  File "/root/ncpa/agent/listener/server.py", line 1099, in api
  File "/root/ncpa/agent/listener/nodes.py", line 308, in run_check
  File "/root/ncpa/agent/listener/pluginnodes.py", line 115, in execute_plugin
  File "/usr/local/lib/python2.7/site-packages/gevent/subprocess.py", line 585, in __init__
  File "/usr/local/lib/python2.7/site-packages/gevent/subprocess.py", line 554, in __init__
  File "/usr/local/lib/python2.7/site-packages/gevent/subprocess.py", line 1312, in _execute_child
OSError: [Errno 2] No such file or directory
2022-02-03 14:07:51,318 28968 INFO ::ffff:172.31.21.27 - - [2022-02-03 14:07:51] "GET /api/plugins/check_ncpa.py/%27-H%20172.31.20.38%27/%27-t%20ABCDEFG%27/%27-P%205693%27/%27-M%20cpu%2Fpercent%27/%27-w%2070%27/%27-c%2090%27/%27-q%20aggregate%3Davg%27?token=ABCDEFG&check=1 HTTP/1.1" 500 2362 0.061576

Re: NCPA indirect checks

Posted: Thu Feb 03, 2022 3:20 pm
by rb8telitcom
Belay my last, I found the issue. The systems I am testing are still using python2, I had to edit the ncpa.cfg on the middle server:
[plugin directives]
.py = python3 $plugin_name $plugin_args --> .py = python $plugin_name $plugin_args

And then the remote checks started working.

this thread can be locked. Thanks.

Re: NCPA indirect checks

Posted: Thu Feb 03, 2022 5:51 pm
by kfanselow
Hi rb8telitcom,

We're glad you got it resolved and we'll lock the thread.

Thanks and Best Regards,
Keith