Ad Widget

Collapse

function last to compare string/text values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Koral
    Member
    • Oct 2012
    • 30

    #1

    function last to compare string/text values

    Hi there,
    I would like to compare two text values with function last.
    Is it possible? In manual it is clearly said that this function can be used on strings, but when I make a trigger like:

    {host:item.last(0)}={host:item.last(0,3600)} or
    {host:item.last(0)}={host:item.last(#10)}

    I only get "Format error or unsupported operator. Exp: [01 January 2013 00:00:00]"
    Can someone help?

    I didn't want to make external script+sender to firstly reconfigure values I get and lastly send them.
    I just need to compare two values (the change is for example on midnight, from 01 January 2013 00:00:00 to 02 January 2013 00:00:00
    if after midnight that value does not change, than I have a problem.

    zbx: 2.2.1

    P.S. function change/abschange is not good in my case because they only compare newest and previous values.
    Last edited by Koral; 29-01-2014, 14:18. Reason: change
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    Hi Koral!

    Sorry for silly question.

    Do you show two different logical expression ?
    Or it is one logical expression made from two parts and connected by OR condition?

    Do you remember that in Zabbix logical operators looks different?
    AND -> &
    OR -> |

    For example, I have a triggers which work:
    Code:
    {AMD-137:agent.ping.last(0)}={AMD-137:agent.ping.last(0,3600)}|
    {AMD-137:agent.ping.last(0)}={AMD-137:agent.ping.last(#5)}
    As you can see it has two parts connected by "|" (OR logical operator)
    Sincerely yours,
    Aleksey

    Comment

    • Koral
      Member
      • Oct 2012
      • 30

      #3
      Hey,
      the two expressions I have wrote above where two separate 'ideas' for achieving the same:

      {host:item.last(0)}={host:item.last(0,3600)}
      'newest value is equal to value 1 hour ago'

      {host:item.last(0)}={host:item.last(#10)}
      'newest value is equal to value 10-checks ago'

      I just wanted to state, that both (little different) formulas wont work for string values.
      Last edited by Koral; 07-02-2014, 17:50.

      Comment

      • simonquentel
        Member
        • Mar 2013
        • 49

        #4
        Besides, it would be nice to have this option in the "calculated items", meaning you can reuse a text item from a host for another host item.

        Simon

        Comment

        Working...