Ad Widget

Collapse

Negative values in Triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paultorben
    Junior Member
    • Apr 2007
    • 10

    #1

    Negative values in Triggers

    Hi,

    I tried searching for an answer to this but all I found was a posting from a couple of years ago:



    where Alexei says that negative values in triggers aren't supported yet - Alexei are they supported in any current release / alpha?

    I've trying to monitor the voltage output from sensors, and the -12V and -5V items (from a power supply monitor) can't be monitored by a trigger in 1.1.7

    ({Games2:sensor.voltage.n12v.last(0)}>(-10.9))|({Games2:sensor.voltage.n12v.last(0)}<(-13.1))

    Incorrect trigger expression '(0>(-10.9))|(0<(-13.1))'

    Any thoughts / suggestions welcome.


    Thanks,

    Torben
  • paultorben
    Junior Member
    • Apr 2007
    • 10

    #2
    * bump *

    seriously - no way to monitor negative values??

    note - i'm using Zabbix 1.1.7 and I've been very pleased with Zabbix over the last 2 years ...

    Comment

    • paultorben
      Junior Member
      • Apr 2007
      • 10

      #3
      [solved but ugly]

      I figured out a hack to make this work:

      Z - ( Z *2 )

      so from my original example - taking the first half:

      ({Games2:sensor.voltage.n12v.last(0)}>(-10.9))

      became:

      ( {Games2:sensor.voltage.n12v.last(0)} ) - ( {Games2:sensor.voltage.n12v.last(0)} * 2) > 10.9

      which seems to work fine.

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        Nice hack, yet wrong one It should be like this I guess:

        ( {Games2:sensor.voltage.n12v.last(0)} *2 ) - ({Games2:sensor.voltage.n12v.last(0)}) > 10.9
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • paultorben
          Junior Member
          • Apr 2007
          • 10

          #5
          Originally posted by Alexei
          Nice hack, yet wrong one It should be like this I guess:

          ( {Games2:sensor.voltage.n12v.last(0)} *2 ) - ({Games2:sensor.voltage.n12v.last(0)}) > 10.9

          Thanks for the reply! Love Zabbix by the way and can't wait to upgrade to 1.4 !

          Unfortunately your addition/subtraction with negative numbers is wrong.

          example:

          say n12v = -12.0

          in your solution that would work out like:

          ( -12.0 * 2 ) - ( -12.0 ) = ( -24 ) + 12 = -12

          Still a negative number which Zabbix can't evaluate (in a trigger as noted above).


          Mine works out like this:

          ( -12 ) - ( -12 * 2 ) = ( -12 ) - ( -24 ) = ( -12 ) + 24 = 12

          the end result is a positive number, which Zabbix can then evaluate

          so,

          ( {Games2:sensor.voltage.n12v.last(0)} ) - ( {Games2:sensor.voltage.n12v.last(0)} * 2) > 10.9

          is correct for converting a negative value result into a positive number - without being able to use math function like abs() - hey if you had abs() (which returns the absolute value of a number - i.e. without a negative sign) where you also have the average and mix /max functions for triggers then this problem would disappear:

          abs( {Games2:sensor.voltage.n12v.last(0)} ) > 10.9

          any chance it would be easy to add in with those min/max/etc. trigger functions?

          Comment

          Working...