Ad Widget

Collapse

Depended float item of log item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Amiram
    Member
    • Feb 2021
    • 59

    #1

    Depended float item of log item

    Hey,

    I have create a log item that steam the line from specific log file (this data is not saved - Do not keep history)
    MASTER ITEM:
    - type: Zabbix agent (active)
    - key: log[path_to_file_name,'REGEX of the LINE',,,skip]
    - Type of information: Log
    - Update interval: 1m

    From this item I have created a dependent one:
    DEP ITEM:
    - type: Dependent item
    - key: SomeKey
    - Master item: MASTER ITEM
    - Type of information: Numeric (float)

    With a pre-processing to get specific (numeric) value from the line.

    I get a nice graph from collected data, but I failed to understand how it is calculated.
    In the graph I can see a `corridor` (min-max) and a average line.

    Why I'm getting this results?
    What is the reason of that?
    Why not just one line with a "sample" per line?
    Can I change it so I will get only one line with the REAL per line samples results?


    Click image for larger version

Name:	graph.jpg
Views:	414
Size:	113.6 KB
ID:	434581

    Amiram
  • niveastn
    Member
    • Oct 2021
    • 82

    #2
    Hi!
    Lets see if I can help...


    Why I'm getting this results? What is the reason of that?
    Because of the preprocessing you created in your dependent item. A dependent item, instead of collecting from an external datasource, it collects from the parent item. And what that means?
    your parent item collects: abcd abcd 12 123.2 12. Its "datasource" is the log file.
    The datasource of your dependent item is the parent one. So, this "datasource" has "abcd abcd 12 123.2 12" and from that I "collect" (using preprocessing to extract it) 123.2.
    A better (and official) explanation: https://www.zabbix.com/documentation...ependent_items

    Why not just one line with a "sample" per line? Can I change it so I will get only one line with the REAL per line samples results?
    you could. You just need to change your preprocessing in the dependent item. I dont know how you are doing it, but if you need to play around with regex you can use https://regex101.com/
    It has an explanation of what you are doing, tips, reference, a regex library, and you can even do it for different languages

    Comment

    • Amiram
      Member
      • Feb 2021
      • 59

      #3
      Thank you for the answer.

      My pre-processing is pretty simple, I'm using the `Javascript` to extract the attribute.
      If I referring to your example: "abcd abcd 12 123.2 12" and I wish to get the 123.2
      The `Javascript` look like:
      Code:
          return value.split(' ')[3]
      Any ideas?

      Comment

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

        #4


        Recent data vs longer periods

        For very recent data a single line is drawn connecting each received value. The single line is drawn as long as there is at least one horizontal pixel available for one value.

        For data that show a longer period three lines are drawn - a dark green one shows the average, while a light pink and a light green line shows the maximum and minimum values at that point in time. The space between the highs and the lows is filled with yellow background.

        Comment

        • Amiram
          Member
          • Feb 2021
          • 59

          #5
          Thank you for the help.


          I have change the interval to 1s which solve my problem.

          Comment

          Working...