Ad Widget

Collapse

Hosts metrics in one json response.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rick207
    Junior Member
    • Jul 2020
    • 1

    #1

    Hosts metrics in one json response.

    Hello,
    I will appreciate any suggestion how to design monitoring of the hosts. Metrics are available as Json response to http API request. Response contains several objects where each of them represents independent host. Example of the response (pseudo Json):
    {"hosts": [
    "host_1": {
    "metric_1": 1,
    "metric_2": 2
    },
    "host_2": {
    "metric_1": 3,
    "metric_2": 4
    }]
    }

    My first attempt was to do it like this:
    1. Create template which contains macros used in items
    2. Create Item of type Http Agent, which calls API
    3. Create several dependent Items which retrieve interested metrics from p.2 with the help of JsonPath
    4. Create hosts, "host_1", host_2". Each has assigned a template from p.1

    It works, but I'm not sure if this solution is optimal. Every host calls API, gets response with data for all hosts and saves data for itself only. In case the Json has ~100 hosts' metrics, 99 API calls seem to be redundant.
    I would be grateful if you give some hints how to do it better.

    Regards,
    Rick207
Working...