Ad Widget

Collapse

basic configuration for zabbix server in docker container monitoring its own host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kr1p
    Junior Member
    • Jun 2022
    • 3

    #1

    basic configuration for zabbix server in docker container monitoring its own host

    Hi,
    Im running zabbix server in a docker container where port 10051 is open.
    On the machine running the container i have installed zabbix-agent2 which is running and enabled as a service.
    I can see the machine in my zabbix web frontend : when i click hosts i see the zabbix host and the ping is working on this host.
    However i have a message
    Code:
    Get value from agent failed: cannot connect to [[127.0.0.1]:10050]: [111] Connection refused
    I have tried to change the ip adress in /etc/zabbix/zabbix_agent2.conf but it is the same.

    I ve tried to set up appropriately the docker container so that localhost adress (127.0.0.1) of the host is visible inside the docker container running the server (following this example : https://stackoverflow.com/questions/...gether-in-dock ) , but i still have the same issue with
    a host with network interface as :
    127.0.0.1:10050
    I dont know how to troubleshoot this...Could you help me?
  • kr1p
    Junior Member
    • Jun 2022
    • 3

    #2
    I ve also posted on stackoverflow a more precise post on my problem:
    https://stackoverflow.com/questions/...e-zabbix-serve


    I m running a dockerized version of zabbix server (centos 6.0) on my host. I m also running zabbix-agent2 on this host with configuration of server with ip adress of 127.0.0.1.

    When i go into zabbix frontend web interface i get these error on the detected host:

    When the ip is at default value 127.0.0.1:10050:

    Get value from agent failed: cannot connect to [[127.0.0.1]:10050]: [111] Connection refused
    When i change the default value to 172.17.0.1:10050 (the docker cant identify localhost of the host naturally) :

    Get value from agent failed: ZBX_TCP_READ() failed: [104] Connection reset by peer
    When i go to host and i ping or traceroute the host it works well. When i go to host and i try detect operating system i get the error

    Cannot execute script. sh: sudo: command not found
    What can i do to make the host work properly?

    I have tried to check these posts : Access localhost from docker container (when i use 172.17.0.1).

    I have tried to use network_mode: host but it conflicts with network being defined in the docker-compose.yml

    I have tried this solution How to use the host network, and any other user-defined network together in Docker-Compose? but it doesnt work either

    The port of the docker-compose is well defined and mapped (10051:10051)

    Comment

    • zabb_it
      Junior Member
      • Mar 2024
      • 1

      #3
      Hello guys,

      I'm new to Zabbix, and just trying it out. Looks like a very lot of people and companies using it across the world. I have found few videos on that, regarding setup, different features etc. But looks like this simple thing like monitoring host itself running docker (and even monitoring it with dockerized zabbix-agent) is not supported well. I have found few lines on a Github page about that, but it is not clear enough. So, even using mid-deep web search gives very poor results like this topic. Is it really so damn bad? Almost 2 years gone, but there is still no solution for this issue! Shocking

      Comment

      • André Campos
        Junior Member
        • Feb 2024
        • 1

        #4
        I follow these instrutions and its running fine: Docker Container Monitoring With Zabbix - Zabbix Blog

        Click image for larger version

Name:	image.png
Views:	2460
Size:	124.7 KB
ID:	481200

        Comment

        Working...