Ad Widget

Collapse

Is this the right way to clone?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GeeBee
    Junior Member
    • Jun 2021
    • 5

    #1

    Is this the right way to clone?

    I am new to Zabbix, I mean really new. I added hosts started monitoring using predefined templates (so cool). That seems to get me going out of the box and looked promising. However ... some items/triggers don't work for me, so I want to change them. Since they're part of a template, I cannot change them (it took me a while to figure that out). After some Googling I figured out I needed to clone the items (or triggers) that I wanted to customize. But whenever I clone, I always get an error message that the cloned item already exists. These are the steps I take:

    Configure the host involved. Pick the item from the list of items for this host, clone the item, change the name, click the "Add button". --> Tells me that "Item with key already exists". Yeah, duh. I am trying to create a better one...

    So I'm stuck here. I assume I missed some part of the documentation, I was in a hurry to get started. Is this the way to do it? What am I missing?
    Yes, I am looking for an answer to my immediate problem, but if you can point me to a document that makes it clear what I am doing wrong that would be even better. After all, I am trying to learn here. Perhaps I missed the Zabbix 101 tutorial, which is holding me back. If so, where is this tutorial?

    Thanks in advance for reading this, I appreciate your patience.
  • GeeBee
    Junior Member
    • Jun 2021
    • 5

    #2
    Well, I never figured out how to clone. I'm not sure what it's even for, since what I wanted to do worked better with copy. Reading the documentation didn't help either, I'm probably reading the wrong documentation. Moving on to another monitoring product for now.

    Comment

    • derli1988
      Member
      • Apr 2021
      • 60

      #3
      If you want everything copied from a host, including templates, items, triggers and encryption you should choose full clone... If you want just the basics like hostname and IP you use clone.

      Comment

      • GeeBee
        Junior Member
        • Jun 2021
        • 5

        #4
        Thanks for the feedback. I just wanted to clone one item to try it out, but that never worked. I ended up using copy instead. I still wonder what the usefulness of clone is, that's why I was asking for a better document explaining this. Currently I am evaluating some other monitoring options (Spiceworks, Solarwinds), but I may do further evaluation of Zabbix later on.

        Comment

        • johndoe2374
          Member
          • Aug 2021
          • 80

          #5
          Originally posted by GeeBee
          Configure the host involved. Pick the item from the list of items for this host, clone the item, change the name, click the "Add button". --> Tells me that "Item with key already exists".
          Yep, as cyber said, all keys of the host suppose to be unique, not only names. So you can change some parameter in the key:
          system.swap.size[,free] -> system.swap.size[,used]

          and that will work.

          You use copy functionality to move item/trigger to another host, group or template. Cloning is still useful when you want to change key and name but leave all other stuff (polling intervals, tags, preprocessing rules).

          I've created separate group for my custom templates like "Templates/CompanyName" and clone templates I want to change into that group. I would also try to not modify defaul templates unless it's a small change: it will make updating them using new ones from git repository way easier and you'll be alway up to date for default items/triggers. For example, I'm using default "Windows by Zabbix agent active" template, but I usually disable services autodiscover, as it creates mess in triggers (definitely you don't want to monitor every service that's on your Windows machine that have startup type "Automatically" or "Automatically/Delayed", which is a strange choice for default). Also you can filter services being discovered using template's macros, or set up custom threshold for triggers: they're extremely usefull and can be overrided on top of templates for every host individually.

          Comment

          • GeeBee
            Junior Member
            • Jun 2021
            • 5

            #6
            Most of what is said above makes sense, but the GUI interface as far as item cloning stumped me. I was not woking with templates, but with individual items on a host. I chose an item I had made earlier, thinking I could "clone" it to another host. But once in the clone detail page, I did not know how to assign it to a different host. The "Host Interface" drop down did not offer any other option than the host/IP it was cloned from, making it unclear to me how to clone/copy the item to another host. I could change the name or the key, but I wanted to change the host (see attached screen shot). Still haven't figured that out...

            I think my confusion is related to the interpretation of "clone" vs "copy".
            Attached Files
            Last edited by GeeBee; 05-08-2021, 20:29.

            Comment

            • johndoe2374
              Member
              • Aug 2021
              • 80

              #7
              Well, when you "clone", you're duplicating item for that same host. When you "copy", you're literally making a copy of that item for another host/group/template.

              Cloning:
              - create same item for the same host with slightly different key parameters and name.

              Copying:
              - you've created some item and want to copy it to another host, hosts group or some template you've created earlier.

              Why copy to the template instead of hosts group? Because if you copy to the hosts group, these items copies will be independent and you can change them individually per host. But if you put this copy to some template and then assign this template to some hosts, later you might want to change something in that item for all hosts. For that you just need to make changes in the template and they'll be changed on all hosts with that template, so you won't need to change same item for like 20 hosts 20 times.

              Comment

              • GeeBee
                Junior Member
                • Jun 2021
                • 5

                #8
                Thanks. That clears it up for me.

                Comment

                • cyber
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Dec 2006
                  • 4807

                  #9
                  Originally posted by GeeBee
                  Configure the host involved. Pick the item from the list of items for this host, clone the item, change the name, click the "Add button". --> Tells me that "Item with key already exists". Yeah, duh. I am trying to create a better one...
                  So I'm stuck here. I assume I missed some part of the documentation, I was in a hurry to get started. Is this the way to do it? What am I missing?
                  You have missed the part, what says, that item key is unique within host. And that is what Zabbix told you also "Item with key already exists". If you clone and change the NAME, your item KEY is still same and that cannot be. Same way, you cannot assign 2 templates, which contain item with same key to one host.
                  https://www.zabbix.com/documentation...fig/items/item
                  Key Item key (up to 2048 characters).
                  The supported item keys can be found in individual item type sections.
                  The key must be unique within a single host.
                  If key type is 'Zabbix agent', 'Zabbix agent (active)' or 'Simple check', the key value must be supported by Zabbix agent or Zabbix server.
                  See also: the correct key format.
                  If something in default template does not suit you, I would clone that TEMPLATE and rename/reconfigure things in that clone and assign that clone to host, not the original one.
                  Last edited by cyber; 24-12-2021, 20:18.

                  Comment

                  Working...