UNKNOWN: An error occured connecting to API. (Connection err
UNKNOWN: An error occured connecting to API. (Connection err
Hi Team,
I am getting the below error for a linux server.
"UNKNOWN: An error occured connecting to API. (Connection error: '[Errno 111] Connection refused')"
I tried uninstalling and reinstalling NCPA but still issue remains same.
port 5693 is not listening and there is no internal firewall enabled on the server.
attached the logs.
Regards,
Preethu
I am getting the below error for a linux server.
"UNKNOWN: An error occured connecting to API. (Connection error: '[Errno 111] Connection refused')"
I tried uninstalling and reinstalling NCPA but still issue remains same.
port 5693 is not listening and there is no internal firewall enabled on the server.
attached the logs.
Regards,
Preethu
You do not have the required permissions to view the files attached to this post.
Re: UNKNOWN: An error occured connecting to API. (Connection
Code: Select all
error: [Errno 97] Address family not supported by protocol
Code: Select all
ip = 0.0.0.0
Code: Select all
systemctl restart ncpa_listener
If it's still not working, attach your ncpa.cfg from the remote system and send this information:
What OS/version is the remote system running?
Code: Select all
uname -a
cat /etc/*release
Re: UNKNOWN: An error occured connecting to API. (Connection
Hi,
I have made the changes but issue persists. I have attached the screenshot with OS details and ncpa.cfg file.
ncpa version:ncpa-2.2.2-1x86_64
Regards,
Preethu
I have made the changes but issue persists. I have attached the screenshot with OS details and ncpa.cfg file.
ncpa version:ncpa-2.2.2-1x86_64
Regards,
Preethu
You do not have the required permissions to view the files attached to this post.
Re: UNKNOWN: An error occured connecting to API. (Connection
Hello @preethu.d
Thanks for providing the details, want to take a look at verbose details on the 'ncpa_listener' service restart. We are still unclear as to what is causing it to throw the error(s).
Please provide the results on the /tmp/ncpa_results.txt.
Thanks,
Perry
Thanks for providing the details, want to take a look at verbose details on the 'ncpa_listener' service restart. We are still unclear as to what is causing it to throw the error(s).
Code: Select all
systemctl restart nagios.service && journalctl -u ncpa_listener.service > /tmp/ncpa_results.txt && journalctl -u ncpa_listener.service -o verbose >> /tmp/ncpa_results.txt
Thanks,
Perry
Re: UNKNOWN: An error occured connecting to API. (Connection
Hi Perry,
I have sent the requested log via PM.
Regards,
Preethu
I have sent the requested log via PM.
Regards,
Preethu
Re: UNKNOWN: An error occured connecting to API. (Connection
Hello @preethu.d
Thanks for following up, after reviewing of the ncpa.cfg, we want to move the 'ip = 0.0.0.0' up to the "listener configuration (daemon)".
Please send the '/tmp/ncpa.txt' so we can review the configuration and info.
Thanks,
Perry
Thanks for following up, after reviewing of the ncpa.cfg, we want to move the 'ip = 0.0.0.0' up to the "listener configuration (daemon)".
Restart the 'ncpa_listener' and view the status:# -------------------------------
# Listener Configuration (daemon)
# -------------------------------
#
[listener]
#
# User and group to run plugins as (recommended to use nagios:nagios)
# Default: uid = nagios
# Default: gid = nagios
#
# ** Note - The daemon runs as root, but forks a child process when running a plugin
# that is defined by the user, for security reasons. However, without the main daemon
# running as root, much of the system information would be missing. This is typical behavior. **
#
# This is for Unix only (Linux, Mac OS X, etc)
#
uid = nagios
gid = nagios
#
# IP address and port number for the Listener to use for the web GUI and API
#
# :: allows for dual stack (IPv4 and IPv6 on most linux systems) but will only allow
# for IPv6 connections on Windows
# 0.0.0.0 allows for IPv4 connections only on Windows and most linux systems
#
# Default: ip = ::
# Default (Windows): ip = 0.0.0.0
# Default: port = 5693
#
ip = ::,0.0.0.0
# port =
Code: Select all
systemctl restart ncpa_listener
Code: Select all
systemctl status ncpa_listener
Code: Select all
sudo ss -tulpn | grep -Ei 'LISTEN|ESTABLISHED' > /tmp/ncpa_listener.txt
Thanks,
Perry
Re: UNKNOWN: An error occured connecting to API. (Connection
Hi Perry,
I have made the changes and sent you the log via PM.
Regards,
Preethu
I have made the changes and sent you the log via PM.
Regards,
Preethu
Re: UNKNOWN: An error occured connecting to API. (Connection
Hello @preethu.d
Thanks for sending the 'netstat' info over, and we don't see anything related to ncpa service or port, but we do know that everything is reference ipv4.
Let's find out if server will listen on port 5693 ruling out ncpa on your server by:
My test server we then see:
Results:
Then;
Please let us know how things look,
Perry
Thanks for sending the 'netstat' info over, and we don't see anything related to ncpa service or port, but we do know that everything is reference ipv4.
Let's find out if server will listen on port 5693 ruling out ncpa on your server by:
Code: Select all
ssh root@localhost -L 5693:localhost:5693
Code: Select all
sudo ss -tulpn | grep -Ei 'LISTEN|ESTABLISHED'
Let's see if 'ncpa_listener' will connect on port 5693 going through the ssh tunnel:tcp LISTEN 0 128 127.0.0.1:5693 0.0.0.0:* users:(("ssh",pid=199174,fd=7))
Code: Select all
systemctl start ncpa_listener
Code: Select all
systemctl status ncpa_listener
Perry
Re: UNKNOWN: An error occured connecting to API. (Connection
Hi Perry,
I have executed the steps but ncpa_listener service still shows active (exited)
It shows output for port 5693 as below.
tcp LISTEN 0 128 127.0.0.1:5693 0.0.0.0:* users:(("ssh",pid=133982,fd=4))
Regards,
Preethu
I have executed the steps but ncpa_listener service still shows active (exited)
It shows output for port 5693 as below.
tcp LISTEN 0 128 127.0.0.1:5693 0.0.0.0:* users:(("ssh",pid=133982,fd=4))
Regards,
Preethu
Re: UNKNOWN: An error occured connecting to API. (Connection
Hello @preethu.d
Thanks for following up, appears that you were able to verify 'ncpa_listener' service on port 5693 is listening through forward.
To verify ncpa_listener status:
Do you get check results on 'check_ncpa.py' (linux)
Let me know how things are looking,
Perry
Thanks for following up, appears that you were able to verify 'ncpa_listener' service on port 5693 is listening through forward.
To verify ncpa_listener status:
Code: Select all
systemctl status ncpa_listener
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H yourhostaddresshere -P 5693 -t yourtokenhere -M 'disk/logical/|boot/used_percent' -w 80 -c 90
Perry