Ad Widget

Collapse

Multiple Templates for one Host - Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • richardkraal
    Junior Member
    • Jul 2008
    • 8

    #31
    I hoped this should solve my problem, but it didn't


    what I did:

    I created 2 templates and 1 linked-template with the shared item, this one is linked to the to other template.

    This is working fine, cause in my normal templates show the item from the linked-template! BUT..... when I assign the 2 templates to one host I still get the same error

    "Template with item key 'keyname' already linked to the host"

    This is getting me into a lot of problems at the moment

    Comment

    • richardkraal
      Junior Member
      • Jul 2008
      • 8

      #32
      somebody an idea?

      Comment

      • tekknokrat
        Senior Member
        • Sep 2008
        • 140

        #33
        I've have this error with two templates

        The error Message:



        The items linked to the host:



        Solved: The Linkage conflict also appears when the application is added in the 2nd template without using it. So deleting the application from the Additional Template solved the problem. I still don't get the clue about why duplicate application id should not be allowed.
        Last edited by tekknokrat; 08-06-2009, 14:19. Reason: solved

        Comment

        • xibbaz
          Member
          Zabbix Certified Specialist
          • Jun 2009
          • 74

          #34
          As a workaround, instead of adding a template to a host (which gives me the infamous "conflict" error), add the host to the template thrue the Linked Templates page. It worked for me.

          This bug should be fixed though

          Comment

          • xibbaz
            Member
            Zabbix Certified Specialist
            • Jun 2009
            • 74

            #35
            Originally posted by urkle
            In include/hosts.inc.php around line 1122 in the "validate_templates" function comment out the second check (which is the check for duplicate applications)

            It should look like this..

            Yeah I know it disables the application duplicate check, but as many have found out. things work fine w/ dup applications between templates. and It contradicts Alexei own comment here where he encourages another user to duplicate the application across templates.

            Code:
                    function        validate_templates($templateid_list)
                    {
                            if(is_numeric($templateid_list))return true;
                            if(!is_array($templateid_list)) return false;
                            if(count($templateid_list)<2)   return true;
            
                            $result = true;
                            $db_cnt = DBfetch(DBselect('select key_,type,count(*) as cnt from items '.
                                    ' where hostid in ('.implode(',',$templateid_list).') '.
                                    ' group by key_,type order by cnt desc'
                                    ));
            
                            $result &= $db_cnt['cnt'] > 1 ? false : true;
            
                            /*$db_cnt = DBfetch(DBselect('select name,count(*) as cnt from applications '. 
                                    ' where hostid in ('.implode(',',$templateid_list).') '. 
                                    ' group by name order by cnt desc' 
                                    )); 
             
                            $result &= $db_cnt['cnt'] > 1 ? false : true;*/
            
                            return $result;
                    }
            Thanks to your hack, I finally managed to add a template to my host. The strange thing is that my template does not have any application set in it.

            Comment

            • mischa9
              Junior Member
              • Mar 2010
              • 10

              #36
              I'm experiencing the same Problem.

              I have 2 Templates with the same Application "General", trying to link both templates to host1 will give me an error.

              I have to link one template at a time with saving and unlinking between to get this to work. Quite annoying if you have 5 templates for one host storing the exact same application.

              Is this a bug or am i making a thinking mistake?
              Last edited by mischa9; 17-05-2010, 09:41.

              Comment

              • urkle
                Junior Member
                • Jun 2007
                • 14

                #37
                Originally posted by mischa9
                I'm experiencing the same Problem.
                I have to link one template at a time with saving and unlinking between to get this to work. Quite enoying if you have 5 templates for one host storing the exact same application.
                Yes it is quite annoying..

                Originally posted by mischa9
                Is this a bug or am i making a thinking mistake?
                Everyone on this thread believes it to be a bug as it makes things much more complicated to work with and "less" useful. And as I've been running with a "patch" since like zabbix 1.2 to allow me to link multiple templates with the same application name without issue, I believe it is perfectly safe. And many others are using my patch as well. (please look further up on this thread to see my patch.. Same basic logic works even on the latest 1.8 zabbix which I'm using now)
                Last edited by urkle; 24-11-2010, 21:28.

                Comment

                • mischa9
                  Junior Member
                  • Mar 2010
                  • 10

                  #38
                  Thanks for replying so quick. I'm guessing there must be some kind of reason why this hasn't been changed.

                  I've implemented Zabbix 1.8.2 in our companys infrastructure so im a bit carefull of implementing any patches. Would be great to hear a comment from the Zabbix team to know if something official will be done or if we have to use your patch for enabling this feature.
                  Last edited by mischa9; 24-08-2010, 14:11.

                  Comment

                  • Missbook
                    Junior Member
                    • Sep 2009
                    • 10

                    #39
                    I just upgraded to 1.8.3 and I am working on straightening up our Zabbix templates and such. We use applications across templates along with actions to determine who gets paged.

                    Also, for performance counters in windows there are memory counters in our standard windows template, some in the MSSQL template, and some in the IIS template. However, you have to look at them together to see how the memory is doing in a system.

                    I will try the removing all templates and adding them back in. But this does seem to be a bug.

                    Comment

                    • urkle
                      Junior Member
                      • Jun 2007
                      • 14

                      #40
                      Originally posted by Missbook
                      I will try the removing all templates and adding them back in. But this does seem to be a bug.
                      Look at my previous posts, to this thread, specifically

                      and modify your installation of zabbix.. to "fix" the issue.

                      Comment

                      • Missbook
                        Junior Member
                        • Sep 2009
                        • 10

                        #41
                        Originally posted by urkle
                        Look at my previous posts, to this thread, specifically

                        and modify your installation of zabbix.. to "fix" the issue.
                        After the above fix not working I finally found that the same functions are in api/classes/class.ctemplate.php and after commenting out both application portions I was finally able to add my template. This is for 1.8.3.

                        Comment

                        Working...