Ad Widget

Collapse

Low level discovery using HTTP Agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cerasus
    Junior Member
    • Mar 2020
    • 24

    #1

    Low level discovery using HTTP Agent

    I've been reading the docs on low level discovery here: https://www.zabbix.com/documentation...evel_discovery

    And I've hit the wall with my scenario. Here's my situation:
    • A group of hosts serves a JSON page on port 9999. The JSON has the name of a service and its current status (OK, CRITICAL, WARNING). For example:
      Code:
      [{'service1': 'OK', 'service2', 'CRITICAL'}]
    • The list of these services varies by the host.
    What I did:
    • Created a template.
    • Created a discovery rule that extracts the names of the services and assigns them to a macro named {#SERVICE_NAME}. The rule uses the HTTP Agent method.
    • Attempted to create an item template that would also use HTTP Agent to connect to port 9999 on each machine and using the SERVICE_NAME macro, would retrieve the actual status of each of those services.
    Problem I'm running into

    When defining the template item, I need to define the Key of the item. It must be unique!

    I can't figure out how to embed the macro name into the name of the key when the check type is HTTP Agent. If I just put {#SERVICE_NAME} into the field, it's invalid. It's also invalid when it's part of a string as in: my_key_{#SERVICE_NAME}

    Is there a solution to this?

    Secondary problem

    You will notice that there are two steps in the above setup:
    1. Connect to 9999 to discover the service names.
    2. Connect to 9999 to actually check the status of each service.
    Is there a way to do all that in one connect?
Working...