Ad Widget

Collapse

snmp string to float conversion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #46
    Originally posted by Vitaly
    Just updated zabbix to v1.6.4 - The same problem.
    Please double check you are running 1.6.4...
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • vrtareg
      Senior Member
      • May 2006
      • 293

      #47
      Updated to 1.6.4.

      Quoted number strings converted normally.

      Thanks
      Areg

      Comment

      • Vitaly
        Junior Member
        • Oct 2008
        • 11

        #48
        I'm positive
        - Installed 1.6.4. Restart
        - Checked graphs - no data.
        - Applied patch, installed again.
        - Works fine.

        Comment

        • JoelG
          Member
          • Aug 2007
          • 32

          #49
          Fix?

          I did a quick review of the code in to see how it was fixed, and I could not identify any code that deals with this condition.

          Has anyone updated to the latest version and seen it work?

          Comment

          • georgew
            Member
            • Mar 2008
            • 50

            #50
            I'm having a similar problem, while running 1.6.4...

            But there is a twist... My string has both numbers and text in it, and I need to find a way to strip the number and save it as float.

            My OID comes back like this:

            SNMPv2-SMI::enterprises.161.19.3.2.2.8.0 = STRING: "-73 dBm"

            How can I strip that down to the number? I don't mind loosing the negative sign, as I'm needing the number, not the sign... I won't get positive values, so I'm needing to simply graph the trend. What can I do to extract the value from this string?

            Comment

            • georgew
              Member
              • Mar 2008
              • 50

              #51
              Well, I solved my problem with an external command.

              I used snmpwalk to create a one-line script that probes the device, then used awk and sed to carve up the output until I had the bare numeric value.

              Then I ran that as an external check, and it works great!

              /usr/bin/snmpwalk -v 2c -c public $1 .1.3.6.1.4.1.161.19.3.2.2.8.0 |awk {print'$4'} |sed 's/"-//g'

              Comment

              Working...