Ad Widget

Collapse

Adding PB in Units changes the view

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • per.hillerstrom
    Junior Member
    • Aug 2023
    • 18

    #1

    Adding PB in Units changes the view

    Hi, so I am experience for me an strange issue. I'll paste a whole lot of screenshots below - hopefully for a better understanding.

    I have this item defined as Numeric (float) with Regular expression (\d+\.\d+) set. When I open the item and check Latest data in the graph it looks like second screenshot below - see it adds the M at the end and even though 1.43 is a better number than below Last value 1425991.5 number since the value actually should be 1.43 PB.

    Click image for larger version  Name:	image.png Views:	1 Size:	6.4 KB ID:	492905

    Click image for larger version  Name:	image.png Views:	1 Size:	17.6 KB ID:	492906

    But if I add PB in Units field it all ends up like this.

    Click image for larger version  Name:	image.png Views:	1 Size:	9.6 KB ID:	492907

    Click image for larger version  Name:	image.png Views:	1 Size:	5.9 KB ID:	492908

    Click image for larger version  Name:	image.png Views:	1 Size:	18.7 KB ID:	492909

    Can someone please help me understand this and perhaps help me solve it?
    Last edited by per.hillerstrom; 17-10-2024, 14:04.
  • solution
    Senior Member
    • Jun 2020
    • 269

    #2
    try P and not PB


    Wellington

    Comment

    • per.hillerstrom
      Junior Member
      • Aug 2023
      • 18

      #3
      Hi, when I change to just a letter P instead I get this result - so really no big difference other than one letter missing since before. I really do not understand why Zabbix add the letter M in the beginning.

      Click image for larger version

Name:	image.png
Views:	69
Size:	4.8 KB
ID:	492960

      Click image for larger version

Name:	image.png
Views:	81
Size:	18.6 KB
ID:	492959

      Comment

      • moooola
        Junior Member
        • Jul 2024
        • 29

        #4
        Hello.

        I think that the "unit" in Zabbix items is just a display aid and except in special cases( https://www.zabbix.com/documentation...nit-conversion ) ,does not have the function of performing calculations. Zabbix will answer that 1425991.5 (your favorite string) is 1.43M (your favorite string).

        If you want to display 1425991.5 as 1.43PB, create a calculation item that divides the obtained value by 1000000 and rounds to the third decimal place, and set the unit to !PB, or leave the current item as is and create a dependent item. and perform the above calculation.

        There may be a better way, but this is what I came up with.
        Last edited by moooola; 18-10-2024, 08:47.

        Comment

        • per.hillerstrom
          Junior Member
          • Aug 2023
          • 18

          #5
          Originally posted by moooola
          Hello.

          I think that the "unit" in Zabbix items is just a display aid and except in special cases( https://www.zabbix.com/documentation...nit-conversion ) ,does not have the function of performing calculations. Zabbix will answer that 1425991.5 (your favorite string) is 1.43M (your favorite string).

          If you want to display 1425991.5 as 1.43PB, create a calculation item that divides the obtained value by 1000000 and rounds to the third decimal place, and set the unit to !PB, or leave the current item as is and create a dependent item. and perform the above calculation.

          There may be a better way, but this is what I came up with.
          Thanks! Much better!

          Comment

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

            #6
            As already said, that unit is for visual aid and is based on baseunits... if you want PB, store your data in bytes and set unit to B, not something inbetween byte and Petabyte. You are confusing the tool.. If your item returns value in kilo or mega bytes... preprocess it back to bytes and use base unit. Or do as already suggested, preprocess to the end result you want to see and use your own "unit" (that ! in front of it is important)

            Comment

            Working...