Ad Widget

Collapse

Zabbix 1.5.3 - Item Copy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Palmertree
    Senior Member
    • Sep 2005
    • 746

    #1

    Zabbix 1.5.3 - Item Copy

    Zabbix 1.5.3 - Item Copy

    When an item is copied from one template to another, the message status shows that it was copied successfully but when you look at the items of the template you copied to it does not show up.
  • Palmertree
    Senior Member
    • Sep 2005
    • 746

    #2
    Strange problem. In items.inc.php line 304 is executed but really nothing happens when you go back and look at the template you copied the item key to even though the status screen said it was copied.

    297
    298 foreach($applications as $appid)
    299 {
    300 $itemappid=get_dbid("items_applications","itemappi d");
    301 DBexecute("insert into items_applications (itemappid,itemid,applicationid) values($itemappid,".$itemid.",".$appid.")");
    302 }
    303
    304 info("Added new item ".$host["host"].":$key");
    305
    306 // add items to child hosts

    Comment

    • Aly
      ZABBIX developer
      • May 2007
      • 1126

      #3
      It's fixed
      Zabbix | ex GUI developer

      Comment

      • Palmertree
        Senior Member
        • Sep 2005
        • 746

        #4
        Thank you.....

        I will download the most recent SVN and test and report back my findings...

        Comment

        • Niels
          Senior Member
          • May 2007
          • 239

          #5
          Is this possibly related to https://support.zabbix.com/browse/ZBX-205 ?

          Comment

          • Aly
            ZABBIX developer
            • May 2007
            • 1126

            #6
            Is this possibly related to https://support.zabbix.com/browse/ZBX-205 ?
            No, it's not. It's related to 1.6 functionality only.

            I will download the most recent SVN and test and report back my findings...
            Be aware, profiles schema is changed!
            Last edited by Aly; 20-06-2008, 14:11.
            Zabbix | ex GUI developer

            Comment

            • Palmertree
              Senior Member
              • Sep 2005
              • 746

              #7
              What SQL value types should the following being for profiles for the newest SVN

              value_id, value_int, value_str

              value_id bigint 20
              value_int ??
              value_str ??

              Comment

              • Aly
                ZABBIX developer
                • May 2007
                • 1126

                #8
                For now it's:

                value_int INTEGER NOT NULL DEFAULT 0
                value_str varchar(255) NOT NULL DEFAULT ''

                P.S. You can compare create/schema/schema.sql file to previous..
                Zabbix | ex GUI developer

                Comment

                • Palmertree
                  Senior Member
                  • Sep 2005
                  • 746

                  #9
                  Originally posted by Aly
                  For now it's:

                  value_int INTEGER NOT NULL DEFAULT 0
                  value_str varchar(255) NOT NULL DEFAULT ''

                  P.S. You can compare create/schema/schema.sql file to previous..
                  Sorry one more quick question, should value_int be "Unsigned"?

                  Comment

                  • Aly
                    ZABBIX developer
                    • May 2007
                    • 1126

                    #10
                    No, it shouldn't.
                    Zabbix | ex GUI developer

                    Comment

                    • Palmertree
                      Senior Member
                      • Sep 2005
                      • 746

                      #11
                      Thanks, Just realized that you said it is in the schema. Sorry about that.

                      Comment

                      • Aly
                        ZABBIX developer
                        • May 2007
                        • 1126

                        #12
                        You're welcome!
                        Zabbix | ex GUI developer

                        Comment

                        • Palmertree
                          Senior Member
                          • Sep 2005
                          • 746

                          #13
                          If there is one duplicate key in the list of items being copied, the entire copy is rolled back (DBend) even though items said that they were added successfully. Fixed this by posting true to DBend. Also, I wonder if "Delete" and "Update" will have the same problem.

                          Before:
                          Code:
                          466                         DBstart();
                          467                         foreach($_REQUEST["group_itemid"] as $item_id)
                          468                                 foreach($hosts_ids as $host_id){
                          469                                         $result &= copy_item_to_host($item_id, $host_id, true);
                          470                                 }
                          471
                          472                         [COLOR="Red"]$result = DBend($result);[/COLOR]
                          473                         show_messages($result, S_ITEMS_COPIED, S_CANNOT_COPY_ITEMS);
                          474                         unset($_REQUEST["form_copy_to"]);
                          After:
                          Code:
                          466                         DBstart();
                          467                         foreach($_REQUEST["group_itemid"] as $item_id)
                          468                                 foreach($hosts_ids as $host_id){
                          469                                         $result &= copy_item_to_host($item_id, $host_id, true);
                          470                                 }
                          471
                          472                         [COLOR="Red"]$result = DBend(true);[/COLOR]
                          473                         show_messages($result, S_ITEMS_COPIED, S_CANNOT_COPY_ITEMS);
                          474                         unset($_REQUEST["form_copy_to"]);
                          Last edited by Palmertree; 21-06-2008, 07:32.

                          Comment

                          • Aly
                            ZABBIX developer
                            • May 2007
                            • 1126

                            #14
                            We've changed the logic in situations like that.. now it will be committed if at least one item copied successfully.
                            Zabbix | ex GUI developer

                            Comment

                            Working...