Ad Widget

Collapse

zabbix http agent discovery rule

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ofaruk89
    Junior Member
    • May 2021
    • 1

    #1

    zabbix http agent discovery rule

    Hi,


    I have a url, it return me a json page


    Code:
    {
    "status": true,
    "data": {
    "item1": {
    "hit": 65498484105,
    "traffic": 2693298,
    "bandwidth": 649,
    "timezone": "GMT+3"
    },
    "item2": {
    "hit": 235,
    "traffic": 5,
    "bandwidth": 55
    }
    
    ....n count
    
    }
    
    
    
    }

    I need monitor each values with discovery rule, my items and values must be below

    Traffic-item1-hit -> 65498484105
    Traffic-item2-hit ->235
    ....n count

    Traffic-item1-traffic->2693298
    Traffic-item2-traffic->5
    ....n count

    Traffic-item1-bandwidth->649
    Traffic-item2-bandwidth->55
    ....n count


    I create a discovery rule, and i filtered json data with json path ($.data[*]~) in preprocessing section, it return me an array ["item1","item2"]


    Now i need use this array in item prototype. i used same http agent configuration with discovery rule, how i can use my array in item prototype? i need set json path value in my protoype $.data["itemN"]["traffic"] , how i can set dynamically itemN from discovery rule array items?

    or other way what is your advice?.

    Thanks,
  • wylde
    Junior Member
    • Sep 2016
    • 10

    #2
    DId you ever figure this out? I have the follow json output
    Code:
    {
     "ece_admin": {
       "requests": 112,
       "responses": {
         "1xx": 0,
         "2xx": 112,
         "3xx": 0,
         "4xx": 0,
         "5xx": 0,
         "codes": {
           "200": 112
         },
         "total": 112
       },
       "discarded": 0,
       "received": 142438,
       "sent": 5901633
     },
     "ece_proxies": {
       "requests": 44522,
       "responses": {
         "1xx": 0,
         "2xx": 44522,
         "3xx": 0,
         "4xx": 0,
         "5xx": 0,
         "codes": {
           "200": 44522
         },
         "total": 44522
       },
       "discarded": 0,
       "received": 2634867855,
       "sent": 39253115
     }
    }
    $.[*]~ reduces this down to

    Code:
    ["ece_admin","ece_proxies"]
    But now i'm stuck trying to identify this for LLD macros.

    Comment

    Working...