Ad Widget

Collapse

How to sum all LLD created vfs.file.regexp items?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • avv-zabbix
    Junior Member
    • Oct 2025
    • 3

    #1

    How to sum all LLD created vfs.file.regexp items?

    Hello All,

    I am facing the following situation:
    • Zabbix user for several years, starting 5.x, running 7.4 now.
    • I created (in 7.4) a template with LLD to discover some generic directories: this works fine
    • In the same template, I have item_templates to retrieve a specific information from the same file in all directories: this works fine as well
      vfs.file.regexp[{$REPOSITORY_ROOT}/{#REPO}/config,"^storage_quota *= *([0-9]+[kMGTP]*B*)",,,,\1] along with a preprocessing javascript
      Click image for larger version

Name:	image.png
Views:	68
Size:	62.3 KB
ID:	508350
    • Values are properly retrieved, as unsigned numbers.
      Click image for larger version

Name:	image.png
Views:	26
Size:	24.1 KB
ID:	508351
    Now the issue: I would like to sum all discovered values
    • Following the documentation, I used sum( last_foreach()) as I do for other items
      sum(last_foreach(//vfs.file.regexp[{$REPOSITORY_ROOT}/*/config,"^storage_quota *= *([0-9]+[kMGTP]*B*)",,,,\1]))
    • The formula is accepted by the editor, so considered as valid.
    • But no proper value is returned
    I tried to debug directly from the agent2 level:
    • sum(last_foreach(//vfs.file.regexp[/SOME/DIR/*/config,"^storage_quota *= *([0-9]+[kMGTP]*B*)",,,,\1]))
    • [m|ZBX_NOTSUPPORTED] [Invalid item key format.] is the returned message
    Any recommendation, suggestion, tip?
    Thank you in advance
Working...