Ad Widget

Collapse

Low Level Discovery with dependent item

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • muelli
    Member
    • Jun 2021
    • 68

    #1

    Low Level Discovery with dependent item

    Hello forum,

    I have a little problem with a LLD and dependent items.
    First of all, my discovery delivers me a JSON like this:

    Code:
    [
      {
        "{#FIELD}": "test0",
        "{#KEY}": 1111
      },
      {
        "{#FIELD}": "test1",
        "{#KEY}": 2222
      },
      {
        "{#FIELD}": "test2",
        "{#KEY}": 3333
      },
      {
        "{#FIELD}": "test3",
        "{#KEY}": 4444
      },
      {
        "{#FIELD}": "test4",
        "{#KEY}": 5555
      }
    ]
    Then I created an item prototype that uses {#KEY} of each {#FIELD} to get more information (JSON output) about each FIELDs.
    That works, and I can see these different FIELD data for each KEYs appear in latest data.

    That additional output looks like this:

    Code:
    {
      "version": "1",
      "running": "true",
      "status": "OK",
      "errors": 0,
      "internal": 0
    }
    However, now I want to parse that text output by using a dependent item and get the info using json paths.
    I have done this multiple times before, but not with discovery rules. Strange thing is, I do it the same way as before, the items wont show up in latest data.
    I create the item as usual, type "Dependent item", select my master item (in this case the prototype), use a json path in preprocessing and nothing shows up.

    Am i missing something?
    Any help is appreciated!
    Last edited by muelli; 17-05-2022, 12:51.
  • Answer selected by muelli at 18-05-2022, 08:29.
    muelli
    Member
    • Jun 2021
    • 68

    In the host configuration I cannot see any items. Maybe in Zabbix 6.0 those dont show anymore?

    edit: Oh OK, I think I found the screen you meant, but there are not depentent items as well. I can see the discovered master items but nothing else :/

    edit 2: aaaand by clicking on discovery rules in the screen I now found an exclamation mark/not supported!
    it is really strange, because the error it shows is "cannot find the data array in the received json object".
    That I do not really understand, because
    a) the data array is not needed anymore, according to the documentation
    b) the discovered data is clearly parsed correctly!

    however I fill try to reformat the discovery answer to include the json data object and see what happens

    edit 3: updated to LTS 6.0.4 and the error still shows up.

    edit 4: OK, someone changed the discovery script during the night (automated restore) and that is why the exclamation mark is showing now.
    Sorry for the mixup, I will have it restored and then check the host config page again for the exclamation mark :/

    edit 5: Now the exclamation mark is gone. I re-did the steps and created a dependent item prototype again, and then a new exclamation mark pops up, telling:
    Cannot create item: item with the same key "item.for.testing" already exists

    That is the real problem, I now named the item "item.for.testing.[{#MODULE}] and the item showed finally up.

    Thanks max. for the hint with the host config page.
    Last edited by muelli; 18-05-2022, 08:29.

    Comment

    • muelli
      Member
      • Jun 2021
      • 68

      #2
      For testing purpose I created a dependent item without any preprocessing (this should give the original item data) and this does not show up as well.
      I guess either I am too stupid (possible) or this is a bug in zabbix or it is just not able to do what I want

      Comment

      • max.
        Member
        Zabbix Certified Specialist
        • Apr 2022
        • 40

        #3
        Hello,

        Does your field have an update interval? Dependent items populates only when master receives new data.

        Regards

        Comment

        • muelli
          Member
          • Jun 2021
          • 68

          #4
          Update Intervall is set to 1m in the master item.

          Comment

          • max.
            Member
            Zabbix Certified Specialist
            • Apr 2022
            • 40

            #5
            which type are both your items? have you checked if the dependent item is in unsupported state?
            try to create another dependent item with no preprocessing steps

            Comment

            • muelli
              Member
              • Jun 2021
              • 68

              #6
              Both items are type text.
              the dependent item does not show up at all in latest data! Normally if sth is unsupported I can see that red warning sign and an error text, but here...nothing.
              I already tried creating a basic dependent item with no preprocessing, got nothing as well.

              Comment

              • max.
                Member
                Zabbix Certified Specialist
                • Apr 2022
                • 40

                #7
                Check the status of the item in the host configuration

                Comment

                • muelli
                  Member
                  • Jun 2021
                  • 68

                  #8
                  In the host configuration I cannot see any items. Maybe in Zabbix 6.0 those dont show anymore?

                  edit: Oh OK, I think I found the screen you meant, but there are not depentent items as well. I can see the discovered master items but nothing else :/

                  edit 2: aaaand by clicking on discovery rules in the screen I now found an exclamation mark/not supported!
                  it is really strange, because the error it shows is "cannot find the data array in the received json object".
                  That I do not really understand, because
                  a) the data array is not needed anymore, according to the documentation
                  b) the discovered data is clearly parsed correctly!

                  however I fill try to reformat the discovery answer to include the json data object and see what happens

                  edit 3: updated to LTS 6.0.4 and the error still shows up.

                  edit 4: OK, someone changed the discovery script during the night (automated restore) and that is why the exclamation mark is showing now.
                  Sorry for the mixup, I will have it restored and then check the host config page again for the exclamation mark :/

                  edit 5: Now the exclamation mark is gone. I re-did the steps and created a dependent item prototype again, and then a new exclamation mark pops up, telling:
                  Cannot create item: item with the same key "item.for.testing" already exists

                  That is the real problem, I now named the item "item.for.testing.[{#MODULE}] and the item showed finally up.

                  Thanks max. for the hint with the host config page.
                  Last edited by muelli; 18-05-2022, 08:29.

                  Comment

                  Working...