Ad Widget

Collapse

LLD discovery with external script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmarkert
    Junior Member
    • Oct 2018
    • 1

    #1

    LLD discovery with external script

    Hi,
    I use a bash script which generates this JSON output:

    {"data": [
    {
    "{#ID}": "1.1",
    "{#NODE_ID}": 1,
    "{#SLOT}": 1,
    "{#STATE}": "healthy",
    "{#CAPACITY}": "479833620480",
    "{#SLOT_TYPE}": "SSD",
    "{#DISK_TYPE}": "SSD",
    "{#DISK_MODEL}": "INTEL_SSDSC2KB480G7",
    "{#HIGH_ENDURANCE}": false,
    "{#DRIVE_BAY}": "E1"
    },

    {
    "{#ID}": "1.2",
    "{#NODE_ID}": 1,
    "{#SLOT}": 2,
    "{#STATE}": "healthy",
    "{#CAPACITY}": "479833620480",
    "{#SLOT_TYPE}": "SSD",
    "{#DISK_TYPE}": "SSD",
    "{#DISK_MODEL}": "INTEL_SSDSC2KB480G7",
    "{#HIGH_ENDURANCE}": false,
    "{#DRIVE_BAY}": "F1"
    },

    ...

    ]
    }

    I would like to use LLD for generating all items automatically and push the values to the ZABBIX server. The script is implemented as "UserParameter=qf2.cluster.slots,/opt/zabbix/share/zabbix/externalscripts/qf2_cluster_slots.sh" in zabbix_agentd.conf (ZABBIX agent is running on server).

    Can someone please explain which steps are necessary for the discovery rule and item prototypes? Type: Agent or Trapper? Examples are very helpful.

    Do I need two different scripts (for item generating and value querying)?

    Thank you very much!

    Martin
Working...