0

I have an LXC container that has 4GB of swap, most of which is free:

# swapon -s
Filename                                Type            Size    Used    Priority
none                                    virtual         4096000 97004   0

However, Zabbix (2.2.5, zabbix-agentd 2.2.7) reports total swap space (and hence free swap space) as zero, and thus reports a problem.

How can I configure Zabbix to recognize the available swap space? Alternatively: is there a newer version of zabbix-agent that does have this problem?

P.Péter
  • 569
  • 2
  • 6
  • 24
  • Latest version is 3.2.6. Question is where and how are you running zabbix agent? Is it in that LXC container? – Jan Garaj May 12 '17 at 14:04
  • Yes, the agent is running in the container. 2.2 is the version supplied in the debian wheezy-backports. – P.Péter May 15 '17 at 07:54

1 Answers1

0

Use official Zabbix repo - I see Zabbix 3.2 for Wheezy there http://repo.zabbix.com/zabbix/3.2/debian/dists/wheezy/

IMHO deploying of Zabbix agent into container is not a good practice. In the theory you can have a thousands containers per host. I prefer to use metrics from the host level. In the theory use https://github.com/monitoringartist/zabbix-docker-monitoring and then you should to be able to obtain container cgroup swap metrics:

docker.mem[cid,total_swap] - total container swap size
docker.mem[cid,swap]       - current container swap usage

Cgroup memory doc: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-memory.html

Jan Garaj
  • 879
  • 1
  • 7
  • 15
  • I may try that approach, but we do not use docker (we use proxmox), and not quite likely to run even dozens of containers, as each container needs about 32GB of RAM and lots of disk (big java application(s) with postgres). – P.Péter May 16 '17 at 07:31
  • docker.mem key doesn't use any Docker feature - it reads only plain cgroup stats, so it can be used for any cgroup based containers: Docker, LXC, LXD, ... – Jan Garaj May 16 '17 at 08:20