Ad Widget

Collapse

LLD General Questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dobbz
    Junior Member
    • May 2020
    • 1

    #1

    LLD General Questions

    Working integrating Zabbix with some custom discovery and LLD information but running into a few issues and questions.

    For the most part, I am running UserParameter scripts to return JSON back to the Zabbix Server. I am working on Discovery of ASM diskgroups within the database and am basically returning the data from a Database view which contains the items I wish to track. Currently this is in a JSON array with one index per ASM diskgroup.

    I would like the ASM diskgroups to be fluid in that if new ones show up, Zabbix handles them automatically.

    Example Data Structure (syntax not guaranteed to be correct - for general understanding only)

    [
    {"NAME":"DATA01",
    "TOTAL_MB":"123456",
    "VOTING_FILES":"N"
    },
    {"NAME":"DATA02",
    "TOTAL_MB":"123456",
    "VOTING_FILES":"Y"
    }
    ]

    I have modified the JSON in my script to rename the keys to the Zabbix format (in hopes it might help in processing since I don't think I need any Preprocessing/LDD macros in the Discovery):

    [
    {"{#NAME}":"DATA01",
    "{#TOTAL_MB}":"123456",
    "{#VOTING_FILES}":"N"
    },
    {"{#NAME}":"DATA02",
    "{#TOTAL_MB}":"123456",
    "{#VOTING_FILES}":"Y"
    }
    ]


    Generally speaking, the script I am running takes a few seconds to complete, so I was looking at using the zabbix_sender to return the data. This will not need to process more than once an hour.
    Q1: It appears we can send two different data structures with zabbix_sender. 1) Key/Value pairs with an input file (-i). 2) JSON Array with -o. Is this assumption correct? If so, assuming the key/value option gets converted to JSON anyhow, is it only possible to send multiple array indexes with the JSON array option (is that even possible since you need to specify the key anyhow?)

    Q2: Does discovery by concept need to be it's own process? Or can discovery happen with data that is generally returned from the agent?
    Example: The above data is returned from a UserParameter script. There may be new entries in this JSON array (one index per ASM disk). Can the discovery happen as part of the data parsing? Or does discovery have to happen on its own before the new data in the array index is processed?

    Q3: Provided I am providing Zabbix with all the information it needs - how would Item Prototypes work? I do not want to call another script with the parameter of the diskgroup - since I already provide all the data in the original key (which looks like it's the only option when using a Zabbix agent in the prototype. It appears I can only use a dependent item when I already have the data... I think this is the most confusing part for me right now.

    I want to have Zabbix create an item for all Diskgroups it finds and populate the data from those diskgroups in new items based on the item prototype. If there is a new diskgroup, it accommodates that natively.

    Currently:
    1) Template Created
    2) ASM Diskgroup Discovery returns similar to above data scructure with Zabbix agent calling UserParameter script
    3) Confusion with Item Prototypes. What 'type' should I use since I already have the data. What does the Key look like?

    SHOULD I:
    1) Item Prototype call a different UserParameter key and ONLY return the NAME of the Diskgroup.
    2) If the above, should I have a different UserParameter key for returning ALL the Data and using Zabbix item prototyping off this key?
    3) A complete waste - Use UserParamter with a single diskgroup and have UserParameter get called for each diskgroup separately.
    4) Use Zabbix Sender/Trapper instead of Agent and ditch UserParameter. (and if so, can I work with JSON because the file format of key/value is extremely limiting!)

    Thanks for any help you can provide!
Working...