Page 1 of 1

Problems with check_ncpa.py on fresh install 5.7.1

Posted: Thu Jul 02, 2020 6:19 am
by lilydalehs
Hi All,

I thought I might try a fresh install of 5.7.1 on a Ubuntu 20.04 server. The server was freshly installed, and I ran the manual installation as per https://assets.nagios.com/downloads/nag ... -Linux.pdf (The only departure from the instructions was that I used sudo ./fullinstall as I was logged in as a non-root user.)

Everything seemed to go ok, but when i tried adding my first server to monitor via ncpa there were issues.

When I run the command /usr/local/nagios/libexec/check_ncpa.py I get the error message
/usr/bin/env: ‘python’: No such file or directory

Regards,
Chris.

Re: Problems with check_ncpa.py on fresh install 5.7.1

Posted: Thu Jul 02, 2020 1:03 pm
by lmiltchev
Have you customized this system, e.g. installing a different version of python from the "default"? It looks like the system doesn't know where the python executable is.

What is the output of the following commands?

Code: Select all

which python
whereis python
python --version

Re: Problems with check_ncpa.py on fresh install 5.7.1

Posted: Thu Jul 02, 2020 3:15 pm
by lilydalehs
Hi lmiltchev,

thanks for the response. This was a brand new install of Ubuntu 20.04 spunup minutes before installing nagios. The only "extra" was the installation of openssh server.

which python => returns nothing

whereis python returns

Code: Select all

python: /usr/bin/python3.8 /usr/bin/python3.8-config /usr/bin/python2.7 /usr/lib/python /usr/lib/python3.8 /usr/lib/python2.7 /etc/python3.8 /etc/python2.7 /usr/local/lib/python3.8 /usr/local/lib/python2.7 /usr/include/python3.8 /usr/include/python2.7 /usr/share/python
python --version returns

Code: Select all

Command 'python' not found, did you mean:

  command 'python3' from deb python3
  command 'python' from deb python-is-python3
Cheers,
Chris.

Re: Problems with check_ncpa.py on fresh install 5.7.1

Posted: Thu Jul 02, 2020 3:47 pm
by lmiltchev
OK, run the following command:

Code: Select all

sudo ln -s /usr/bin/python3.8 /usr/bin/python
then try again:

Code: Select all

which python
python --version
Did you get an output now? If the two commands listed above worked, try the check_ncpa.py plugin again.

Re: Problems with check_ncpa.py on fresh install 5.7.1

Posted: Thu Jul 02, 2020 4:20 pm
by lilydalehs
Hi lmiltchev,

thanks for the response. That command seems to have worked.

which python returns

Code: Select all

/usr/bin/python
python --version returns

Code: Select all

Python 3.8.2
Now, when I run the following command from the commandline on the server
/usr/local/nagios/libexec/check_ncpa.py -H 10.174.64.179 -t 'mytoken' -P 5693 -M cpu/percent -w '20' -c '40' -q 'aggregate=avg'

I get

Code: Select all

b"UNKNOWN: An error occured connecting to API. (Connection error: 'Tunnel connection failed: 403 Forbidden')"
And i also get it if I use the "try test command" from within the service configuration page.

However, the service checks seem to be working within nagios.

I notice that all the commands return a b" at the start of them. Is this normal?

Cheers,
Chris.

Re: Problems with check_ncpa.py on fresh install 5.7.1

Posted: Thu Jul 02, 2020 4:37 pm
by lmiltchev
Download the latest NCPA wizard from here:

http://assets.nagios.com/downloads/nagi ... 7/ncpa.zip

Don't unzip the file, just install it as you would any other wizard:

Admin > System Extensions > Manage Config Wizards > Browse > ncpa.zip > Upload & Install

Let us know if this fixed your issue.

Re: Problems with check_ncpa.py on fresh install 5.7.1

Posted: Thu Jul 02, 2020 5:27 pm
by lilydalehs
Hi lmiltchev,

thanks for the response. Updating the wizard as instructed removed those stray characters from the return and the service checks are working well now.

However, I still can't run the command as a test or from the command line as shown here.

Cheers,
Chris.

Re: Problems with check_ncpa.py on fresh install 5.7.1

Posted: Thu Jul 02, 2020 5:45 pm
by lilydalehs
Ok, I've figured out that the error is due to the system proxy settings. Somehow I need to add a proxy exclusion for local networks so that this can work.

Cheers,
Chris.

Re: Problems with check_ncpa.py on fresh install 5.7.1

Posted: Thu Jul 02, 2020 6:23 pm
by lilydalehs
Hi lmiltchev,

I have this working. Unbelievably, you can't set a network ip range in the no_proxy setting in Ubuntu, but if I use hostnames rather than IP addresses I can get the proxy exclusions working.

Thanks for all your assistance.

Cheers,
Chris.

Re: Problems with check_ncpa.py on fresh install 5.7.1

Posted: Mon Jul 06, 2020 7:31 am
by scottwilkerson
lilydalehs wrote:Hi lmiltchev,

I have this working. Unbelievably, you can't set a network ip range in the no_proxy setting in Ubuntu, but if I use hostnames rather than IP addresses I can get the proxy exclusions working.

Thanks for all your assistance.

Cheers,
Chris.
Glad to hear you have it working!

Locking thread