[ZBX-21660] 1. Failed: cannot extract value from json by path "$[?(@.fsname=='/')].bytes.pfree.first()": no data matches the specified pat Created: 2022 Sep 16  Updated: 2022 Sep 19  Resolved: 2022 Sep 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: None
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Ahesh Lakmal Assignee: Aleksandrs Petrovs-Gavrilovs
Resolution: Won't fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu


Attachments: PNG File image-2022-09-16-03-48-54-874.png     PNG File image-2022-09-16-03-49-17-499.png     PNG File image-2022-09-16-03-49-49-357.png    

 Description   

Steps to reproduce:

  1. Create Template for Linux disk space
  2. Create Discover Rule (mounted file system)
    preprocessing Json path - $[?(@.fsname=='/')].bytes.pfree.first()
    LLD Macro ({#FSNAME} - $.fsname) ( {#FSTYPE} - $.fstype)
    Filters ({#FSTYPE} matches @File systems for discovery
  1. Create Item prototype (Free Disk Space on {#FSNAME} (%))
    key: vfs.fs.size[ {#FSNAME},pfree|#FSNAME},pfree]
    no Preprocessing

    # Create a trigger prototype (   Low Disk Space less than 5%)

    # Add template to the host

    Result:
    Error
    Preprocessing failed for: [{"
    {#FSNAME}

    ":"/sys","{#FSTYPE}":"sysfs"},{"

    {#FSNAME}

    ":"/proc","{#FSTYPE}":"proc"},{"
    {#FSNAME}

":"...
1. Failed: cannot extract value from json by path "$[?(@.fsname=='/')].bytes.pfree.first()": no data matches the specified path


 

Data (zabbix_get -s 127.0.0.1 -k vfs.fs.get)

 

[{"fsname":"/dev","fstype":"devtmpfs","bytes":
{"total":1011806208,"free":1011806208,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":247023,"free":246654,"used":369,"pfree":99.850621,"pused":0.149379}},{"fsname":"/run","fstype":"tmpfs","bytes":
{"total":208801792,"free":208195584,"used":606208,"pfree":99.709673,"pused":0.290327}
,"inodes":{"total":254881,"free":254350,"used":531,"pfree":99.791667,"pused":0.208333}},{"fsname":"/","fstype":"ext4","bytes":
{"total":20995383296,"free":15323693056,"used":4711186432,"pfree":76.485077,"pused":23.514923}
,"inodes":{"total":1310720,"free":1075174,"used":235546,"pfree":82.029266,"pused":17.970734}},{"fsname":"/dev/shm","fstype":"tmpfs","bytes":
{"total":1043992576,"free":1043992576,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":254881,"free":254880,"used":1,"pfree":99.999608,"pused":0.000392}},{"fsname":"/run/lock","fstype":"tmpfs","bytes":
{"total":5242880,"free":5242880,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":254881,"free":254877,"used":4,"pfree":99.998431,"pused":0.001569}},{"fsname":"/sys/fs/cgroup","fstype":"tmpfs","bytes":
{"total":1043992576,"free":1043992576,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":254881,"free":254860,"used":21,"pfree":99.991761,"pused":0.008239}},{"fsname":"/run/cgmanager/fs","fstype":"tmpfs","bytes":
{"total":102400,"free":102400,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":254881,"free":254880,"used":1,"pfree":99.999608,"pused":0.000392}},{"fsname":"/run/cgmanager/fs","fstype":"tmpfs","bytes":
{"total":102400,"free":102400,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":254881,"free":254880,"used":1,"pfree":99.999608,"pused":0.000392}},{"fsname":"/run/cgmanager/fs","fstype":"tmpfs","bytes":
{"total":102400,"free":102400,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":254881,"free":254880,"used":1,"pfree":99.999608,"pused":0.000392}},{"fsname":"/run/cgmanager/fs","fstype":"tmpfs","bytes":
{"total":102400,"free":102400,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":254881,"free":254880,"used":1,"pfree":99.999608,"pused":0.000392}},{"fsname":"/run/cgmanager/fs","fstype":"tmpfs","bytes":
{"total":102400,"free":102400,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":254881,"free":254880,"used":1,"pfree":99.999608,"pused":0.000392}},{"fsname":"/run/user/1000","fstype":"tmpfs","bytes":
{"total":208797696,"free":208797696,"used":0,"pfree":100.000000,"pused":0.000000}
,"inodes":{"total":254881,"free":254870,"used":11,"pfree":99.995684,"pused":0.004316}}]

 



 Comments   
Comment by Aleksandrs Petrovs-Gavrilovs [ 2022 Sep 19 ]

Hello,

Do we I understand correctly, that preprocessing step itself is added to the Discovery rule, not the item prototype?

Best Regards,
Aleksandrs

Comment by Ahesh Lakmal [ 2022 Sep 19 ]

I just try to do extra work for LLD with disk space. 

Generated at Sun Jul 06 18:35:18 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.