Skip to content
Branch: master
Find file History
Latest commit c3a4134 Feb 19, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Template vfs File checksum monitor.xml
Template vfs oldest file in folder.xml
userparameter.conf initial commit Feb 19, 2019

Zabbix vfs User parameter


A collection of Zabbix agent User Parameters. To be used on Linux to extend the vfs agent item keys. This collection currently offers the following extensions:

  • vfs.file.age
    • Point the item key to a path of your choice. The script will return the age in seconds of the oldest file in the directory. If no files exist, it returns 0. Example Template.xml provided.
  • vfs.file.discovery
    • Point the User Macro {$PATH} on host level, to a path of your choice. The low level discovery rule will return all file names (without path) via {#FILENAME}. In the example template the vfs.file.cksum is observed. If you need the full path, you can use {$PATH} in the item key, for example: vfs.file.cksum[{$PATH}{#FILENAME}]
  • vfs.dir.discovery
    • Point the User Macro {$PATH} on host level, to a path of your choice. The low level discovery rule will return all directroy names (without path) via {#DIRNAME}. There is currently no example template. You can use the Template vfs File checksum monitor.xml file, and change the Discovery rule to vfs.dir.discovery.


  1. I presume Zabbix agent is already installed and configured.
  2. Copy script file onto target Linux server, for example: /usr/local/bin/
  3. Make script executeable, for example: chmod +x /use/local/bin/
  4. Configure User Parameter in /etc/zabbix/zabbix_agentd.conf or /etc/zabbix/zabbix_agentd.d/userparameter.conf, for example:
    1. UserParameter=vfs.file.age[*],/usr/local/bin/ $1
    2. UserParameter=vfs.file.discovery[*],/etc/zabbix/zabbix_agentd.d/ $1
    3. UserParameter=vfs.dir.discovery[*],/etc/zabbix/zabbix_agentd.d/ $1
    4. Restart Zabbix agent.
  5. Test User Parameter, for example:
    1. zabbix_agentd -t vfs.file.discovery[/root] -> Should return a valid JSON string.
  6. Import example Template into Zabbix Frontend.
    1. For vfs oldest file in folder examine the example items and trigger, and adjust the paths according to your needs.
    2. For vfs File checksum monitor examine the vfs.file.discovery discovery rule and set the user macro {$PATH} on the host level.
    3. Link the template to a host.


These files and templates were tested and created on Zabbix 4.0 and Debian Linux 8&9 amd64. There should be no reason this will not work on older Zabbix versions. Sadly I have no Zabbix 3.x installation available to provide older XML files.

Parts of this GitHub Repository are directly related to ZBXNEXT-712 - low-level discovery of files in a directory. In this ZBXNEXT request is a script example provided by Aleksandrs Saveljevs, but without further manual. I copied and adjusted his script, and wrote this README and example Template.xml, to make his work available to everyone. All credits for the files & belong to Aleksandrs Saveljevs.

Example / Screenshot


root@ftp:/home/user1# zabbix_agentd -t vfs.file.age[/home/ftp/customer/out]
vfs.file.age[/home/ftp/customer/out]                [t|0]


root@debian:/home/user1# zabbix_agentd -t vfs.file.discovery[/home/user1]
vfs.file.discovery[/root]                     [t|{


root@debian:/home/user1# zabbix_agentd -t vfs.dir.discovery[/root]
vfs.dir.discovery[/root]                      [t|{


  • 19 Februar 2019: initial commit.
You can’t perform that action at this time.