Ad Widget

Collapse

Problem with value mapping (converting string to integer)

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • StephanA
    Junior Member
    • Mar 2025
    • 1

    #1

    Problem with value mapping (converting string to integer)

    The agent sends an item with string values from a bash script like
    "OK - <varying details>"
    "ERROR - <varying details"

    On the first dashboard I want to reduce info and space with converting the values to 1/0 and applying a threshold Green/Red.
    I don't want to use Preprocessing, because I want to keep the "<varying details>" in the database.

    So I created a value mapping
    regexp -> ^OK.* -> 1
    regexp -> ^ERROR.* -> 0
    This works, because I get now 1/0 in the dashboard; but the original value is appended; so it looks like "1 (OK - <varying details)"
    And I can't apply thresholds because the item type "character" still seems to be the basic type instead of type integer.

    Do I miss something?
  • Answer selected by StephanA at 03-04-2025, 10:16.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    yeah, unfortunately, thats how it works... Value mapping is for visual enhancements...it does not change your actual value type. So any calculations etc have to be done on the real value, not the mapped value.. And as long as I know, there is no option to tune that displaying also, with or without real value...

    Comment

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

      #2
      yeah, unfortunately, thats how it works... Value mapping is for visual enhancements...it does not change your actual value type. So any calculations etc have to be done on the real value, not the mapped value.. And as long as I know, there is no option to tune that displaying also, with or without real value...

      Comment

      Working...