Ad Widget

Collapse

JSON LLD Discovery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • martinschilder
    Junior Member
    • Jun 2023
    • 2

    #1

    JSON LLD Discovery

    Hello All,

    I am struggling allot of days now before reaching out here

    My issue is that i have a json output from an API call but i am not able to handle the data as i would like.

    In this data:
    Code:
    [
        {
            "ChannelStatus": {
                "id": 1,
                "active_source_id": 110,
                "is_enabled": 1,
                "program_number": 1,
                "pmt_pid": 301,
                "audio_pid": 1001,
                "title": "Bla Main",
                "enocded_bit_rate": 184284,
                "encoding_mode_id": 18,
                "up_time": 440590,
                "modified": "1687347700092",
                "SourcesStatus": [
                    {
                        "id": 5,
                        "title": "hello.mp3",
                        "source": "hello.mp3",
                        "interface_id": 0,
                        "source_channel_type_id": 2,
                        "priority": 3,
                        "mode_id": 4,
                        "modified": "1687347700092"
                    },
                    {
                        "id": 110,
                        "title": "Bla Main",
                        "source": "testtestetst",
                        "interface_id": 2,
                        "source_channel_type_id": 1,
                        "priority": 1,
                        "mode_id": 4,
                        "modified": "1687347700092"
                    },
                    {
                        "id": 112,
                        "title": "bla Backup",
                        "source": "blalalalala",
                        "interface_id": 2,
                        "source_channel_type_id": 1,
                        "priority": 2,
                        "mode_id": 4,
                        "modified": "1687347700092"
                    }
                ]
            }
        },
        {
            "ChannelStatus": {
                "id": 2,
                "active_source_id": 9,
                "is_enabled": 1,
                "program_number": 2,
                "pmt_pid": 302,
                "audio_pid": 1002,
                "title": "this another Main",
                "enocded_bit_rate": 193501,
                "encoding_mode_id": 18,
                "up_time": 440590,
                "modified": "1687347700092",
                "SourcesStatus": [
                    {
                        "id": 5,
                        "title": "hello.mp3",
                        "source": "hello.mp3",
                        "interface_id": 0,
                        "source_channel_type_id": 2,
                        "priority": 3,
                        "mode_id": 4,
                        "modified": "1687347700092"
                    },
                    {
                        "id": 9,
                        "title": "this another Main",
                        "source": "thisissomething",
                        "interface_id": 2,
                        "source_channel_type_id": 1,
                        "priority": 1,
                        "mode_id": 4,
                        "modified": "1687347700092"
                    }
                ]
            }
        }
        ]
    ​
    So i created a host added an httpagent and i was able to fetch the json.
    Now what i would like to achieve is to create items via discovery and not by doing a $.[0].ChannelStatus.title for the first path and $.[1].ChannelStatus.title

    but via discovery so that i in the end have the title and the active_source_id as a number to do the notifications on.

    I am sorry maybe a noob question but i am really stuck
  • Ignace_Frometon
    Junior Member
    • Dec 2021
    • 26

    #2
    this reddit post should help you : https://webcache.googleusercontent.c...nt=firefox-b-d
    (actually not public on reddit because of API changes protest, but still available in google cache)

    Comment

    • martinschilder
      Junior Member
      • Jun 2023
      • 2

      #3
      Originally posted by Ignace_Frometon
      this reddit post should help you : https://webcache.googleusercontent.c...nt=firefox-b-d
      (actually not public on reddit because of API changes protest, but still available in google cache)
      That didn't brought the holy grail

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #4
        Have you read the relevant section of the documentation? https://www.zabbix.com/documentation...evel_discovery
        You need to describe LLD macros and use them in items prototypes.

        Comment

        Working...