Ad Widget

Collapse

Macro with multiple values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • afurtenbacher
    Junior Member
    • Nov 2013
    • 2

    #1

    Macro with multiple values

    Hi,

    I am new to Zabbix and have a problem with the following: I have created an item that uses a user macro. I would like to use the same item with multiple values. For example I want to check some cluster volumes for free space. The item is always the same, but the path to the volumes differs. I have also tried to add the same macro multiple times, but this isn't allowed.
    How can I have one item and use it with multiple parameters/macro values?

    Thank you for your help,
    Andreas
  • afurtenbacher
    Junior Member
    • Nov 2013
    • 2

    #2
    noone an idea?

    Comment

    • nuno.pereira
      Junior Member
      • Apr 2012
      • 2

      #3
      Zabbix doesn't permit to use the same item for getting multiple values at once. So, you can't put multiple values in the same MACRO, and you'll need to use several macros for that purpose.

      But, if you want to check multiple similar items, the Low-level discovery https://www.zabbix.com/documentation...f_file_systems might be a solution for you. In that topic to which I sent you, "Discovery of file systems", there's a solution to monitor file systems a host.

      For other stuff other than network interfaces, SNMP output or file systems, where you need to check multiple things in the same way, but with different parameters, custom LLD rules are the solution.

      But, in LLDs things like trigger dependency, bulk edit and others aren't available.

      Comment

      • steveboyson
        Senior Member
        • Jul 2013
        • 582

        #4
        That really calls for a low level discovery rule.
        Write a script which outputs all neccessary values and feed them into autocreated items.

        Pls. see Zabbix doc for the concept behind that.
        LLD or "low level discovery"

        Comment

        • karlism
          Junior Member
          • Sep 2015
          • 10

          #5
          Hello,

          I would like to bring this question up again in case if something has changed since original author posted it.

          The problem I am trying to solve is following - I want to keep a macro that would contain multiple values with list of domain names that should be checked. This list would be maintained manually and discovery is not an option in my case as service provider doesn't provide any kind of API for their service.

          Is it possible to store all required domain names in single macro similar to what LLD macros have? If not, is it possible to discover them in template somehow if macros have similar names, lets say, {$DOMAIN_NAME1}, {$DOMAIN_NAME2}, {$DOMAIN_NAME3}... ?

          I understand that it is possible to achive this by using LLD and some kind of dumb script that would just return domain names for me, but that doesn't seem to be very elegant, besides it would be more convenient to maintain this list from Zabbix GUI.

          Thanks!

          Comment

          • Glide
            Junior Member
            • Jan 2021
            • 10

            #6
            karlism this is quite old but I have pretty much the same issue here.
            I'm trying to trigger things on multiple domains for each host.
            More specifically, I'm trying to monitor a simple webscenario on each domains.

            Comment

            • karlism
              Junior Member
              • Sep 2015
              • 10

              #7
              Glide, sorry, I haven't used Zabbix for couple of years, so can't help with this. I would highly recommend switching to Prometheus though.

              Comment

              • Glide
                Junior Member
                • Jan 2021
                • 10

                #8
                Thx I'll check this one, I didn't know it.

                Comment

                • vicbc
                  Member
                  • Nov 2021
                  • 39

                  #9
                  Hey guys, what's up.

                  I know it's an old post and all, but seems that your problem could be solved with the use of Context Macros.

                  https://blog.zabbix.com/context-macr...n-zabbix/7764/

                  There's a explanatory video in the link too.


                  Cheers.

                  Comment


                  • vicbc
                    vicbc commented
                    Editing a comment
                    Sorry in advance, I was refering this solution to Glide 's problem.
                • Glide
                  Junior Member
                  • Jan 2021
                  • 10

                  #10
                  Thanks vicbc.
                  It didn't jump out at me that I could use Context Macros for that, but I'll check.

                  Comment

                  Working...