NCPA API: OSError: [Errno 13] Permission denied

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sosogh
Posts: 3
Joined: Tue Feb 11, 2014 3:45 am

NCPA API: OSError: [Errno 13] Permission denied

Post by sosogh »

Hi
I install http://assets.nagios.com/downloads/ncpa ... .amd64.deb in my Ubuntu 12.04.2 LTS bit.
and use the default config file except modifing token to 123 .


When I visit https://192.168.56.2:5693/api/?token=123
It redirects me to https://192.168.56.2:5693/error/Referen ... ot%20exist.
The web shows me :
{
"error": "Referencing node that does not exist."
}


The listener log shows:
2014-03-21 12:55:57,282 2160 ERROR [Errno 13] Permission denied
Traceback (most recent call last):
File "/build/ncpa/agent/listener/server.py", line 226, in api
File "/build/ncpa/agent/listener/psapi.py", line 211, in getter
File "/build/ncpa/agent/listener/psapi.py", line 30, in accessor
File "/build/ncpa/agent/listener/psapi.py", line 42, in run
File "/build/ncpa/agent/listener/psapi.py", line 35, in walk
File "/build/ncpa/agent/listener/psapi.py", line 88, in run
File "/build/ncpa/agent/listener/psextensions.py", line 36, in get_services
File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
OSError: [Errno 13] Permission denied
2014-03-21 12:55:57,290 2160 INFO 192.168.56.1 - - [21/Mar/2014 12:55:57] "GET /api/?token=123 HTTP/1.1" 302 -
2014-03-21 12:55:57,330 2160 INFO 192.168.56.1 - - [21/Mar/2014 12:55:57] "GET /error/Referencing%20node%20that%20does%20not%20exist. HTTP/1.1" 200 -
2014-03-21 12:55:57,444 2160 INFO 192.168.56.1 - - [21/Mar/2014 12:55:57] "GET /favicon.ico HTTP/1.1" 404 -

Does anyone know what does it mean?
Thank you
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NCPA API: OSError: [Errno 13] Permission denied

Post by slansing »

When accessing:

Code: Select all

https://192.168.56.2:5693
Are you able to log in with the token you set? Or does it still error out?

Can you provide us with your ncpa.cfg in an attachment?
sosogh
Posts: 3
Joined: Tue Feb 11, 2014 3:45 am

Re: NCPA API: OSError: [Errno 13] Permission denied

Post by sosogh »

Yes , I can login the web using token 123 without any error.
But after login ,it shows error when I click "config " menu.

The web shows:
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.


The listener log shows:
2014-03-22 23:43:14,714 2160 ERROR Exception on /config [GET]
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/flask/app.py", line 1817, in wsgi_app
File "/usr/local/lib/python2.6/dist-packages/flask/app.py", line 1477, in full_dispatch_request
File "/usr/local/lib/python2.6/dist-packages/flask/app.py", line 1381, in handle_user_exception
File "/usr/local/lib/python2.6/dist-packages/flask/app.py", line 1475, in full_dispatch_request
File "/usr/local/lib/python2.6/dist-packages/flask/app.py", line 1461, in dispatch_request
File "/build/ncpa/agent/listener/server.py", line 68, in decorated
File "/build/ncpa/agent/listener/server.py", line 133, in config
File "/usr/local/lib/python2.6/dist-packages/flask/templating.py", line 128, in render_template
File "/usr/local/lib/python2.6/dist-packages/flask/templating.py", line 110, in _render
File "/usr/local/lib/python2.6/dist-packages/jinja2/environment.py", line 969, in render
File "/usr/local/lib/python2.6/dist-packages/jinja2/environment.py", line 742, in handle_exception
File "/usr/local/ncpa/listener/templates/config.html", line 1, in top-level template code
{% extends 'base.html' %}
File "/usr/local/ncpa/listener/templates/base.html", line 43, in top-level template code
{% block content %}
File "/usr/local/ncpa/listener/templates/config.html", line 197, in block "content"
<input type='text' class='input' name='nrds|{{ id }}' id='nrds|{{ id }}' value='{{ config.get("nrds").get(id) }}' {{ accessibility }}>
UndefinedError: 'None' has no attribute 'get'
2014-03-22 23:43:14,716 2160 INFO 192.168.56.1 - - [22/Mar/2014 23:43:14] "GET /config HTTP/1.1" 500 -
2014-03-22 23:43:14,832 2160 INFO 192.168.56.1 - - [22/Mar/2014 23:43:14] "GET /favicon.ico HTTP/1.1" 404 -
sosogh
Posts: 3
Joined: Tue Feb 11, 2014 3:45 am

Re: NCPA API: OSError: [Errno 13] Permission denied

Post by sosogh »

this is ncpa.cfg
Attachments
ncpa.cfg
(995 Bytes) Downloaded 411 times
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NCPA API: OSError: [Errno 13] Permission denied

Post by tmcdonald »

It looks like this might be Ubuntu-specific:

http://support.nagios.com/forum/viewtop ... =6&t=22352

The dev who wrote NCPA will be in tomorrow. I made a note to ask him about it then.
Former Nagios employee
Locked