Ad Widget

Collapse

Assign differen macros to hosts with certain discovered mountpoints/FS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muelli
    Member
    • Jun 2021
    • 68

    #1

    Assign differen macros to hosts with certain discovered mountpoints/FS

    Hello forum,

    I need to assign different macros to hosts with certain mountpoints/filesystems.
    Let me explain.

    I use the default template for filesystem discovery "Linux filesystems by Zabbix agent active" right now.
    Now I have hosts that have certain applications with mounted FS like these:
    /u123/something/else
    /u456/something/else
    /u789/something/else
    etc. always in the pattern of /u\d\d\d.+
    Those hosts I want to assign a macro like {$APP_CODE} -> 12345

    Then I have other applications with mountpoints like
    /fancyApp/something/other
    /fancyApp/somehting/different
    etc, so the pattern is /fancyApp/.+
    Those host I want to assign a macro like {$APP_CODE} -> 45678

    Is there a smart way to do this? I was thinking about excluding the above pattern from the default filesystem discovery template and
    create two new discovery templates in which I use these patterns to discover mountpoints, but the builtin item key cannot be reused.

    Any ideas on how I can do this?

    Thanks alot!


    edit: could this be done with a linked template maybe? I exclude the /u\d\d\d.+ from discovery in the main, original fs discovery template?
    But then again, I would need a different item key, wouldn't i? Hmmmm
    Last edited by muelli; 07-07-2022, 08:39.
  • muelli
    Member
    • Jun 2021
    • 68

    #2
    Problem is solved.
    I created a template (1) that collects FS data using the item key vfs.fs.get
    Then I created a new template, linked it to template (1) and got my data as dependent item from said linked master template.

    Comment

    Working...