Ad Widget

Collapse

How to create customized names for the autodiscoverd mounted filesystems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lfain
    Junior Member
    • Feb 2021
    • 3

    #1

    How to create customized names for the autodiscoverd mounted filesystems

    Hi,
    I use Zabbix for monitoring some LXD servers. The "Mounted filesystems discovery" discovers the container filesystems and creates items with names "Free disk space on {#FSNAME}". Due to the fact that the filesystem mount points are very long strings, the item names don't look nice in the 'Last data". For example "Free disk space on /var/lib/lxd/storage-pools/default/containers/SLT" where SLT is the container name.
    I am looking for a way to automatically create/change the item names to something like "Free disk space on SLT".
    Any idea?
    Thank you,
    Leonid
  • otterit
    Junior Member
    • Jun 2020
    • 2

    #2
    Hi,

    You may try to use the macro functions: https://www.zabbix.com/documentation...acro_functions

    It allows you to perform a regex and output something transformed based on captured groups. Like the regex ^.+\/([^\/]+)$ should give you the last path. and so it would be {{#FSNAME}.regsub("^.+\/([^\/]+)$", \1}

    Comment

    • lfain
      Junior Member
      • Feb 2021
      • 3

      #3
      Good idea. I'll try.
      Thank you very much!
      Leonid

      Comment

      Working...