Ad Widget

Collapse

Key Value or JSON from web server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhlowe
    Junior Member
    • Sep 2015
    • 3

    #1

    Key Value or JSON from web server?

    Hi,
    I have a web app running in several places. I'd like to monitor and graph my custom data. I can request my API and return JSON or Key Value data as part of https check.

    How do I get this simple data into Zabbix? I would rather not have to use the UserParameter and modify the agent. Being able to graph the data and compare it to other hosts is the desired goal.

    Endpoint 1: https://host/api/state?mode=json
    {
    "build": 20170817,
    "transcoders": 0,
    "mem-max": 7589068800,
    "state": "OK",
    "up": 3,
    "bytes-out": 546424224,
    "mem-free": 365000664,
    "bytes-in": 5000,
    "version": "6.0.1",
    "down": 0,
    "connections": 2
    }


    Endpoint 2: https://host/api/state?mode=zabbix

    myapp.build=20170817
    myapp.transcoders=0
    myapp.mem-max=7589068800
    myapp.state=OK
    myapp.up=3
    myapp.bytes-out=546424224
    myapp.mem-free=371305968
    myapp.bytes-in=5000
    myapp.version=6.0.1
    myapp.down=0
    myapp.connections=2


    And of course if would like to check the state for not "OK" and send an alert.. or send an alert if I don't get a 200 response code.

    This seems really basic and highly valuable.. But my zabbix expert and I are struggling with the best way. Any pointers appreciated!
  • tutunak
    Member
    • Mar 2016
    • 32

    #2
    Currently, for this tasks, I'm writing scripts in python. But now you can try to use zabbix 3.4 for this. It allows parsing json, xml and text inside zabbix.

    Comment

    Working...