it-novum / openitcockpit-agent-go

Cross-Platform Monitoring Agent for openITCOCKPIT written in Go
https://openitcockpit.io/download_agent/
Apache License 2.0
5 stars 2 forks source link

dockertats does not work #59

Closed viruz82 closed 3 years ago

viruz82 commented 3 years ago

Agent Mode:

Versions

Operating system Ubuntu 20.04.3 LTS

Describe the bug If I activate the dockerstats theres no conection possible anymore. The error is "Return code of 255 is out of bounds". I already set export DOCKER_API_VERSION=1.40 but this seems to have no effect.

To Reproduce Steps to reproduce the behavior:

  1. Deactivate the dockerstats and it works
  2. Activate dockerstats and it doesn't work anymore

What can I do? Thanks for any help.

nook24 commented 3 years ago

What version of docker is installed on your system? Please post the output of:

dpkg -l |grep -e "container\|docker"
viruz82 commented 3 years ago

I hope a screenshot is okay because I only have my mobile phone at the moment.

Screenshot_2021-09-06-09-57-16-95

nook24 commented 3 years ago

I was not able to reproduce your issue. But i noticed that it took the agent 13 seconds to execute the docker check in my case:

DEBU[0003] Begin Check:  docker
DEBU[0004] Webserver: Request:  10.212.134.15:49994   GET   /
DEBU[0016] Finish Check:  docker

So maybe the agent runs in a timeout on your system? You should try to increase the check interval of the agent to 60 seconds. Maybe this resolves the issue.

# Determines in seconds how often the agent will schedule all internal checks
interval = 30

Also, after you have started the Agent, you should wait at least the configured interval before trying to query the results via HTTP.

To run the agent in debug mode you can use:

systemctl stop openitcockpit-agent

/usr/bin/openitcockpit-agent --config /etc/openitcockpit-agent/config.ini -d

https://github.com/it-novum/openitcockpit-agent-go/wiki/Debugging#start-in-foreground

I already set export DOCKER_API_VERSION=1.40 but this seems to have no effect.

I had not to set this to my environment, because there was no error message like Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40.

I tried to install the exact same version as you use

[08:08]root@docker-focal~# dpkg -l |grep -e "container\|docker"
ii  containerd.io                        1.4.9-1                                    amd64        An open and reliable container runtime
ii  docker-ce                            5:20.10.8~3-0~ubuntu-focal                 amd64        Docker: the open-source application container engine
ii  docker-ce-cli                        5:20.10.8~3-0~ubuntu-focal                 amd64        Docker CLI: the open-source application container engine
ii  docker-ce-rootless-extras            5:20.10.8~3-0~ubuntu-focal                 amd64        Rootless support for Docker.
ii  docker-scan-plugin                   0.8.0~ubuntu-focal                         amd64        Docker scan cli plugin.
ii  openitcockpit-docker-compose         1.29.1-20210831120502focal                 amd64        docker compose packaged for openitcockpit
ii  python3-docker                       4.1.0-1                                    all          Python 3 wrapper to access docker.io's control socket
ii  python3-dockerpty                    0.4.1-2                                    all          Pseudo-tty handler for docker Python client (Python 3.x)
[08:08]root@docker-focal~#
viruz82 commented 3 years ago

Thanks for your test! Increasing the intervall did it.