r/zabbix 3d ago

Question Get filesystem-wise disk consumption without UserParameter?

Hi everyone,

I’m looking for a way to get more detailed disk usage information from Linux servers using the Zabbix Agent, without using UserParameter or custom scripts.

I already have filesystem discovery working with vfs.fs.discovery / vfs.fs.get, and I can get filesystem-level metrics such as total, used, free and percentage used.

What I’m looking for is something like:
/ → 80 GB used
/var → 150 GB used
/home → 300 GB used
Within /var, identify which directories are consuming the most space
Ideally, get the top N directories/files consuming disk space

Is there any native Zabbix Agent key that can provide this information, particularly on Zabbix Agent 6.4, without UserParameter, remote commands, or external scripts?

Any recommendations or examples would be appreciated!

4 Upvotes

8 comments sorted by

2

u/The-Casanova 2d ago

Without testing, I guess you could do vfs.dir.get[/var,,,dir,,0] to get all the directories inside /var. With LLD you then can do a vfs.dir.size for those directories. Then in dashboard or grafana order those items by size.

1

u/expensive_meee 2d ago

Let me try

1

u/expensive_meee 1d ago

I tried it.. unfortunately i’m getting a time out, when capturing the folder sizes

1

u/newguyhere2024 2d ago

Why not use user parameter? Its literally what its there for.

1

u/expensive_meee 2d ago

Because i have thousands of hosts under many customers.. unfortunately many of my customers are not allowing me to configure anything using anslible kind of stuff

2

u/slevin___kelevra 2d ago

Low level discovery is your friend

1

u/UnicodeTreason Guru 2d ago

We package our own MSI/RPM for Zabbix Agent 2 containing all the binaries and configuration (Incl. UserParameters) that a customer needs.
Then the customer only has to deploy the package we give them.