Ad Widget

Collapse

item prototype problem expanding macro in url with HTTP agent type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jag_wef
    Junior Member
    • Aug 2019
    • 1

    #1

    item prototype problem expanding macro in url with HTTP agent type

    Hi,
    I am currently trying to connect prometheus gathering information from node-exporter to a zabbix monitoring system.

    I managed to get discovery rule with following LLD macros:

    URL requested :http://XXXXXXX/api/v1/query?query=node_disk_io_now{device="sda"}
    Preprocessing JSONPATH:$.data.result

    GOT
    {#NAME} -> $.metric.device
    {#NODE} -> $.metric.instance
    {#VALUE} -> $.value[1]

    thus I tried to create from item prototype
    Name -> {#NODE}-{#NAME}
    Type -> HTTP agent
    Key -> device-[{#NODE}]
    URL -> http://XXXXXXX/api/v1/query?query=node_disk_io_now{device="'{#NAME}'",instance="'{#NODE}'"}
    I try with " ' " and without around macro: I also tried directly http://XXXXXXXX/api/v1/query/query?=node_disk_io_now{device="sda",instance="XXX X:XXX"} int the URL field and its working fine.

    I suspect something going on with prometheus using "{" in its syntax. But I do now how to make it work

    thank you for your help
    ps : we tryed to use LLD macro as we intend to deploy this on cluster not knowing in advance nodes.

    The test is undertook on a zabbix 4.2 running inside a docker.


    Last edited by jag_wef; 07-08-2019, 13:43.
Working...