Fresh install not working

Hi guys. just did a fresh install of checkmk Version: 1.6.0p13 on my ubuntu 18.04 and I also installed the agent of the same version to monitor the same host that I have the check server.

I can access the web interface, but when I go to add the host in WATO, I getting error messages during the scan:

Full scan finished after 1.51 s at 2020-07-28 21:24:53. Found no services yet. To retry please execute a full scan.
Job details
Starting job…

  • FETCHING DATA
    [agent] Execute data source
    [agent] ERROR: Communication failed: [Errno 111] Connection refused
    [piggyback] Execute data source
    No piggyback files for ‘localhost’. Skip processing.
    No piggyback files for ‘127.0.0.1’. Skip processing. Completed.

the agent is working here is the output of the command:

check_mk_agent | head

<<<check_mk>>>
Version: 1.6.0p13
AgentOS: linux
Hostname: XXXXXXXX
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
<<>>

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

any clues?

Have you tried to query the agent over TCP? Please check if port 6556 is open and try to connect via e.g. telnet localhost 6556.

2 Likes

I guess you need to install xinetd.

Hi, xinetd is installed.

Hi marass,
nope, telnet is not working:

$ telnet localhost 6556
Trying ::1…
Trying 127.0.0.1…
telnet: Unable to connect to remote host: Connection refused

Then please follow this guide https://checkmk.com/cms_agent_linux.html to install xinetd as @r.sander suggested.

Is there something like firewalld running on the host and blocking port 6556?

What about systemd? I thought newer cmk versions switched to systemd and socket activation.
What does systemctl status check_mk.socket say?

Hi Marass,

xinetd is installed.

Thank you

$ sudo systemctl status check_mk.socket
Unit check_mk.socket could not be found.

thank you

Please try to check if it is started and if the Checkmk part is installed.

Hi r.sander.

Actually I don’t know. This is a VPS from Namecheap hosting. How do I check?

Thank you.

You could check if “iptables -L” shows you something.

Hi marrass here is my xinetd status:

$ sudo service xinetd status

  • xinetd.service - LSB: Starts or stops the xinetd daemon.
    Loaded: loaded (/etc/init.d/xinetd; generated)
    Active: active (running) since Wed 2020-07-29 21:39:14 UTC; 16h ago
    Docs: man:systemd-sysv-generator(8)
    Tasks: 7 (limit: 2322)
    CGroup: /system.slice/xinetd.service
    |- 749 /usr/sbin/xinetd -pidfile /run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6
    |- 6219 in.telnetd: ppp-119-76-128-236.revip17.asianet.co.th
    |- 6220 login -h ppp-119-76-128-236.revip17.asianet.co.th -p
    |- 6224 in.telnetd: 78.189.22.168.static.ttnet.com.tr
    |- 6230 login -h 78.189.22.168.static.ttnet.com.tr -p
    |-31454 in.telnetd
    `-31976 in.telnetd

seems to me that checkmk is not there.

thank you.

Hi,
my iptables is empty:

$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Thank you.

Do you have any Checkmk related file in /etc/xinetd.d like /etc/xinetd.d/check_mk? If so, what’s its content? It should somehow similar to

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
}

Hi Dirk,

yes I have. here is my folder:

:/etc/xinetd.d$ ls -la
total 72
drwxr-xr-x 2 root root 4096 Jul 29 21:32 .
drwxr-xr-x 96 root root 4096 Jul 29 21:36 …
-rw-r–r-- 1 root root 640 Feb 5 2018 chargen
-rw-r–r-- 1 root root 313 Feb 5 2018 chargen-udp
-rw-r–r-- 1 root root 2237 Jul 28 19:39 check_mk
-rw-r–r-- 1 root root 322 Jul 29 21:29 check_mk_agent
-rw-r–r-- 1 root root 2256 Jun 10 08:58 check_mk.dpkg-dist
-rw-r–r-- 1 root root 502 Feb 5 2018 daytime
-rw-r–r-- 1 root root 313 Feb 5 2018 daytime-udp
-rw-r–r-- 1 root root 391 Feb 5 2018 discard
-rw-r–r-- 1 root root 312 Feb 5 2018 discard-udp
-rw-r–r-- 1 root root 422 Feb 5 2018 echo
-rw-r–r-- 1 root root 304 Feb 5 2018 echo-udp
-rw-r–r-- 1 root root 312 Feb 5 2018 servers
-rw-r–r-- 1 root root 314 Feb 5 2018 services
-rw-r–r-- 1 root root 281 Jul 28 20:58 telnet
-rw-r–r-- 1 root root 569 Feb 5 2018 time
-rw-r–r-- 1 root root 313 Feb 5 2018 time-udp

and here is the content for check_mk_agent
$ more check_mk_agent
service check_mk
{
type = UNLISTED
port = 6556
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/local/bin/check_mk_agent
only_from = 127.0.0.1
disable = no
}
and the content for check_mk

/etc/xinetd.d$ more check_mk

±-----------------------------------------------------------------+

| ____ _ _ __ __ _ __ |

| / _| | ___ ___| | __ | / | |/ / |

| | | | '_ \ / _ / __| |/ / | |/| | ’ / |

| | |___| | | | / (| < | | | | . \ |

| _|| ||_|_||___|| |||_\ |

| |

| Copyright Mathias Kettner 2014 mk@mathias-kettner.de |

±-----------------------------------------------------------------+

This file is part of Check_MK.

The official homepage is at http://mathias-kettner.de/check_mk.

check_mk is free software; you can redistribute it and/or modify it

under the terms of the GNU General Public License as published by

the Free Software Foundation in version 2. check_mk is distributed

in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-

out even the implied warranty of MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE. See the GNU General Public License for more de-

tails. You should have received a copy of the GNU General Public

License along with GNU Make; see the file COPYING. If not, write

to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,

Boston, MA 02110-1301 USA.

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

    # 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        = yes

}
thank you.

So you have two files for the same service (check_mk).

The first says

only_from = 127.0.0.1
disable = no    

And the second says

only_from = 127.0.0.1
disable = yes

I’d guess that might be a reason. No idea, which one is taken into account by xinetd, but maybe the disable=yes wins.

Yes, you were right. I change it to no and it worked. now everything is fine.

So I don’t need 2 files? 1 for the server and other for the agent? only one is fine?

on another topic? I only have one warning on my services tab:

WARN - [Check_MK Discovery] no unmonitored services found, no vanished services found, 1 new host labels

is there something to do here?

thank you.

I suggest doing a service discovery for that host.