UNKNOWN: An error occured connecting to API

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
wagnbeu0
Posts: 27
Joined: Tue Nov 03, 2015 5:28 am

UNKNOWN: An error occured connecting to API

Post by wagnbeu0 »

Since last week I have on about 50 servers the following problem:
PING is working, but for all services the status is orange, and the infmroation behind each of them is:

UNKNOWN: An error occured connecting to API. (Connection error: '[Errno 111] Connection refused')

We already checked the local firewall and turned them off, but the problem still exists.
We are using Nagiox XI5.8.7.

Are there any script which can test the connection between Nagios Server and Client and make sure that all needed ports are up and running?
I would assume that Port 5666 TCP is the default port, but is there any chance to run a connection test manually and where are the logfile which error occurs?
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: UNKNOWN: An error occured connecting to API

Post by pbroste »

Hello @wagnbeu0

Thanks for reaching out, do you know any changes or updates around the same time when notice the no response.

Let's check the following:
  • Run 'check_nrpe' on command line to host:
  • [list]
  • Code: Select all

    /usr/local/nagios/libexec/check_nrpe -H <yourhostaddresshere>
[*]Verify that the NRPE or 'xinetd' is running (depending on NRPE install either running under 'nrpe' or 'xinetd')[/*]
  • Code: Select all

    ps -eo 'tty,pid,comm' | grep -Ei 'nrpe|xi'
[*]Sounds like you have already verified the firewall and security applications:[/*] [/list]

Option to enable logging in '/usr/local/nagios/var/nrpe.log' by enabling the option in '/usr/local/nagios/var/nrpe.cfg'. By removing the '#' in the logging line option and the restarting the NRPE service.

Please set us know how things look,
Perry
wagnbeu0
Posts: 27
Joined: Tue Nov 03, 2015 5:28 am

Re: UNKNOWN: An error occured connecting to API

Post by wagnbeu0 »

On the Nagios Server:
/usr/local/nagios/libexec/check_nrpe -H Hostname.domainname
NRPE v3.2.1

On Both Server and Client:
ps -eo 'tty,pid,comm' | grep -Ei 'nrpe|xi'

? 122020 xinetd

On NAgios Server:
systemctl status nrpe xinetd
● nrpe.service - Nagios Remote Plugin Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: http://www.nagios.org/documentation

● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-12-20 10:56:39 CET; 21h ago
Main PID: 996 (xinetd)
CGroup: /system.slice/xinetd.service
└─996 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.


On Client:
systemctl status nrpe xinetd
Unit nrpe.service could not be found.
● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-12-20 13:56:09 CET; 18h ago
Process: 122018 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS (code=exited, status=0/SUCCESS)
Main PID: 122020 (xinetd)
Tasks: 1
CGroup: /system.slice/xinetd.service
└─122020 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid

On Both systems:
lsof -i:5666
-no output

sestatus:
SELinux status: disabled

The file /usr/local/nagios/var/nrpe.cfg does not exist, we are using Nagios XI 5.8.7
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: UNKNOWN: An error occured connecting to API

Post by pbroste »

Hello @wagnbeu0

Thanks for following up with the details, appears that NRPE daemon is not listed and want to go through the install:

https://support.nagios.com/kb/article/n ... rpe-8.html
or
https://support.nagios.com/kb/article.php?id=515

Please let us know how things look,
Perry
Locked