Ad Widget

Collapse

Float item type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simsaull
    Junior Member
    • Nov 2013
    • 7

    #1

    Float item type

    Hello all!
    we use a custom script to monitor our NAS that outputs data to zabbix_sender.
    The item memory_free was set as a Numeric, with "B" unit.
    After upgrading the filer to a bigger model with more RAM, the script outputs this value for memoy_free : 7.15443e+09
    So Zabbix rejects that value as it's not numeric. I tried to change the type to float and it doesnt work either.

    When I try to send that value manually with zabbix_sender in verbose mode all I get is :
    zabbix_sender [13327]: DEBUG: answer [{
    "response":"success",
    "info":"Processed 0 Failed 1 Total 1 Seconds spent 0.000055"}]
    Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000055"
    sent: 1; skipped: 0; total: 1

    Any idea why?

    Thanks.
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    Why don't you simply change the script and let it output kB or MB? Stay on "B" in zabbix but set a custom multiplier in Zabbix to re.get the correct values
    If you receive the value in kilobyte, use 1024

    Comment

    • simsaull
      Junior Member
      • Nov 2013
      • 7

      #3
      Hello steveboyson, thanks for you answer.

      I do not want to change the script simply because it is used to monitor different NAS systems, small ones and bigger ones. Using a float type for "memory_free", Zabbix still accepts integer values returned by the script when monitoring the small filers, so it seems like a good solution.

      So back to my question : what is wrong about "7.15443e+09" being a float? This would be a valid value for float variable in C right?

      Thanks again.

      Comment

      • EnigmA-X
        Senior Member
        Zabbix Certified Specialist
        • Oct 2010
        • 116

        #4
        What version of Zabbix are you using on client and server?

        You wrote that you are using Numeric for the item type. Is that Numeric (unsigned) or Numeric (float)?

        Comment

        • simsaull
          Junior Member
          • Nov 2013
          • 7

          #5
          Hum, yes I realized that I have not been very accurate.

          I was using "Numeric (unsigned)", worked perfectly, now I'm trying to use "Numeric (float)".

          I am running Zabbix 1.8.6 on the server and v1.8.6 (revision 20932) on the client.

          Thanks

          Comment

          • EnigmA-X
            Senior Member
            Zabbix Certified Specialist
            • Oct 2010
            • 116

            #6
            Ehm, I'm not a C-programming expert, but...

            A float is 32 bits long, has a precision of 7 digits. While it may store values with very large or very small range (+/- 3.4 * 10^38 or * 10^-38), it has only 7 significant digits.

            For the large numbers you are monitoring, I really urge to start using integers instead of floats. It makes no sense to me, to use the precision of floats for such large numbers, because imho the 7 significant digits is a huge drawback in this specific case and integers will give you much more precision.

            Comment

            Working...