Ad Widget

Collapse

Import duplicates triggers when expression is changed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Emir Imamagic
    Member
    • Mar 2008
    • 67

    #1

    Import duplicates triggers when expression is changed

    Hello,

    it seems that the trigger import logic has changed between 1.4 and 1.6.

    In Zabbix 1.4 scenario was following: in XML file I modified trigger expression and kept the trigger name; import of XML would simply modify the existing trigger.

    In Zabbix 1.6: import of XML creates new trigger with the new expression and keeps the old one.

    If this was part of the design, it would be very useful to add extra option for Existing Triggers: "Add", "Update", "Skip". With the current logic is practically impossible to modify triggers in XML.

    Cheers,
    emir
  • Emir Imamagic
    Member
    • Mar 2008
    • 67

    #2
    Ok, I solved the problem temporarily by excluding lines of code responsible for matching trigger expresions (597, 599 in SVN rev. 6155):
    Code:
    while($trigger = DBfetch($result)){
            //if(explode_exp($trigger['expression'],0) == $data['expression']){
                    break; // while
            //}
    }
    I assume that this is here because of the option of having multiple triggers with the same name and different expression. However, for those of us who don't need it having a flag for this would be nice. By that time, I hope that excluding these 2 lines doesn't break up something else

    Cheers,
    emir

    Comment

    • mlange
      Member
      • Sep 2008
      • 78

      #3
      I can confirm this bug.

      Comment

      • Aly
        ZABBIX developer
        • May 2007
        • 1126

        #4
        This is not a bug.
        Zabbix | ex GUI developer

        Comment

        • Emir Imamagic
          Member
          • Mar 2008
          • 67

          #5
          Ok, so I assumed correctly. Could you please comment if there are any plans to add a switch that will enable users to update existing triggers instead of creating a duplicate ones?

          Comment

          • Aly
            ZABBIX developer
            • May 2007
            • 1126

            #6
            No plans, but very possibly that in some moment it will be added.
            Zabbix | ex GUI developer

            Comment

            • Emir Imamagic
              Member
              • Mar 2008
              • 67

              #7
              Could you confirm that commenting out those two lines of code don't break up anything else?

              Thanks,
              emir

              Comment

              • mlange
                Member
                • Sep 2008
                • 78

                #8
                I find this very annoying because changing a trigger expression and reimporting the template always leaves the old trigger. To my mind there should be a logic detecting the duplicate name and just replacing the trigger. Does not sound too difficult, or?

                Comment

                Working...