Unable to connect to linux agent

I have a linux machine (red hat) that checkMK cannot talk to. I think the agent was installed manually by someone who has now left. There is a firewall running and I have allowed the port 6556 but it is still not connecting, also with the firewall service stopped. When I run “check_mk_agent” it reports back details so it looks like it is working. Is there a way to check if the agent is listening on port 6556? or possibly a way to uninstall? any help appreciated.

Hi @sksshed,

The best way to ensure it is looking at “/etc/xinet.d/check-mk” file, there is where you specify which port it will bind, which user runs and the allowed IP to poll.
So the steps should be:

  1. Ensure xinetd is running
  2. Make sure there is a file named “check-mk” in xinetd.d
  3. Also if you’re using selinux to allow it.

Let me know if it worked.

Cheers.

There is a file /etc/xinetd.d/check_mk and the file specifies port 6556. However, when I run “systemctl reload xinetd.service”, I receive the error

“Job for xinetd.service failed because the control process exited with error code. See “systemctl status xinetd.service” and “journalctl -xe” for details.”

If I run “systemctl status xinetd.service” I receive the following::

Do you have any more application or system related files there ? apart from the default ones ?
Try to telnet localhost/ip 6556, this should emulate what cmk server does, although you have to allow localhost/127.0.0.1 in check_mk xinetd file if it isn’t present.
and about selinux ? is it enabled ?

I cannot telnet, it looks like the check_mk file is allowing access from any IP, would this include localhost?

Looks like selinux is enabled:

image

yes it would include the localhost.
I would go for a xinetd problem. Can you just simple issue a stop and start ? not restart/reloading.
If it fails you’ll need to look deeper in the logs.

I’m trying to help you debugging what is done but you can uninstall the agent via yum and reinstall it. But I’m not sure if it will fix your problem.

Will stopping xinetd break anything? - we have a live Oracle DB on this box. I’ll try the yum uninstall now

it depends if it’s using something from xinetd as far as I know there is no problem.
Btw a default check_mk xinetd file would look like this:

service check_mk
{
type           = UNLISTED
port           = 6556
socket_type    = stream
protocol       = tcp
wait           = no
user           = root
server         = /usr/bin/check_mk_agent

    # listen on IPv4 AND IPv6 when available on this host
    #flags          = IPv6

# If you use fully redundant monitoring and poll the client
# from more then one monitoring servers in parallel you might
# want to use the agent cache wrapper:
#server         = /usr/bin/check_mk_caching_agent

# configure the IP address(es) of your Nagios server here:
#only_from      = 127.0.0.1 10.0.20.1 10.0.20.2

# Don't be too verbose. Don't log every check. This might be
# commented out for debugging. If this option is commented out
# the default options will be used for this service.
log_on_success =

disable        = no
}

yum uninstall worked, but reinstall was installing an older version. I just tried rpm -i and received the following:

Looks like xinetd is broken :frowning:

yes it was my first guess. Look into os logs maybe messages and see if something pops up

/etc/xinetd.d/check_mk shows the following:

1 Like

yes it is default. My guess would be that you might have another file there that is breaking it.
If you look into os logs do you have anything that pops out ?
look into messages or “journalctl -xe”

Thanks, just tried “journalctl -xe” and cannot see anything in there. Any logs you would recommend looking at?

/var/log/messages ? Although its strange not having nothing in journalctl

It’s working. Strange, just did “systemctl restart xinetd” and it restarted ok, just tried the check_MK server and it is talking to the agent. Thank you for you help.

Somethings just don’t like to be reloaded :stuck_out_tongue: That’s why I was telling you to issue the stop & start :wink:

1 Like

Awesome. Thanks again for your help.

1 Like