Ad Widget

Collapse

monitoring podman rootless containers with Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dcatalin
    Junior Member
    • Sep 2017
    • 1

    #1

    monitoring podman rootless containers with Zabbix

    Hello,

    I need to monitor some podman rootless containers, and i wonder if is a way to use zabbix agent or zabbix agent 2 for that. I tried to use the template for Docker containers, and for that i've done the following things:
    1. Set docker alias for podman
    2. Run zabbix-agent2 under the user which run the rootless containers.

    The template refuse to discover podman rootless containers.

    Thank you!
  • kmp
    Junior Member
    • Apr 2018
    • 2

    #2
    I was about to start looking at doing this myself. I'm curious whether you have the podman service (`podman.socket`) enabled?

    Comment

    • jmb
      Junior Member
      • Jul 2007
      • 14

      #3
      If you have the zabbix agent 2 running on the host (and not as as a container).
      containers run as user "podman
      "

      Enable podman service as podman user

      # su - podman

      $ systemctl --user enable podman.service
      $ systemctl --user start podman.service

      Because of permissions

      # usermod -G podman zabbix
      # chmod 750 /run/user/$(id -u podman)
      # echo "Plugins.Docker.Endpoint=unix://run/user/$(id -u podman)/podman/podman.sock" >> /etc/zabbix/zabbix_agent2.d/plugins.d/docker.conf
      # systemctl restart zabbix-agent2.service

      A little bit ugly, but it works

      Comment

      • studero
        Member
        • Aug 2023
        • 84

        #4
        Hi all,

        I have a similar problem. I run podman as root user. What I need to configure ?
        Because I have the following error:
        # zabbix_get -s 'hostname' -k docker.info
        ZBX_NOTSUPPORTED: Cannot fetch data: Get "http://1.28/info": dial unix /run/podman/podman.sock: connect: permission denied. zz0.xzgfriri88zz

        On the host I have enable the podman.service
        ]# systemctl status podman.service
        ○ podman.service - Podman API Service
        Loaded: loaded (/usr/lib/systemd/system/podman.service; enabled; preset: disabled)
        Active: inactive (dead) since Tue 2024-04-30 14:26:13 CEST; 23min ago

        I need help
        Regards
        Olivier

        Comment


        • Carlos Zimmer
          Carlos Zimmer commented
          Editing a comment
          The zabbix user needs to have access to the Docker socket file. The zabbix user should be added to the docker group to resolve the following error messages.

        • markfree
          markfree commented
          Editing a comment
          The path to the socket file must have permissions as well.
      • markfree
        Senior Member
        • Apr 2019
        • 868

        #5
        I don't think this is an optimal solution, as it requires additional steps to allow Zabbix to monitor user containers.

        I've created this discussion on GitHub that shows some of these steps. Even if you do this, the permissions for the temporary directories created for Podman will be lost after a reboot.

        Also, the current Docker plugin configuration file only allows for one socket at a time. So, if you have multiple users, each with their own Pod, you can only monitor one user at a time with the docker plugin.

        Unless you use custom parameters or an external check, for now I don't see how to monitor multiple user containers on the same host.

        Comment

        Working...