Ad Widget

Collapse

Convert String to Integer on zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • higor
    Junior Member
    • Jan 2020
    • 6

    #1

    Convert String to Integer on zabbix

    Heello i have one issue about the zabbix interaction with AWS CloudWatch.

    so, i'm using one script that make call to CloudWatch then take some information(for exemple: CPU avarage) and i'm using External script to do this job, But when i recieve the content of response on zabbix the content arrive as string but i need it to be a Integer to use unit in %.
    Do you know how i can do this?
    Click image for larger version

Name:	zabbix-forum.png
Views:	3264
Size:	7.3 KB
ID:	435563
  • ISiroshtan
    Senior Member
    • Nov 2019
    • 324

    #2
    I see it complaints that it's a string, but would you be so kind as to first change "Type of information" of your item to "Numeric (float)", to be inline with what you actually receiving, and then try again to push new data? Pretty sure it should solve your problem.

    Comment

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

      #3
      Agreed. I have seen it before, when using int instead of float.
      That error message is a bit off tho... Not saying that "your float number does not fit unsigned int filed" but "string is not fitting unsigned int"... Confusing.

      Comment

      • higor
        Junior Member
        • Jan 2020
        • 6

        #4
        If i change the item and alter the type to "string" like a Text, log etc... It's work because the value that i'm receiving of the script for zabbix is string and i don't know why. but i need one number(integer or float)
        Last edited by higor; 26-11-2021, 19:52.

        Comment

        • ISiroshtan
          Senior Member
          • Nov 2019
          • 324

          #5
          Did you try to set it to "Numeric (float)"?

          Comment

          • higor
            Junior Member
            • Jan 2020
            • 6

            #6
            yes, in this image is in "numeric (float)"

            Comment

            • ISiroshtan
              Senior Member
              • Nov 2019
              • 324

              #7
              In the image you added to initial question it clearly states ".. not suitable for Numeric (unsigned)..."

              Comment

              • higor
                Junior Member
                • Jan 2020
                • 6

                #8
                yes... the issue is "how i can send this value as a Numeric using external ecripts" it's possible?

                Comment

                • vicbc
                  Member
                  • Nov 2021
                  • 39

                  #9
                  Hey Higor.

                  Just as ISiroshtan said: As long as it`s values is formated as numeric (float), it should be responding to Zabbix as such.
                  Take a double check just to confirm that the item type is Numeric(float).

                  If the problem persists, try to run the script on shell, and verify the value. Check if the result doesn't have double quotes (" ") around it (which would make it a String value).
                  If you make those verifications, and it still doesn't work, could you send your script so we can take a quick look at it?

                  Cheers

                  Comment

                  Working...