Ad Widget

Collapse

Raise trigger if item recieved any value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sumanthupar123
    Junior Member
    • Nov 2017
    • 2

    #1

    Raise trigger if item recieved any value

    Hi,

    I have created a item using Userparameter. I need to raise an trigger if the item receives any value(I think its like opposite of nodata recieved function)

    UserParameter=zone.stat,zonestat 1 1| awk '/global/ {print $2}'

    I have tried creaqting trigger as below,but it's not working.

    {MOI:zone.stat.nodata(30)}=1

    TIA
  • Pitons
    Member
    • Oct 2017
    • 49

    #2
    Hi,
    Use function: last()

    {MOI:zone.stat.last()}=1

    Comment

    • sumanthupar123
      Junior Member
      • Nov 2017
      • 2

      #3
      HI,

      Thanks for the reply.

      But the thing is, the output of item is not an integer. It will be like below,

      z1-MOI 0.0339844
      z2-MOI 0.0911133

      So,if am including {MOI:zone.test.last()}=1..

      In info am getting like below..
      "Cannot evaluate expression: expected numeric token at "z1-MOI 0.0339844
      z2-MOI 0.0911133)=1"."

      Comment

      • allexpetrov
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2017
        • 361

        #4
        Hello,

        Please take a look at Trigger expressions: https://www.zabbix.com/documentation...gers/functions

        You are receiving string value so you need to operate with the string-related function.

        Try to use {MOI:zone.stat.nodata(30)}=0 because per statement there is

        Returns:
        1 - if no data received during the defined period of time
        0 - otherwise
        Regards,
        Alex!

        Comment

        • Pitons
          Member
          • Oct 2017
          • 49

          #5
          Yea... Alex is right, missed that 0 will trigger that
          Last edited by Pitons; 17-11-2017, 10:02.

          Comment

          Working...