Ad Widget

Collapse

Zabbix LLD error about not discovered item.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Raido
    Junior Member
    • Jun 2019
    • 13

    #1

    Zabbix LLD error about not discovered item.

    Current setup:

    Agent discovery contains following JSON:
    Code:
    zabbix_agentd -t test.discovery
    test.discovery                                [t|{"data":[{"{#HWSN}":"Hardware serial number", "{#DEBVER}":"Debian OS version"}]}]​
    Template contains following item prototypes:
    Click image for larger versionName:	image.pngViews:	0Size:	138.7 KBID:	454385

    But host gets discovery errors about the items that are not in agent discovery json:
    Cannot create item: item with the same key "test.monitor[{#NETSTATUS}]" already exists.

    Click image for larger version  Name:	image.png Views:	0 Size:	90.4 KB ID:	454386

    Why is that error displayed about non discovered items?​

    Server: Zabbix 6.0.8
    Agent: 5.0.15
  • Singularity
    Member
    • Aug 2020
    • 81

    #2
    For every item created using lld, the key should be unique which is not the case here. You need to check the key in item prototype.

    Comment

    • Raido
      Junior Member
      • Jun 2019
      • 13

      #3
      Can you explain a bit, where I am missing the uniqueness of the item key?

      Comment

      • Singularity
        Member
        • Aug 2020
        • 81

        #4
        There is more than 1 item for each NETTYPE, NETSTATUS and NETTYPEPRIM.

        Zabbix should have created 1 item for each NETTYPE, NETSTATUS and NETTYPEPRIM with the keys you mentioned. ( check the items list )
        Zabbix is again trying to create item for each NETTYPE, NETSTATUS and NETTYPEPRIM but the keys already exist. Which is the reason you are getting the errors.

        Example : There are 2 disks
        1. Zabbix creates item for disk 1 with a key
        2. Zabbix creates item for disk 2 with same key mentioned in point 1. And it fails to do so

        The conclusion is, the key name should be dynamic. Hope this helps

        Comment

        • Raido
          Junior Member
          • Jun 2019
          • 13

          #5
          So I should change item keys like this?:

          Click image for larger version

Name:	image.png
Views:	659
Size:	88.2 KB
ID:	454396

          Comment

          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4807

            #6
            Your discovery seems to return values for only 2 LLD macros... {#HWSN} and {#DEBVER} ... Where do the others appear? NETTYPE, NETSTATUS and NETTYPEPRIM. ? If they are not part of discovery, they are taken literally, so you will get errors about duplicate keys.

            Comment

            • Raido
              Junior Member
              • Jun 2019
              • 13

              #7
              Ah I see.

              In my mind, I am building something like this.

              Theres a script in all agent machine that generates discovery JSON based on script detections.

              Basically discovery JSON varies between different machines.
              host 1 json: [t|{"data":[{"{#HWSN}":"Hardware serial number", "{#DEBVER}":"Debian OS version"}]}]​
              host 2 json: [t|{"data":[{"{#HWSN}":"Hardware serial number"]}]​
              host 3 json: [t|{"data":[{ "{#DEBVER}":"Debian OS version"}]}]​
              and so on.

              All host use same template which has all those json values as items prototypes.
              Then zabbix assigns these hosts items to monitor based on discovery json.

              So like a one template fits all kind of situation.

              Comment

              • cyber
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Dec 2006
                • 4807

                #8
                Dig into Discovery overrides. You may need to "not discover" things, if some stuff is missing..

                Comment

                Working...