Ad Widget

Collapse

I can't link a child template to a parent template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oxpy
    Junior Member
    • Oct 2022
    • 8

    #1

    I can't link a child template to a parent template

    Hello everyone

    I have a problem with linking templates. I'm trying to link a template, but I got an error "Cannot link template "Template DB MySQL" to template "NetScan OS Generic Template", because its parent template "Template DB MySQL" would be linked twice."

    Click image for larger version  Name:	2023-10-30_15-10.png Views:	0 Size:	62.5 KB ID:	473211

    I guess I unlinked the old child template without clearing data and I keep catching this bug.
    I have not any linked templates with same items to parent template.

    What is the best way to troubleshoot it and how I can fix it?
    Thank you in advance
  • oxpy
    Junior Member
    • Oct 2022
    • 8

    #2
    I have already another problem. I did not any changes from publication post. I don't know what happening so let's go on

    The next problem is "Cannot inherit item prototype with key "mysql.buffer_pool_efficiency[{#NONE}]" of template "NetScan OS Generic Template" to host "waw6d7", because an item with the same key is already inherited from template "NetScan OS Generic Template"."

    Click image for larger version

Name:	2023-10-31_14-36.png
Views:	853
Size:	67.7 KB
ID:	473285

    Also I checked the database and there are not any items that contains "mysql.buffer_pool_efficiency[{#NONE}]" at host waw6d7 with ItemID: 10882
    Code:
    MariaDB [(none)]> SELECT hostid,host from zabbix.hosts where host like 'waw6d7';
    +--------+--------+
    | hostid | host   |
    +--------+--------+
    |  10882 | waw6d7 |
    +--------+--------+​
    All items from this host
    Code:
    MariaDB [(none)]> SELECT itemid,key_,hostid FROM zabbix.items where hostid like '10882';
    +--------+--------------------------------------------------------------+--------+
    | itemid | key_                                                         | hostid |
    +--------+--------------------------------------------------------------+--------+
    | 168457 | abs_forwarded                                                |  10882 |
    | 168458 | abs_recv                                                     |  10882 |
    | 168459 | acc_fdrops                                                   |  10882 |
    | 168460 | acc_forwarded                                                |  10882 |
    | 168461 | acc_rdrops                                                   |  10882 |
    | 168462 | acc_recv                                                     |  10882 |
    | 168463 | agent.hostname                                               |  10882 |
    | 168464 | agent.ping                                                   |  10882 |
    | 168465 | agent.version                                                |  10882 |
    | 168466 | kernel.maxfiles                                              |  10882 |
    | 168467 | kernel.maxproc                                               |  10882 |
    | 168475 | proc.mem[nsdbm,,,,pmem]                                      |  10882 |
    | 168476 | proc.mem[nsmon,,,,pmem]                                      |  10882 |
    | 168477 | proc.mem[nssrv,,,,pmem]                                      |  10882 |
    | 168478 | proc.num                                                     |  10882 |
    | 168479 | proc.num[,,run]                                              |  10882 |
    | 168480 | system.boottime                                              |  10882 |
    | 168481 | system.cpu.intr                                              |  10882 |
    | 168482 | system.cpu.load[all,avg15]                                   |  10882 |
    | 168483 | system.cpu.load[all,avg1]                                    |  10882 |
    | 168484 | system.cpu.load[all,avg5]                                    |  10882 |
    | 168485 | system.cpu.num                                               |  10882 |
    | 168486 | system.cpu.switches                                          |  10882 |
    | 168487 | system.cpu.util[,guest]                                      |  10882 |
    | 168488 | system.cpu.util[,guest_nice]                                 |  10882 |
    | 168489 | system.cpu.util[,idle]                                       |  10882 |
    | 168490 | system.cpu.util[,interrupt]                                  |  10882 |
    | 168491 | system.cpu.util[,iowait]                                     |  10882 |
    | 168492 | system.cpu.util[,nice]                                       |  10882 |
    | 168493 | system.cpu.util[,softirq]                                    |  10882 |
    | 168494 | system.cpu.util[,steal]                                      |  10882 |
    | 168495 | system.cpu.util[,system]                                     |  10882 |
    | 168496 | system.cpu.util[,user]                                       |  10882 |
    | 168497 | system.hostname                                              |  10882 |
    | 168498 | system.localtime                                             |  10882 |
    | 168499 | system.sw.arch                                               |  10882 |
    | 168500 | system.sw.os                                                 |  10882 |
    | 168501 | system.sw.packages                                           |  10882 |
    | 168505 | system.uname                                                 |  10882 |
    | 168506 | system.uptime                                                |  10882 |
    | 168507 | system.users.num                                             |  10882 |
    | 168508 | vfs.dir.count[{$NETSCAN.DIR.MAIN}{$NETSCAN.DIR.DATA}]        |  10882 |
    | 168509 | vfs.dir.count[{$NETSCAN.DIR.MAIN}{$NETSCAN.DIR.EXPORT}]      |  10882 |
    | 168510 | vfs.file.cksum[/etc/passwd]                                  |  10882 |
    | 168511 | vfs.dir.size[{$NETSCAN.DIR.MAIN}{$NETSCAN.DIR.EXPORT}]       |  10882 |
    | 168512 | vfs.dir.size[{$NETSCAN.DIR.MAIN}{$NETSCAN.DIR.OUT_DIR},used] |  10882 |
    | 168513 | vfs.fs.size[{$NETSCAN.DIR.PART}, pfree]                      |  10882 |
    | 168514 | vfs.fs.size[{$NETSCAN.DIR.PART}, total]                      |  10882 |
    | 168515 | vfs.fs.size[{$NETSCAN.DIR.PART}, used]                       |  10882 |
    | 168516 | vm.memory.size[available]                                    |  10882 |
    | 168517 | vm.memory.size[pavailable]                                   |  10882 |
    | 168518 | vm.memory.size[total]                                        |  10882 |
    | 168519 | zabbix[host,agent,available]                                 |  10882 |
    | 168554 | system.cpu.util                                              |  10882 |
    | 168555 | vm.memory.utilization                                        |  10882 |
    | 168556 | discovery.proc[nsdpi]                                        |  10882 |
    | 168557 | discovery.proc[nsmon@]                                       |  10882 |
    | 168560 | net.if.discovery                                             |  10882 |
    | 168561 | vfs.dev.discovery                                            |  10882 |
    | 168562 | vfs.fs.discovery                                             |  10882 |
    | 168565 | net.if.in["{#IFNAME}",dropped]                               |  10882 |
    | 168566 | net.if.in["{#IFNAME}",errors]                                |  10882 |
    | 168567 | net.if.in["{#IFNAME}"]                                       |  10882 |
    | 168568 | net.if.out["{#IFNAME}",dropped]                              |  10882 |
    | 168569 | net.if.out["{#IFNAME}",errors]                               |  10882 |
    | 168570 | net.if.out["{#IFNAME}"]                                      |  10882 |
    | 168571 | nsdpi_util[{#PID}]                                           |  10882 |
    | 168572 | nsmon_util[{#PID}]                                           |  10882 |
    | 168573 | vfs.dev.read.await[{#DEVNAME}]                               |  10882 |
    | 168574 | vfs.dev.write.await[{#DEVNAME}]                              |  10882 |
    | 168575 | vfs.file.contents["/sys/class/net/{#IFNAME}/operstate"]      |  10882 |
    | 168576 | vfs.file.contents["/sys/class/net/{#IFNAME}/type"]           |  10882 |
    | 168577 | vfs.file.contents[/sys/block/{#DEVNAME}/stat]                |  10882 |
    | 168578 | vfs.fs.inode[{#FSNAME},pfree]                                |  10882 |
    | 168579 | vfs.fs.size[{#FSNAME},pused]                                 |  10882 |
    | 168580 | vfs.fs.size[{#FSNAME},total]                                 |  10882 |
    | 168581 | vfs.fs.size[{#FSNAME},used]                                  |  10882 |
    | 168585 | vfs.dev.queue_size[{#DEVNAME}]                               |  10882 |
    | 168586 | vfs.dev.read.rate[{#DEVNAME}]                                |  10882 |
    | 168587 | vfs.dev.read.time.rate[{#DEVNAME}]                           |  10882 |
    | 168588 | vfs.dev.util[{#DEVNAME}]                                     |  10882 |
    | 168589 | vfs.dev.write.rate[{#DEVNAME}]                               |  10882 |
    | 168590 | vfs.dev.write.time.rate[{#DEVNAME}]                          |  10882 |
    | 168668 | net.if.in["eno1",dropped]                                    |  10882 |
    | 168669 | net.if.in["eno2",dropped]                                    |  10882 |
    | 168670 | net.if.in["eno3",dropped]                                    |  10882 |
    | 168671 | net.if.in["eno4",dropped]                                    |  10882 |
    | 168672 | net.if.in["eno1",errors]                                     |  10882 |
    | 168673 | net.if.in["eno2",errors]                                     |  10882 |
    | 168674 | net.if.in["eno3",errors]                                     |  10882 |
    | 168675 | net.if.in["eno4",errors]                                     |  10882 |
    | 168676 | net.if.in["eno1"]                                            |  10882 |
    | 168677 | net.if.in["eno2"]                                            |  10882 |
    | 168678 | net.if.in["eno3"]                                            |  10882 |
    | 168679 | net.if.in["eno4"]                                            |  10882 |
    | 168680 | net.if.out["eno1",dropped]                                   |  10882 |
    | 168681 | net.if.out["eno2",dropped]                                   |  10882 |
    | 168682 | net.if.out["eno3",dropped]                                   |  10882 |
    | 168683 | net.if.out["eno4",dropped]                                   |  10882 |
    | 168684 | net.if.out["eno1",errors]                                    |  10882 |
    | 168685 | net.if.out["eno2",errors]                                    |  10882 |
    | 168686 | net.if.out["eno3",errors]                                    |  10882 |
    | 168687 | net.if.out["eno4",errors]                                    |  10882 |
    | 168688 | net.if.out["eno1"]                                           |  10882 |
    | 168689 | net.if.out["eno2"]                                           |  10882 |
    | 168690 | net.if.out["eno3"]                                           |  10882 |
    | 168691 | net.if.out["eno4"]                                           |  10882 |
    | 168692 | vfs.file.contents["/sys/class/net/eno1/operstate"]           |  10882 |
    | 168693 | vfs.file.contents["/sys/class/net/eno2/operstate"]           |  10882 |
    | 168694 | vfs.file.contents["/sys/class/net/eno3/operstate"]           |  10882 |
    | 168695 | vfs.file.contents["/sys/class/net/eno4/operstate"]           |  10882 |
    | 168696 | vfs.file.contents["/sys/class/net/eno1/type"]                |  10882 |
    | 168697 | vfs.file.contents["/sys/class/net/eno2/type"]                |  10882 |
    | 168698 | vfs.file.contents["/sys/class/net/eno3/type"]                |  10882 |
    | 168699 | vfs.file.contents["/sys/class/net/eno4/type"]                |  10882 |
    | 168700 | vfs.dev.read.await[sdc]                                      |  10882 |
    | 168701 | vfs.dev.read.await[sdb]                                      |  10882 |
    | 168702 | vfs.dev.read.await[sda]                                      |  10882 |
    | 168703 | vfs.dev.write.await[sdc]                                     |  10882 |
    | 168704 | vfs.dev.write.await[sdb]                                     |  10882 |
    | 168705 | vfs.dev.write.await[sda]                                     |  10882 |
    | 168706 | vfs.file.contents[/sys/block/sdc/stat]                       |  10882 |
    | 168707 | vfs.dev.write.time.rate[sdc]                                 |  10882 |
    | 168708 | vfs.dev.write.rate[sdc]                                      |  10882 |
    | 168709 | vfs.dev.util[sdc]                                            |  10882 |
    | 168710 | vfs.dev.read.time.rate[sdc]                                  |  10882 |
    | 168711 | vfs.dev.read.rate[sdc]                                       |  10882 |
    | 168712 | vfs.dev.queue_size[sdc]                                      |  10882 |
    | 168713 | vfs.file.contents[/sys/block/sdb/stat]                       |  10882 |
    | 168714 | vfs.dev.write.time.rate[sdb]                                 |  10882 |
    | 168715 | vfs.dev.write.rate[sdb]                                      |  10882 |
    | 168716 | vfs.dev.util[sdb]                                            |  10882 |
    | 168717 | vfs.dev.read.time.rate[sdb]                                  |  10882 |
    | 168718 | vfs.dev.read.rate[sdb]                                       |  10882 |
    | 168719 | vfs.dev.queue_size[sdb]                                      |  10882 |
    | 168720 | vfs.file.contents[/sys/block/sda/stat]                       |  10882 |
    | 168721 | vfs.dev.write.time.rate[sda]                                 |  10882 |
    | 168722 | vfs.dev.write.rate[sda]                                      |  10882 |
    | 168723 | vfs.dev.util[sda]                                            |  10882 |
    | 168724 | vfs.dev.read.time.rate[sda]                                  |  10882 |
    | 168725 | vfs.dev.read.rate[sda]                                       |  10882 |
    | 168726 | vfs.dev.queue_size[sda]                                      |  10882 |
    | 168727 | vfs.fs.inode[/,pfree]                                        |  10882 |
    | 168728 | vfs.fs.inode[/opt,pfree]                                     |  10882 |
    | 168730 | vfs.fs.size[/,pused]                                         |  10882 |
    | 168731 | vfs.fs.size[/opt,pused]                                      |  10882 |
    | 168733 | vfs.fs.size[/,total]                                         |  10882 |
    | 168734 | vfs.fs.size[/opt,total]                                      |  10882 |
    | 168736 | vfs.fs.size[/,used]                                          |  10882 |
    | 168737 | vfs.fs.size[/opt,used]                                       |  10882 |
    | 169613 | discovery.proc.single[mysqld]                                |  10882 |
    | 169800 | proc.mem[{#PR},,,,pmem]                                      |  10882 |
    | 170286 | discovery.proc.single[mariadbd]                              |  10882 |
    | 170473 | proc.mem[{#PR1},,,,pmem]                                     |  10882 |
    +--------+--------------------------------------------------------------+--------+
    154 rows in set (0.037 sec)
    Search on this host by key
    Code:
    MariaDB [(none)]> SELECT itemid,key_,hostid FROM zabbix.items where hostid like '10882' and key_ like 'mysql.%';
    Empty set (0.001 sec)​
    I have not any ideas how to fix it.
    I will be glad for any help

    Comment

    • oxpy
      Junior Member
      • Oct 2022
      • 8

      #3
      Up Up Up Up Up

      Comment

      • LenR
        Senior Member
        • Sep 2009
        • 1005

        #4
        The error messages are pretty self explanatory, both are a template loop you have created. The item won't be on the host since the template linking failed.

        Does Template DB MySql link NetScan OS Generic Template​? Have you inverted some linkage?

        Comment


        • oxpy
          oxpy commented
          Editing a comment
          No, does not linked and this is a problem. What do you mean by "inverted some linkage"?
      • oxpy
        Junior Member
        • Oct 2022
        • 8

        #5
        Up please, because this problem is still there

        Comment

        • solution
          Senior Member
          • Jun 2020
          • 269

          #6
          Do you have hosts associated with the template? Any of the templates you are changing.
          - Unlike (and Clear preferably) all Hosts linked to each template
          - Link the templates
          - Link Hosts to Final Template​


          Wellington

          Comment


          • oxpy
            oxpy commented
            Editing a comment
            I have a lot of hosts associated with "NetScan OS Generic Template", but on another hand I don't have any hosts associated with "Template DB MySQL"
            But I got your idea

            I will set the test test server up and check your advice
            Thank you 
        • Brismtedt
          Junior Member
          • Jul 2009
          • 22

          #7
          I had the same problem:

          I have a template: Template APP Systemd by Zabbix agent 2

          I try to add it to "Template OS Linux by Zabbix agent" template.

          I get the following error an a number of host:
          Cannot inherit item prototype with key "systemd.socket.conn_accepted.rate["{#UNIT.NAME}"]" of template "Template OS Linux by Zabbix agent" to host "xxx", because an item with the same key is already inherited from template "Template OS Linux by Zabbix agent".
          If I add the "Template APP Systemd by Zabbix agent 2" template directly to the host "xxx", it works and if I then try to add the "Template APP Systemd by Zabbix agent 2" to "Template OS Linux by Zabbix agent" I get expected:

          Cannot link template "Template APP Systemd by Zabbix agent 2" to template "Template OS Linux by Zabbix agent", because it would be linked to host "xxx" twice.
          If I remove the template "Template APP Systemd by Zabbix agent 2" from host "xxx" and then try to add the template to "Template OS Linux by Zabbix agent"​ again, I get the error message again for another host:

          Cannot inherit item prototype with key "systemd.socket.conn_accepted.rate["{#UNIT.NAME}"]" of template "Template OS Linux by Zabbix agent" to host "yyy", because an item with the same key is already inherited from template "Template OS Linux by Zabbix agent".
          After adding/removing the systemd template to each host it reports as error, after a few hosts it works :-P

          Comment

          Working...