Ad Widget

Collapse

Regular expression V matching last value in period T, then N = 1, 0 - otherwise

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krzysztofmajewski
    Junior Member
    • May 2014
    • 6

    #1

    Regular expression V matching last value in period T, then N = 1, 0 - otherwise

    I am creating a trigger using the "str" function. The function takes three arguments: a string V, a period T, and a number N. In the Zabbix UI, the label of the function (in the selection dropdown) is:

    "Find string V in last (most recent) value. N = 1 - if found, 0 - otherwise"

    Can anybody translate this cryptic expression into English?

    When I select the function and enter the arguments "error", "30", and "0" (respectively), the trigger expression becomes:

    {guavcol-ch2-a2p.sys.comcast.net:guavus.cdcextract.str(error,30 )}=0

    The documentation says nothing about this mysterious third argument 'N':

    Find string in last (most recent) value. Parameter defines string to find. Case sensitive!
    Second optional parameter is number of seconds or number of collected values to analyse. In this case more than one value will be processed.
    Returns:
    1 - found
    0 - otherwise

    Any hints appreciated. (And yes, I realize that trial-and-error is an option, but I can't do my whole job that way. There's no substitute for readable documentation.)
  • Slash
    Member
    • May 2011
    • 64

    #2
    N is simply the result of the "str" function.

    In your case

    Code:
    {guavcol-ch2-a2p.sys.comcast.net:guavus.cdcextract.str(error,30 )}=0
    Means that N will be 1 if the string "guavcol-ch2-a2p.sys.comcast.net:guavus.cdcextract" contains "error" or "30 ", else it will be 0.

    In other words:

    {guavcol-ch2-a2p.sys.comcast.net:guavus.cdcextract.str(error,30 )} = N

    Comment

    Working...