Ad Widget

Collapse

Populate the inventory fields. Tip

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheBonaZabbix
    Member
    • Feb 2023
    • 67

    #1

    Populate the inventory fields. Tip

    Hi everyone.
    I have created hosts with the discovery process.
    The discovery process processes a JSON file. From this processing I get some macros that contain values that I would like
    to end up in the Inventory section (eg Hostname, Interface).

    I don't understand how to do it. Do you have a suggestion?

    Click image for larger version

Name:	image.png
Views:	629
Size:	13.4 KB
ID:	466469
    Thank you
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    The following option is more suitable for your task - you make a master item that receives json and several dependent items with jsonpath preprocessing that extract the necessary data. In these items, the inventory fields are filled in.
    You can disable data storage in all items - at the same time, inventory data will be filled in.

    Comment

    • TheBonaZabbix
      Member
      • Feb 2023
      • 67

      #3
      HI. Hamardaban, many thanks you for your answer.
      Unfortunately it is not very clear to me.
      Would you be so kind as to provide me with some additional information?


      1) I created an Item of type 'External Check' which receives data in JSON format from an external script

      2) So I created a Discovery Rule that creates the various hosts using the data contained in the JSON

      You wrote:
      -you make a master item that receives json--> I think it's already ok. That's my point 1)
      -and several dependent items with jsonpath preprocessing that extract the necessary data--> This point is not clear to me. Could you give me some more help? I would be really grateful.

      Grazie
      Ciao
      Andrea

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #4
        Inventory fields are filled in at the host level and takes data from items. Right?
        So you need to create several items for each host that will fill in the inventory fields for this host.
        I suggested making one main item that would receive json (one or the other) and several dependent items that "parse" the data:
        https://www.zabbix.com/documentation...ependent_items
        I didn't know that you create hosts using LLD- in this case, the task becomes more complicated because you need to work with templates and assign them to prototypes of hosts.

        You're welcome
        Last edited by Hamardaban; 26-06-2023, 15:17.

        Comment

        • TheBonaZabbix
          Member
          • Feb 2023
          • 67

          #5
          Thank you very much for the time dedicated to me.
          Unfortunately they are still on the high seas.
          I really have no idea how to do it.
          If you have the patience to explain it with an example I would be very grateful.
          If you don't feel like it, I thank you anyway.
          Grazie Hamardaban !

          This is the my Host Prototype​
          Click image for larger version

Name:	image.png
Views:	591
Size:	41.4 KB
ID:	466524

          Comment

          Working...