Ad Widget

Collapse

Regular Expressions for Items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hqit
    Junior Member
    • Oct 2013
    • 3

    #1

    Regular Expressions for Items

    Hi,

    is there a way to use regular expressions for the values returned by an item?

    We have an snmp item, where we want to collect the temperature of an server.
    But we receive " 20.00 Centigrade" which is not, of course, able to store as number and viewable as graph.
    So our idea was, to use regular expression on the receiving value instead and filter only the number.

    We use Zabbix: 2.2.2

    Thank you in advance for your help
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    Unfortunately, the returned value is STRING and not an integer.

    I'm afraid you have no other chance that performing the SNMP query in a script and let that script strip the unwanted unit descriptor.

    At least zabbix does not support converting STRINGs to UINT out of the box.

    Comment

    • m_gularte
      Member
      Zabbix Certified Specialist
      • Jul 2012
      • 85

      #3
      Hi,

      Please, see this:

      iregexp("^(2[8-9]|[3-9][0-9]).+$")}=1

      If upper than 28 Centigrades, the trigger will alarm.

      I had the same issue, my item is set as string too.

      Edit.: Sorry, i guess i agree with steveboyson.

      Best Regards
      Mauro

      Comment

      Working...