Ad Widget

Collapse

Problem with item values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • slence
    Member
    • Nov 2014
    • 41

    #1

    Problem with item values

    hi,

    I'm trying to get the value of 2 items. CPU temperatures. The value that I get it's in this form: [t|52.2C] , so I get some errors:

    Received value [50.7C] is not suitable for value type [Numeric (float)]

    I guess it's because of the letter C, right?

    How can I solve this problem?

    Thanks.
  • ArtemK
    Senior Member
    • May 2013
    • 232

    #2
    • use some script to parse numeric value
    • use character items and parse value in trigger expression using regexp functions.

    Comment

    • slence
      Member
      • Nov 2014
      • 41

      #3
      Originally posted by ArtemK
      • use some script to parse numeric value
      • use character items and parse value in trigger expression using regexp functions.
      Hum..Can you do me an example on how to parse the value?

      Comment

      • ArtemK
        Senior Member
        • May 2013
        • 232

        #4
        depends on which OS do you use. Simplest linux command for example:
        Code:
        [root@host ~]# echo 30.7C | sed 's/.$//'
        30.7
        you could put similar command to your agent configuration (in case you are not getting value using SNMP)

        Comment

        • slence
          Member
          • Nov 2014
          • 41

          #5
          ArtemK thanks

          You really help me a lot!

          Many thanks!

          Comment

          Working...