Ad Widget

Collapse

How to set up docker monitoring on Windows 11?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nom77
    Member
    • Mar 2017
    • 34

    #1

    How to set up docker monitoring on Windows 11?

    I can't configure the monitoring of the docker, which is on Windows 11,
    zabbix 6.2 is on a virtual machine that I downloaded from the official website

    After installing zabix agent zabbix_agent2-6.2.8-windows-amd64-openssl.msi in windows 11, the zabbix user did not appear, there is no one to give rights to the docker group, and there is a docker group

    On the zabix server, there is a connection with an agent on port 10050, but there are no metrics for docker
    metrics from the default template Docker by Zabbix agent 2 do not go

    if you write on the zabbix server
    zabbix_get -s 192.168.0.89 -k docker.info
    writes
    Unknown metric docker.info​

    I found this entry in the agent logs on windows

    2023/03/23 21:55:13.712409 received passive check request: 'docker.containers' from '192.168.0.15'
    2023/03/23 21:55:13.712409 [1] processing update request (1 requests)
    2023/03/23 21:55:13.712409 [1] registering new client
    2023/03/23 21:55:13.712409 Calling C function "new_global_regexp()"
    2023/03/23 21:55:13.712925 [1] cannot monitor metric "docker.containers": Unknown metric docker.containers

    does this mean the agent is compiled without docker support ?​​​
  • max_bz
    Junior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2023
    • 17

    #2
    Hi
    You need to do some additional things, to monitor Docker containers on Windows

    Firstly:
    Go to the Zabbix official repository on GitHub: https://github.com/zabbix/zabbix-docker.
    Click on the "Scripts" folder.
    Download the following scripts:
    • docker_discovery.ps1
    • docker_info.ps1
    • docker_stats.ps1
    Save them in the C:\Program Files\Zabbix Agent2\scripts on your Windows 11 machine.

    Then modify Zabbix agent configuration file. Add the following lines:
    Code:
    UserParameter=docker.discovery[*],powershell -ExecutionPolicy Bypass -File "C:\Program Files\Zabbix Agent2\scripts\docker_discovery.ps1" "$1"
    UserParameter=docker.info[*],powershell -ExecutionPolicy Bypass -File "C:\Program Files\Zabbix Agent2\scripts\docker_info.ps1" "$1" "$2"
    UserParameter=docker.stats[*],powershell -ExecutionPolicy Bypass -File "C:\Program Files\Zabbix Agent2\scripts\docker_stats.ps1" "$1" "$2" "$3"
    Save the configuration file and restart the Zabbix agent2 service.​

    After that you should be able to use the following items:
    • docker.discovery: This item will discover all running Docker containers.
    • docker.info: This item will retrieve information about a specific Docker container, such as its name, ID, status, etc.
    • docker.stats: This item will retrieve statistics about a specific Docker container, such as its CPU usage, memory usage, network usage, etc.

    Comment


    • nom77
      nom77 commented
      Editing a comment
      I couldn't find the Scripts folder by link https://github.com/zabbix/zabbix-dockers

      docker_discovery.ps1
      docker_info.ps1
      docker_stats.ps1
      these files could not be found even through google.com, maybe there is an error in the name? or give plz an exact link
  • nom77
    Member
    • Mar 2017
    • 34

    #3
    I found such a file at this link https://github.com/zabbix/zabbix-doc...agent2/windows file docker-entrypoint.ps1
    maybe that's what you meant?​

    Comment

    • max_bz
      Junior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Mar 2023
      • 17

      #4
      Originally posted by nom77
      I found such a file at this link https://github.com/zabbix/zabbix-doc...agent2/windows file docker-entrypoint.ps1
      maybe that's what you meant?​

      Hm, sorry for miscommunication. Link in not active, some king of old info.

      You can try these scripts. But they were created by me using content found on the Internet.
      Attached Files

      Comment

      • nom77
        Member
        • Mar 2017
        • 34

        #5
        The information on the zabbix server for the template Doker by Zabbix agent 2 does not appear
        but when i wited
        zabbix_get -s 192.168.0.89 -k docker.info

        I see
        "docker inspect" requires at least 1 argument.
        See 'docker inspect --help'.

        Usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...]

        Return low-level information on Docker objects
        "docker inspect" requires at least 1 argument.
        See 'docker inspect --help'.

        Usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...]

        Return low-level information on Docker objects
        "docker inspect" requires at least 1 argument.
        See 'docker inspect --help'.

        Usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...]

        Return low-level information on Docker objects
        "docker inspect" requires at least 1 argument.
        See 'docker inspect --help'.

        Usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...]

        Return low-level information on Docker objects
        "docker inspect" requires at least 1 argument.
        See 'docker inspect --help'.

        Usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...]

        Return low-level information on Docker objects
        {
        "data": {
        "Status": {

        },
        "Ports": {

        },
        "Name": {

        },
        "ID": {

        },
        "Image": {

        }
        }
        }

        Comment

        • Muhach
          Junior Member
          • Jan 2024
          • 1

          #6
          I have the same problem. Have anyone found a good solution?

          Comment

          Working...