Hello everyone!
I have installed Zabbix agent 2 in a Docker container. I would like to read and analyze the logs of other containers.
I created a host on the Zabbix server, added the "Docker by Zabbix agent 2" template. Next, I created an item:
Type: Zabbix agent (active)
Key: log[/var/lib/docker/containers/<container-id>/<container-id>-json.log]
Type: Log
I can read this file locally: cat /var/lib/docker/containers/<container-id>/<container-id>-json.log
But on Zabbiks server displays the status "Not supported" and Info "Cannot obtain information for file "/var/lib/docker/containers/<container-id>/<container-id>-json.log": [2] No such file or directory".
If this worked, then I would have to change the <container-id> in the item when re-creating the container.
How can I set up log collection from containers, even if they are recreated?
I have installed Zabbix agent 2 in a Docker container. I would like to read and analyze the logs of other containers.
I created a host on the Zabbix server, added the "Docker by Zabbix agent 2" template. Next, I created an item:
Type: Zabbix agent (active)
Key: log[/var/lib/docker/containers/<container-id>/<container-id>-json.log]
Type: Log
I can read this file locally: cat /var/lib/docker/containers/<container-id>/<container-id>-json.log
But on Zabbiks server displays the status "Not supported" and Info "Cannot obtain information for file "/var/lib/docker/containers/<container-id>/<container-id>-json.log": [2] No such file or directory".
If this worked, then I would have to change the <container-id> in the item when re-creating the container.
How can I set up log collection from containers, even if they are recreated?
Comment