Ad Widget

Collapse

Populate LLD item prototypes values immediately after discovery

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ultranium
    Junior Member
    • Jul 2024
    • 3

    #1

    Populate LLD item prototypes values immediately after discovery

    I created a template with one trapper master Text that receives a JSON array from a remote sender.

    The template also has a discovery rule that parses the master item, with a few item prototypes. These dependent items also parse the same master item.

    Everything seems to be working fine, except for a problem with initial values after the first time master item gets updated.
    After I link the template to a host, and the sender sends its first value, the master item gets updated, the LLD gets executed and creates dependent items from prototypes, but for some reason these new items don't have values. After second and consecutive updates, discovered items refresh their values correctly.

    It's not a big deal if the master item is updated every few minutes, but if it happens, let's say, once ah hour, or, even worse, once a day, there is a chance that critical state of monitored hosts won't be noticed for way too long.

    Am I doing something wrong here, or is it by design? If it supposed to work that way, maybe there is a workaround?
  • Answer selected by Ultranium at 31-07-2024, 11:24.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    I recognize this situation, and in some of my trapper implementations I specifically did so that the script first sent the discovery data, then waited for some time (5s? 10s? I don't remember anymore), and after that it sent the data for the items. That case had update interval of one day, so I didn't want to wait one extra update run to get the data in the newly discovered items.

    But that case had separate item for discovery and the data, so it wasn't a plain master item case.

    I believe the discovery data goes to some kind of internal queue so it is not processed just immediately.

    Markku
    Last edited by Markku; 29-07-2024, 16:30.

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #2
      I recognize this situation, and in some of my trapper implementations I specifically did so that the script first sent the discovery data, then waited for some time (5s? 10s? I don't remember anymore), and after that it sent the data for the items. That case had update interval of one day, so I didn't want to wait one extra update run to get the data in the newly discovered items.

      But that case had separate item for discovery and the data, so it wasn't a plain master item case.

      I believe the discovery data goes to some kind of internal queue so it is not processed just immediately.

      Markku
      Last edited by Markku; 29-07-2024, 16:30.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4806

        #3
        Well.. its kind of obvious, that first run does not save data... at first you have no items, discovery creates those, with all the preprocessing etc... and that's about it, that preprocessing and extraction is not executed, I think its the other process all together... It has always been like that, first run creates items, second one starts to record data...

        Comment

        • Ultranium
          Junior Member
          • Jul 2024
          • 3

          #4
          Originally posted by cyber
          Well.. its kind of obvious, that first run does not save data... at first you have no items, discovery creates those, with all the preprocessing etc... and that's about it, that preprocessing and extraction is not executed, I think its the other process all together... It has always been like that, first run creates items, second one starts to record data...
          OK, good to know that this is how it should be and not a misconfiguration problem. I just thought that if dependent items are created, their values should be populated right away, because the master item already contains a value.

          So, is sending data twice with a small delay is the easiest workaround or there is a better solution?

          Comment

          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4806

            #5
            Not really.. it all depends how often you are going to gather data anyway ... with 5m interval no doubt you can wait that 5 minutes... with 1d interval, yea... might be better to send twice...

            Comment

            • Ultranium
              Junior Member
              • Jul 2024
              • 3

              #6
              Originally posted by cyber
              Not really.. it all depends how often you are going to gather data anyway ... with 5m interval no doubt you can wait that 5 minutes... with 1d interval, yea... might be better to send twice...
              Got it, thanks!

              Comment

              Working...