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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
preethu.d
Posts: 109
Joined: Wed Nov 25, 2020 11:32 pm

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

Post 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.
You do not have the required permissions to view the files attached to this post.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

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

Post 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
preethu.d
Posts: 109
Joined: Wed Nov 25, 2020 11:32 pm

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

Post by preethu.d »

Hi,

OS level firewall is not enabled on this server.

Regards,
Preethu
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

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

Post 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
preethu.d
Posts: 109
Joined: Wed Nov 25, 2020 11:32 pm

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

Post by preethu.d »

Hi,

I have sent you ncpa_listener log.
Please check.

Regards,
Preethu
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

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

Post 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
preethu.d
Posts: 109
Joined: Wed Nov 25, 2020 11:32 pm

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

Post 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
You do not have the required permissions to view the files attached to this post.
preethu.d
Posts: 109
Joined: Wed Nov 25, 2020 11:32 pm

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

Post by preethu.d »

Hi,

I have sent you the below log file.

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

Regards,
Preethu
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

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

Post 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
You do not have the required permissions to view the files attached to this post.
preethu.d
Posts: 109
Joined: Wed Nov 25, 2020 11:32 pm

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

Post by preethu.d »

Hi,

Thanks for the help, Issue has resolved now.

Regards,
Preethu
Locked