Ad Widget

Collapse

LLD Item Prototype Without Macro

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anwarias
    Junior Member
    • May 2020
    • 4

    #1

    LLD Item Prototype Without Macro

    Hey,

    I would like to create a LLD which discovers if the Linux host is a VM and if so create a single item and trigger.
    Currently i have a create a LLD which returns either:
    [{"{#VIRTUALIZATION_PLATFORM}": "vmware"}] or nothing.

    Now i want to create an item which does not include the macro.
    Item protoype: "my_test_item"
    The problem is that zabbix throws an error that the item already exists.

    Creating the item using the macro works fine (as expected):
    Item prototype: "my_test_item[{#VIRTUALIZATION_PLATFORM}]

    For some items this is possible, but not for all.

    Is this even possible to achieve using a LLD?

    Best Regards
  • niveastn
    Member
    • Oct 2021
    • 82

    #2
    Hi there

    As far as I know, is not possible. Item key had to be unique, so if your item prototype has my_test_item, and the lld discovers more than one line (for instance, discovers 10 hosts), will try to create one item per line, and then you get this error, as it will try to create 10 items with the key my_test_item.
    If this runs locally (is a check that runs per host), create an item that gets this information, without the LLD

    Comment

    • Anwarias
      Junior Member
      • May 2020
      • 4

      #3
      Hey,

      thanks for the answer.

      I can understand that this is a problem IF multiple lines are returned by the discovery.
      But as i control the discovery i can ensure that only one item is returned.
      My json string is always this:
      [{"{#VIRTUALIZATION_PLATFORM}": "vmware"}] or nothing.

      Still i get an error that the item is already existing.
      Why does this happen if there is only one item?

      Best regards

      Comment

      • Semiadmin
        Senior Member
        • Oct 2014
        • 1625

        #4
        Hi, Anwarias.
        If you'd create LLD rule which returns [{"{#VIRTUALIZATION_PLATFORM}": ""}] or [], you may get an item key my_test_item[].

        Comment

        Working...