Ad Widget

Collapse

Zabbix documentation (4.4) wrong ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zippyzebu
    Junior Member
    • Jul 2020
    • 3

    #1

    Zabbix documentation (4.4) wrong ?

    In https://www.zabbix.com/documentation...stom_lld_rules it is specified as such


    In previous example it is required that the keys match the LLD macro names used in prototypes, the alternative is to extract LLD macro values using JSONPath {#FSNAME} → $.fsname and {#FSTYPE} → $.fstype, thus making such script possible:

    Then the json data given is


    Code:
    [ { "fsname":"/", "fstype":"rootfs" }, { "fsname":"/sys", "fstype":"sysfs" }, { "fsname":"/proc", "fstype":"proc" }, { "fsname":"/dev", "fstype":"devtmpfs" }, { "fsname":"/dev/pts", "fstype":"devpts" }, { "fsname":"/lib/init/rw", "fstype":"tmpfs" }, { "fsname":"/dev/shm", "fstype":"tmpfs" }, { "fsname":"/home", "fstype":"ext3" }, { "fsname":"/tmp", "fstype":"ext3" }, { "fsname":"/usr", "fstype":"ext3" }, { "fsname":"/var", "fstype":"ext3" }, { "fsname":"/sys/fs/fuse/connections", "fstype":"fusectl" } ]

    But if you test in preprocessing step with JSONPath, $.fsname doesn't evaluate. $..fsname does. (note the extra dot)



    Is json path evaluation in lld macros is different from json path in preprocessunf step ?

    Is the documentation wrong ?
  • zippyzebu
    Junior Member
    • Jul 2020
    • 3

    #2
    Hmm it seems lld macro does process this differently preprocessing step. LLD removes the array []. So $.fsname works.

    Comment

    Working...