Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-7497

Please revert ZBXNEXT-7115 where user macro support has been removed from item names

XMLWordPrintable

    • Icon: New Feature Request New Feature Request
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 6.0.0
    • Frontend (F)
    • None
    • Zabbix 6.0.0

      Hi Alexei,

      User macros within item names is used within Zabbix supplied templates (such as IIS) for cases where configurable items (i.e. ports, users, file paths etc...) may be included in the item name for information purposes for example:

      • Template (IIS by Zabbix agent)
        • Item Name = IIS: {$IIS.PORT} port ping

       

      • Template ('IIS by Zabbix agent active')
        • Item Name = IIS: {$IIS.PORT} port ping

       

      • Template (Oracle by ODBC)
        • Item Name = Oracle: Sessions locked over {$ORACLE.SESSION.LOCK.MAX.TIME}s
        • Item Name = Oracle: User '{$ORACLE.USER}' expire password

       

      • Template (Oracle by Zabbix agent 2)
        • Item Name = Oracle: Sessions locked over {$ORACLE.SESSION.LOCK.MAX.TIME}s

       

      We use it also in this way mainly for:

      • Port monitoring - using the port number in the name.
        • Macro Name = {$APP.POSTGRES.POSTGRESQL.CONF.PORT:"postmaster"}
        • Macro Value = 5432
        • Item Name = Process - Listening {$APP.POSTGRES.POSTGRESQL.CONF.PORT:"postmaster"}/TCP (postmaster)
        • Item Name Displayed = Process - Listening 5432/TCP (postmaster)

       

      • Logfile monitoring - using the port number in the name.
        • Macro Name = {$OS.SYSTEM_LOGFILE.CONF.PATH:"messages"}
        • Macro Value = /var/log/messages
        • Item Name = System Logfile ({$OS.SYSTEM_LOGFILE.CONF.PATH:"messages"})
        • Item Name Displayed = System Logfile (/var/log/messages)

       

      The concept is that user macros should be used for things that may be configurable like the above where they may be different on each monitored host such as:

      • System log file locations may change per OS
      • Applications / Databases may be configured to listen on different ports.
      • Applications may be configured to run as different users.

      You could just 'hard-code' the item name like 'Process Listening (postmaster)' but this would mean that the support engineer when looking at latest data make assumptions about what port is being checked or look at the actual item key to see what the port number is. This is probably not ideal.

      Regards

      James

        1. image-2022-09-16-07-51-34-016.png
          179 kB
          Rodrigo P
        2. image-2022-09-16-07-51-45-180.png
          16 kB
          Rodrigo P
        3. image-2022-09-16-07-51-51-667.png
          54 kB
          Rodrigo P
        4. Screen Shot 2022-05-26 at 2.24.45 PM.png
          152 kB
          Cory White
        5. Screen Shot 2022-05-26 at 2.25.09 PM.png
          52 kB
          Cory White
        6. Screen Shot 2022-05-26 at 2.25.20 PM.png
          196 kB
          Cory White

            vmurzins Valdis Murzins
            james.cook000@gmail.com James Cook
            Votes:
            8 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: