PVE GUI: Add zfs memory usage to memory graph + monitoing ZFS memory usage in zabbix

g777

New Member
Jun 13, 2024
14
6
3
Greetings,

I use PVE on my server. Some things like FAN, CPU and HDD temperature I monitor with external plugin.
Recently one of my apps had memory leak that ate almost all of RAM and it took a bit of effort to figure out who ate RAM.

Having ZFS ram usage on RAM usage graph would significantly reduce effort.

For example use this command to determine current ZFS RAM usage and render percent to graph in specific color.
Bash:
awk '/^size/ { print $1 " " $3 / 1048576 }' < /proc/spl/kstat/zfs/arcstats
 
As for centralized monitoring I suggest use zabbix.
on host, at /etc/zabbix_agent2.d/zfs_mem.conf:
Code:
#
# ZFS memory use %
#
UserParameter=system.zfs.mempct,echo "scale=2; (`awk '/^size/ { print $3 }' < /proc/spl/kstat/zfs/arcstats`*100)/`free -b | awk '/^Mem:/ { print $2 }'`" | bc

at GUI add template with item:
zfs_mem.jpg

Then add to graph:
- RAM usage %
- ZFS memory usage %

This will give nice overlay showing how much RAM is used for ZFS.
 
@g777 Which version of Zabbix is that on?

Asking because I have a Zabbix 6.0 installation around that I could try this out on. Haven't even looked at the new Zabbix 7.0 release though. ;)
 
@g777 Which version of Zabbix is that on?
I use docker containers:
Server: image: zabbix/zabbix-server-pgsql:ubuntu-6.4-latest
Web: image: zabbix/zabbix-web-nginx-pgsql:ubuntu-6.4-latest
Agent: zabbix_agent2 (Zabbix) 6.0.14

I think it should have no trouble running on any fairly modern version of zabbix.
 
  • Like
Reactions: justinclift

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!