Page 1 of 1

UNKNOWN: Error occurred while running the plugin. Use the ve

Posted: Thu Apr 11, 2019 4:24 am
by vasilij
Hi,

Nagios Agent on Windows7 return an error:
UNKNOWN: Error occurred while running the plugin. Use the verbose flag for more details.
I have that error only with Process Count. CPU Usage and Memory Usage working as well.
Image
NCPA client version is 2.1.6
check_ncpa.py plugin version is 1.1.5
Firewall is also turned off on client PC

Can you help me?

Thanks

Re: UNKNOWN: Error occurred while running the plugin. Use th

Posted: Thu Apr 11, 2019 3:21 pm
by scottwilkerson
Can you show what command is being run?

Have you tried running the command from the CLI?

Re: UNKNOWN: Error occurred while running the plugin. Use th

Posted: Fri Apr 12, 2019 2:40 am
by vasilij
HI Scott,

Thanks for fast answer.
Yeap, I have tried:
Image

Re: UNKNOWN: Error occurred while running the plugin. Use th

Posted: Fri Apr 12, 2019 8:43 am
by scottwilkerson
Can you run this from the CLI and show the output

Code: Select all

curl -k "https://172.16.6.56:5693/api/processes?check=true&warning=150&critical=200&token=hibike" -vvv
Also can you attach your ncpa.cfg from the client server, also the logs from

Code: Select all

C:\Program Files (x86)\Nagios\NCPA\var\log

Re: UNKNOWN: Error occurred while running the plugin. Use th

Posted: Fri Apr 12, 2019 9:08 am
by vasilij
That's the output:

Code: Select all

 curl -k "https://172.16.6.56:5693/api/processes?check=true&warning=150&critical=200&token=hibike" -vvv
*   Trying 172.16.6.56...
* TCP_NODELAY set
* connect to 172.16.6.56 port 5693 failed: Verbindungsaufbau abgelehnt
* Failed to connect to 172.16.6.56 port 5693: Verbindungsaufbau abgelehnt
* Closing connection 0
curl: (7) Failed to connect to 172.16.6.56 port 5693: Verbindungsaufbau abgelehnt
itops@vsr19-003:~$ curl -k "https://172.16.6.56:5693/api/processes?check=true&warning=150&critical=200&token=hibike" -vvv
*   Trying 172.16.6.56...
* TCP_NODELAY set
* Connected to 172.16.6.56 (172.16.6.56) port 5693 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=US; ST=Minnesota; L=St. Paul; O=Nagios Enterprises, LLC; OU=Development; CN=PC14-015
*  start date: Apr 12 13:58:31 2019 GMT
*  expire date: Apr  9 13:58:31 2029 GMT
*  issuer: C=US; ST=Minnesota; L=St. Paul; O=Nagios Enterprises, LLC; OU=Development; CN=PC14-015
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
> GET /api/processes?check=true&warning=150&critical=200&token=hibike HTTP/1.1
> Host: 172.16.6.56:5693
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 500 INTERNAL SERVER ERROR
< Content-Type: text/html; charset=utf-8
< Content-Length: 2225
< Date: Fri, 12 Apr 2019 13:59:55 GMT
<
<!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>

Re: UNKNOWN: Error occurred while running the plugin. Use th

Posted: Fri Apr 12, 2019 9:51 am
by lmiltchev
I think the issue is caused by the non-ascii characters in the process name.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 363: ordinal not in range(128)
Our developers believe that when we switch to Python 3, we should no longer have this issue. For more information on the issue, see this:

https://github.com/NagiosEnterprises/ncpa/issues/439

https://github.com/NagiosEnterprises/ncpa/issues/509

https://github.com/NagiosEnterprises/ncpa/issues/499

You could probably try using some custom powershell script that gives you the desired output, and call it via NCPA.