Page 1 of 1

UNKNOWN: An error occured connecting to API. (Connection err

Posted: Tue Jul 20, 2021 1:26 am
by preethu.d
Hi,

I am getting the error "UNKNOWN: An error occured connecting to API. (Connection error: '[Errno 111] Connection refused')", on checking the server ncpa_listener service is not running. I tried restarting the service and reinstalling ncpa , but still service is not starting. It is a SUSE linux server (SLES 15 SPI). Please let me know how to fix the issue.

Regards,
Preethu.

Re: UNKNOWN: An error occured connecting to API. (Connection

Posted: Tue Jul 20, 2021 10:11 am
by gsmith
Hi

Make sure port 5693 is open:

Code: Select all

firewall-cmd  --add-port=5693/tcp --permanent
firewall-cmd  --reload
firewall-cmd --list-ports
once that is done test by pointing your browser at [url]https://<ip%20of%20host>:5693[/url]

If that works then the Nagios XI server should be able to connect.

Let me know how it goes.

Thanks

Re: UNKNOWN: An error occured connecting to API. (Connection

Posted: Wed Jul 21, 2021 4:43 am
by preethu.d
Hi,

OS level firewall is not enabled on this server.

Regards,
Preethu

Re: UNKNOWN: An error occured connecting to API. (Connection

Posted: Wed Jul 21, 2021 4:58 am
by gsmith
Hi

Please take a look at /usr/local/ncpa/var/log/ncpa_listener.log.

You can send it to me in a PM for your privacy.

Reply to this message once you have uploaded the log file so I can take a look at it.

Thanks

Re: UNKNOWN: An error occured connecting to API. (Connection

Posted: Wed Jul 21, 2021 7:45 am
by preethu.d
Hi,

I have sent you ncpa_listener log.
Please check.

Regards,
Preethu

Re: UNKNOWN: An error occured connecting to API. (Connection

Posted: Wed Jul 21, 2021 9:38 am
by gsmith
Hi

Edit /usr/local/ncpa/etc/ncpa.cfg and add/edit:
ip=0.0.0.0

Let me know how that works out. If it doesn't work please send me
the /usr/local/ncpa/etc/ncpa.cfg file

Thanks

Re: UNKNOWN: An error occured connecting to API. (Connection

Posted: Fri Jul 23, 2021 12:27 am
by preethu.d
Hi,

I have made changes on the node, and I can see ncpa_listener service is running now. But in Nagios console, I can see it is showing error status information as "CRITICAL: Incorrect credentials given." for all monitors.

Regards,
Preethu

Re: UNKNOWN: An error occured connecting to API. (Connection

Posted: Fri Jul 23, 2021 1:30 am
by preethu.d
Hi,

I have sent you the below log file.

/usr/local/ncpa/etc/ncpa.cfg file

Regards,
Preethu

Re: UNKNOWN: An error occured connecting to API. (Connection

Posted: Fri Jul 23, 2021 9:24 am
by gsmith
Hi

On the remote machine open the file /usr/local/nagios/etc/ncpa.cfg.
Look for the line:
community_string = XXXX
and note the value of XXXX

On the XI server you can either delete the remote machine, and then run the NCPA
wizard again...
-- OR ----
You can go to Configure, Core Config Manager, and select each service of the remote server
and edit it, updating the command with the value of the token found above (XXXX)

In this example it is "mytoken":
Image11.jpg
Let me know how you make out.

Thanks

Re: UNKNOWN: An error occured connecting to API. (Connection

Posted: Wed Jul 28, 2021 12:26 am
by preethu.d
Hi,

Thanks for the help, Issue has resolved now.

Regards,
Preethu