Ad Widget

Collapse

How to add default items to automatic inventory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • slfields
    Junior Member
    • Aug 2024
    • 6

    #1

    How to add default items to automatic inventory

    Zabbix Server = 7.0.2

    In the automatic inventory enablement for Linux servers, you have two entries that are default configured (System Name and OS version).

    I can add custom automatic items for inventory, but that's specific to the host in question.

    I'm unable to find documentation for V7 in regards to how to add default automatic inventory items for a given class of server (Linux in this case), like the System Name and OS version.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    https://www.zabbix.com/documentation...osts/inventory ?? You need to collect that data from hosts to be able to push it to inventory.

    Comment

    • slfields
      Junior Member
      • Aug 2024
      • 6

      #3
      That wasn't really my question. Zabbix by default, if you enable automatic inventory, get "System Name" and "OS Version" inventory data.

      My question was in regards to how to get other items to automatically populate without having to expressly configure them on a host by host basis.

      I was able to figure this out, though.

      You need to go the template you're using for a given host type (zabbix active agent for linux in our case) and either update an existing item that already gathers the inventory item you're interested in and have it populate the specific inventory item you're interested in, or add a new one (generally, just clone an existing item that's already populating an inventory field) and have it include the specific info you want for a given inventory data field.

      Comment

      • t00m1G
        Junior Member
        • Jan 2024
        • 26

        #4
        Originally posted by slfields
        That wasn't really my question. Zabbix by default, if you enable automatic inventory, get "System Name" and "OS Version" inventory data.

        My question was in regards to how to get other items to automatically populate without having to expressly configure them on a host by host basis.

        I was able to figure this out, though.

        You need to go the template you're using for a given host type (zabbix active agent for linux in our case) and either update an existing item that already gathers the inventory item you're interested in and have it populate the specific inventory item you're interested in, or add a new one (generally, just clone an existing item that's already populating an inventory field) and have it include the specific info you want for a given inventory data field.
        Hey,

        Under this link you have more information about how Zabbix template "Zabbix active agent for linux" works and how it's configured: https://git.zabbix.com/projects/ZBX/...s/linux_active

        If I understand correctly, you want to add additional items, right? but on one host or on more than one? if for only one host you can add it like it's described here: https://www.zabbix.com/documentation...fig/items/item

        You can put here a screenshot of what do you want to change/add, in that way it could be easier to help.

        Comment

        • Brambo
          Senior Member
          • Jul 2023
          • 245

          #5
          Originally posted by slfields
          That wasn't really my question. Zabbix by default, if you enable automatic inventory, get "System Name" and "OS Version" inventory data.

          My question was in regards to how to get other items to automatically populate without having to expressly configure them on a host by host basis.

          I was able to figure this out, though.

          You need to go the template you're using for a given host type (zabbix active agent for linux in our case) and either update an existing item that already gathers the inventory item you're interested in and have it populate the specific inventory item you're interested in, or add a new one (generally, just clone an existing item that's already populating an inventory field) and have it include the specific info you want for a given inventory data field.
          Your (template) item is 'linked' to an inventory field. This linking is optional.
          So if you have items which gathers data you want to use for inventory just make that link. In Zabbix 6.4 and 7.0 the field: Click image for larger version

Name:	image.png
Views:	754
Size:	2.1 KB
ID:	489825

          Comment

          • slfields
            Junior Member
            • Aug 2024
            • 6

            #6
            Correct. As I said, I discovered that. Unfortunately, the inventory documentation in V7 didn't specify that (at least, not that I could determine)

            Comment

            • markfree
              Senior Member
              • Apr 2019
              • 868

              #7
              Originally posted by slfields
              Correct. As I said, I discovered that. Unfortunately, the inventory documentation in V7 didn't specify that (at least, not that I could determine)
              I would argue that the documentation link cyber provided specifies this.
              Host inventory can also be populated automatically. For that to work, when configuring a host the inventory mode in the Inventory tab must be set to Automatic.

              Then you can configure host items to populate any host inventory field with their value, indicating the destination field with the respective attribute (called Item will populate host inventory field) in item configuration.

              Comment

              • slfields
                Junior Member
                • Aug 2024
                • 6

                #8
                Originally posted by markfree

                I would argue that the documentation link cyber provided specifies this.
                Which will reference a link (https://www.zabbix.com/documentation...fig/items/item) which instructs you to create an item for a host. That's not creating a default entry for ANY host.

                As I've experienced, you need to select the template, then select the items and either edit an existing one which already gathers the data you want and then select the inventory entry you want updated with that same info...or select an already existing entry that links to an inventory item, clone it and update it to reference the inventory item you want updated (along with any other settings).

                Comment

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

                  #9
                  As I said.. "You need to collect that data from hosts to be able to push it to inventory." How exactly you do it, via template or directly on host items... it is up to you. Each item (be it in template or in host) has this option as show in Brambo post above.

                  Items documentation describes the concept of creating items. Yes, it says "open host, create item..." But you should not take each chapter of docs too literally... If you read further, concept of templates is introduced... Where all the same principles apply... In the end, template is kept in same table in DB as any host.. It has a bit different type set, but it is still a "special host"..

                  Comment

                  • slfields
                    Junior Member
                    • Aug 2024
                    • 6

                    #10
                    I was able to figure this out on my own.

                    It would have helped if the inventory page (already stated above) distinguished between an individual host item and a global configuration item (aka, template).

                    After all, if I'm inexperienced, my inclination is to look in the inventory documentation, not the template documentation.

                    This is just a suggestion, not claiming the current documentation is incorrect.

                    Comment

                    • slfields
                      Junior Member
                      • Aug 2024
                      • 6

                      #11
                      Originally posted by Donkey
                      I'm confused.
                      Can you elaborate on what you're confused about?

                      Comment

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

                        #12
                        "Zabbix for Donkeys"?

                        Comment

                        Working...