NCPA passive check, Internal Server Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vtenviron
Posts: 3
Joined: Thu Nov 28, 2019 3:52 am

NCPA passive check, Internal Server Error

Post by vtenviron »

Dear All,

All was well until now, but I've a frustrating issue today. I hope you can help.

I wanted to set up a test host (my own laptop) to check out passive monitoring / unconfigured objects.

I installed NCPA 2.2 onto my Windows 10 Enterprise machine, then set it up as you can see in the attachment. Very basic setup, nothing really fancy.

I wanted it to check in to my Nagios XI server (installed on CentOS 7) every N seconds, and send some data so I can see how's that working.

What happens is that nothing appears on the Unconfigured list, and in the log, there're copies of HTML source, apparently from my Nagios server, that indicates internal server errors.

Something like this (excerpt from the NCPA log that's also attached):

Code: Select all

2019-12-03 13:07:19,506:ERROR:ncpa_windows:Stdout or returncode was None, cannot return meaningfully.
Traceback (most recent call last):
  File "C:\ncpa\agent\ncpa_windows.py", line 247, in run_all_handlers
  File "C:\ncpa\agent\passive\nrdp.py", line 115, in run
  File "C:\ncpa\agent\passive\nrdp.py", line 97, in get_xml_of_checkresults
  File "C:\ncpa\agent\passive\nrdp.py", line 56, in make_xml
  File "C:\ncpa\agent\passive\ncpacheck.py", line 84, in run
ValueError: Stdout or returncode was None, cannot return meaningfully.
2019-12-03 13:07:20,617:ERROR:app:Exception on /api/processes/ [GET]
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
  File "C:\Python27\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
  File "C:\Python27\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
  File "C:\Python27\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
  File "C:\Python27\lib\site-packages\flask\app.py", line 1461, in dispatch_request
  File "C:\ncpa\agent\listener\server.py", line 185, in token_auth_decoration
  File "C:\ncpa\agent\listener\server.py", line 946, in api
  File "C:\ncpa\agent\listener\processes.py", line 420, in run_check
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc1 in position 1261: ordinal not in range(128)
2019-12-03 13:07:20,618:ERROR:ncpacheck:Error with JSON: No JSON object could be decoded. JSON was: <!DOCTYPE html>
<html lang='en'>
    <head>
        <title>Page Not Found · NCPA</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="NCPA Web Interface">
        <meta name="author" content="Nagios Enterprises, LLC">
        <link rel="shortcut icon" type="image/png" href="/static/img/ncpa.png" />
        <link rel="icon" type="image/png" href="/static/img/ncpa.png" />
        <link rel='stylesheet' href='/static/css/bootstrap.min.css'>
        <link rel='stylesheet' href='/static/css/font-awesome.min.css'>
        <link rel='stylesheet' href='/static/css/ncpa.css'>
        
        
        <script src='/static/js/jquery.2.2.4.min.js'></script>
        <script src='/static/js/bootstrap.min.js'></script>
        <script src='/static/js/d3.v4.min.js'></script>
        <script src='/static/js/main.js'></script>
        
        
    </head>
    <body style="padding-top: 50px;">
        
        <nav class="navbar navbar-inverse navbar-default navbar-fixed-top">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-left">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="/gui/">NCPA</a>
                </div>
                <div class="collapse navbar-collapse" id="navbar-collapse-left">
                    <ul class="nav navbar-nav">
                        
                    </ul>
                </div>
            </div>
        </nav>
        
        
        
        <div id="main-content-container">
            

<div style="text-align: center;">
    <h1 style="font-size: 12rem; padding: 8rem 0 3rem 0; color: #CCC;">500</h1>
    <p style="font-size: 1.8rem;">There was a internal server error. Please contact your system administrator.</p>
</div>


        </div>
    </body>
</html>
2019-12-03 13:07:20,618:ERROR:ncpa_windows:Stdout or returncode was None, cannot return meaningfully.
Traceback (most recent call last):
  File "C:\ncpa\agent\ncpa_windows.py", line 247, in run_all_handlers
  File "C:\ncpa\agent\passive\nrdp.py", line 115, in run
  File "C:\ncpa\agent\passive\nrdp.py", line 97, in get_xml_of_checkresults
  File "C:\ncpa\agent\passive\nrdp.py", line 56, in make_xml
  File "C:\ncpa\agent\passive\ncpacheck.py", line 84, in run
ValueError: Stdout or returncode was None, cannot return meaningfully.
2019-12-03 13:07:21,729:ERROR:app:Exception on /api/processes/ [GET]
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
  File "C:\Python27\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
  File "C:\Python27\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
  File "C:\Python27\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
  File "C:\Python27\lib\site-packages\flask\app.py", line 1461, in dispatch_request
  File "C:\ncpa\agent\listener\server.py", line 185, in token_auth_decoration
  File "C:\ncpa\agent\listener\server.py", line 946, in api
  File "C:\ncpa\agent\listener\processes.py", line 420, in run_check
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc1 in position 1259: ordinal not in range(128)
2019-12-03 13:07:21,730:ERROR:ncpacheck:Error with JSON: No JSON object could be decoded. JSON was: <!DOCTYPE html>
<html lang='en'>
    <head>
        <title>Page Not Found · NCPA</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="NCPA Web Interface">
        <meta name="author" content="Nagios Enterprises, LLC">
        <link rel="shortcut icon" type="image/png" href="/static/img/ncpa.png" />
        <link rel="icon" type="image/png" href="/static/img/ncpa.png" />
        <link rel='stylesheet' href='/static/css/bootstrap.min.css'>
        <link rel='stylesheet' href='/static/css/font-awesome.min.css'>
        <link rel='stylesheet' href='/static/css/ncpa.css'>
        
        
        <script src='/static/js/jquery.2.2.4.min.js'></script>
        <script src='/static/js/bootstrap.min.js'></script>
        <script src='/static/js/d3.v4.min.js'></script>
        <script src='/static/js/main.js'></script>
        
        
    </head>
    <body style="padding-top: 50px;">
        
        <nav class="navbar navbar-inverse navbar-default navbar-fixed-top">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-left">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="/gui/">NCPA</a>
                </div>
                <div class="collapse navbar-collapse" id="navbar-collapse-left">
                    <ul class="nav navbar-nav">
                        
                    </ul>
                </div>
            </div>
        </nav>
        
        
        
        <div id="main-content-container">
            

<div style="text-align: center;">
    <h1 style="font-size: 12rem; padding: 8rem 0 3rem 0; color: #CCC;">500</h1>
    <p style="font-size: 1.8rem;">There was a internal server error. Please contact your system administrator.</p>
</div>


        </div>
    </body>
</html>
The biggest issue is that I can't seem to find anything useful about this in Apache logs either.

What could be going on, where do I look?

Thanks in advance!
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NCPA passive check, Internal Server Error

Post by cdienger »

The HTML is coming from the NCPA agent itself. It queries itself to get information (system/agent_version for example) before sending it to the XI machine. This would be why you don't see anything on the XI side of things.

Was NCPA working previously? Are you able to run active checks? Try opening a browser on the client and point it to https://localhost:5693, login, and go to the API. This is the API that the passive checks are querying and you can manually submit queries here to test things out.

I loaded your configuration and beyond having to make some changes to fit my lab settings, didn't have to do anything to get it to work. It may have been a bad install. Do you have any AV on the machine that may have prevented it from installing fully?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vtenviron
Posts: 3
Joined: Thu Nov 28, 2019 3:52 am

Re: NCPA passive check, Internal Server Error

Post by vtenviron »

Hey man, thanks for replying :)

Active checks work just fine ever since deployment - I'm actually putting on fix IP hosts as we speak. So that's OK.

About the AV software, I was suspecting ESET's SSL protocol filering... So for the sake of testing, I just removed the whole thing... no joy unfortunately...

https://localhost:5693 - I logged in here, clicked here and there, checked out the API, messed around with it a little... looks okay as far as I can tell.

Not sure what else to check.

I think I'll try this on another machine and tell how it went...
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NCPA passive check, Internal Server Error

Post by cdienger »

Thanks for the update. Keep us posted.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vtenviron
Posts: 3
Joined: Thu Nov 28, 2019 3:52 am

Re: NCPA passive check, Internal Server Error

Post by vtenviron »

Not yet gotten around to it... year-end crazy asylum around here... will update you as soon as I can.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA passive check, Internal Server Error

Post by lmiltchev »

Let us know how it went. We will keep the topic open.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked