Ad Widget

Collapse

Trigger to compare text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bernard
    Member
    • Oct 2008
    • 54

    #1

    Trigger to compare text

    Hello,

    I want to do something like:
    Code:
    ({host:list_partition[].last(#1)}={host:list_partition[].last(#2)})&({host:list_partition[].last(#1)}#{host:list_partition[].last(#3)})
    Or more simple : function change with 3 checks (last, previous, pre-previous) values

    list_partition return text as "C: D: E:" (on windows hosts) and "/ /tmp /var" (on linux hosts)

    I want to get a trigger to fire when the change is two time consecutive.

    But it doesn't work because functions return numeric values only, and comparaison function works only with last and previous value.

    New function strlen will not work because if my list_partition change from "C: D:" to "C: E:" I won't be able to view the change (length is the same).

    How can I do that?

    Many thanks for your help
  • bernard
    Member
    • Oct 2008
    • 54

    #2
    No idea at all ?

    Comment

    • marcel
      Senior Member
      Zabbix Certified Specialist
      • Oct 2010
      • 112

      #3
      something like

      {last(0)=last(1)}&{last(0)#last(2)}

      dont you want to implement the hysteresis using actions?
      Zabbix Certified Specialist for Large Environments since 12/2010

      Comment

      • bernard
        Member
        • Oct 2008
        • 54

        #4
        Thanks for your suggestion, I will try.

        I don't want to implement the hysteresis, but I want to have two consecutive value different from the third value to fire the trigger.

        Example:
        if returned data are 0 - 1 - 5 - 1 - 0 I don't want an event
        if returned data are 0 - 1 - 1 - 4 - 0 I want an event because I have twice "1".

        Comment

        • bernard
          Member
          • Oct 2008
          • 54

          #5
          Still doesn't work.
          My expression is:
          Code:
          ({host:list_partition[].last(#1)}={host:list_partition[].last(#2)})&({host:list_partition[].last(#1)}#{host:list_partition[].last(#3)})
          value returned is: C: F:

          But expression evaluation doesn't work. I have the error:
          Format error or unsupported operator. Exp: [C: F:]
          Expression [(C: F: =C: F: )&(C: F: #C: F: )] cannot be evaluated: Format error or unsupported operator. Exp: [C: F:]

          Any idea to do that ?
          Regards,
          Bernard

          Comment

          • Gert Vanderstukken
            Junior Member
            • Mar 2011
            • 5

            #6
            I have a simular problem.
            I want to comare the last value to an earlier value (not the previous).

            If I do this with number-fields, everything is OK.
            Even string values that contain numbers are OK, but if I compare text fields that conatin only "real text" (no numbers) it fails.

            so:
            comparing:
            4560 = 4560 works
            test5 = test5 works
            te5st = te5st works
            test = test doesn't work

            I run 1.8.4 (I had the same problem on 1.8.3)

            Comment

            • bernard
              Member
              • Oct 2008
              • 54

              #7
              Feature request opened

              A new feature request has been open about this case.

              ZBXNEXT-702

              Today this kind of check is not possible.

              Comment

              Working...