Ad Widget

Collapse

Zabbix 1.5.4 - Build 5784 - Template Linkage

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

    #1

    Zabbix 1.5.4 - Build 5784 - Template Linkage

    Zabbix 1.5.4 - Build 5784 - Template Linkage

    Linking templates in hosts -> template linkage:
    If a template is linked to a host with a duplicate key, a general error is given but when the user opens the details of status error msg, the error or duplicate key does not show in the list. The host list or the message list shows that everything was successfull.
  • Palmertree
    Senior Member
    • Sep 2005
    • 746

    #2
    Also found that if I try to use template linkage and link more than 2 host to the template, it will not work and give an error. If i only select one host it works fine. Strange...

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #3
      Just an FYI. I still get the following error still in rev 5802 when trying to link more than 1 template at a time:

      ERROR: CAnnot link to template

      Also, "CAnnot" should be "Can not"

      Comment

      • Aly
        ZABBIX developer
        • May 2007
        • 1126

        #4
        Mmm strange, but I can link/unlink any amount of a hosts to/from the template.
        Zabbix | ex GUI developer

        Comment

        • Palmertree
          Senior Member
          • Sep 2005
          • 746

          #5
          I can link the template manually to the host by going to the host itself but trying to link the same template to the host in template linkage gives the error. Should the status screen show $key as the items getting linked or the key names themselves?

          Comment

          • Palmertree
            Senior Member
            • Sep 2005
            • 746

            #6
            Originally posted by Palmertree
            I can link the template manually to the host by going to the host itself but trying to link the same template to the host in template linkage gives the error. Should the status screen show $key as the items getting linked or the key names themselves?
            Wierd thing is that this does not happen for ever host that is being linked to the same template. Not sure yet what is going on.

            Comment

            • Palmertree
              Senior Member
              • Sep 2005
              • 746

              #7
              Can't figure out what is going on here. I went back to 1.5.2 code and template linkage works great but for some reason in 1.5.4 it has some strange errors. in 1.5.4 I can link the same template manually in the host itself but it will fail for the same host and template in template linkage. Maybe it's something to do with the $result status being returned back to DEend or something. No idea. I will keeping digging though.

              Comment

              • Aly
                ZABBIX developer
                • May 2007
                • 1126

                #8
                If it's general error, than somewhere is returned FALSE. Find where and I guess U'll find why.
                Zabbix | ex GUI developer

                Comment

                • Palmertree
                  Senior Member
                  • Sep 2005
                  • 746

                  #9
                  I probably will run the Zabbix_Server in debug mode (level 4) and see if I can see anything in the logs. If not I will add some debug statements to the code.

                  I will keep you posted.

                  Comment

                  • Aly
                    ZABBIX developer
                    • May 2007
                    • 1126

                    #10
                    Zabbix server log is nothing to do when running frontend.
                    Zabbix | ex GUI developer

                    Comment

                    • Palmertree
                      Senior Member
                      • Sep 2005
                      • 746

                      #11
                      Yikes, you are right. To many late night hours.

                      Comment

                      • Palmertree
                        Senior Member
                        • Sep 2005
                        • 746

                        #12
                        After putting debug statements everywhere, I finally figured out why my template linkage did not work for us. The hostid for db_save "results" was being returned instead of SUCCESS. DBend was rolling back the changes as design if it did not get a SUCCESS sent to it. Also, fixed an issue where the item keys were not showing up in the message box.

                        Patch is as follows:
                        Code:
                        diff -ruN zabbix-original/frontends/php/include/hosts.inc.php zabbix/frontends/php/include/hosts.inc.php
                        --- zabbix-original/frontends/php/include/hosts.inc.php 2008-07-01 09:29:51.000000000 -0400
                        +++ zabbix/frontends/php/include/hosts.inc.php  2008-07-13 23:08:40.000000000 -0400
                        @@ -227,8 +227,6 @@
                                                        break;
                                        }
                        
                        -               if($result) $result = $hostid;
                        -
                                        return $result;
                                }
                        
                        diff -ruN zabbix-original/frontends/php/include/items.inc.php zabbix/frontends/php/include/items.inc.php
                        --- zabbix-original/frontends/php/include/items.inc.php 2008-07-10 03:04:38.000000000 -0400
                        +++ zabbix/frontends/php/include/items.inc.php  2008-07-13 23:06:32.000000000 -0400
                        @@ -284,7 +284,7 @@
                                                DBexecute('INSERT INTO items_applications (itemappid,itemid,applicationid) VALUES('.$itemappid.','.$itemid.','.$appid.')');
                                        }
                        
                        -               info('Added new item '.$host['host'].':$key');
                        +               info('Added new item '.$host['host'].':'.zbx_dbstr($key));
                        
                         // add items to child hosts

                        Comment

                        • Aly
                          ZABBIX developer
                          • May 2007
                          • 1126

                          #13
                          Good work! Fixed in SVN.

                          P.S. Fix is different.
                          Zabbix | ex GUI developer

                          Comment

                          • Palmertree
                            Senior Member
                            • Sep 2005
                            • 746

                            #14
                            Thanks Aly! We will download the latest SVN and test the template linkage with the official fix and report back the test results.

                            Comment

                            • Palmertree
                              Senior Member
                              • Sep 2005
                              • 746

                              #15
                              Aly your fix works like a champ. Thank you.

                              Comment

                              Working...