Open Configuration | Templates. As we can see, there are already 38 predefined templates. We will create our own specialized one though; click on Create template. This opens a simple form that we have to fill in:
C_Template_Linux
Custom templates
The C_
at the front of the name stand for "Custom". We are also creating a new group to hold our templates in, and instead of going through the group configuration we use the shortcut for group creation on this form. When you are done, click on Add.
We now have the template, but it has no use—there are no items or triggers in it. Go to Configuration | Hosts, where we will use a lazy and quick solution—we will copy existing items and triggers into the new template. Select Linux servers in the Group dropdown, then click on Items next to Another host. Mark all items by clicking in the checkbox in the header and click on the Copy button at the bottom.
In the next screen, choose Templates in the Target type dropdown and Custom templates in the Group dropdown. That leaves us with single entry, so mark the checkbox next to C_Template_Linux in the Target section:
When you are done, click on Copy. All items should be successfully copied.
In the upper left corner, click on the Details link. That expands the messages, and we can see that all of these items were added to the target template:
Now we have to do the same with triggers, so click on Triggers in the navigation bar above the item list, then click the checkbox in the header. This time uncheck the One SSH service is down, because this trigger spans both hosts. If we copied this trigger to the template, that would create all kinds of weird effects.
Again, click on the Copy button at the bottom. In the next screen, choose Templates in the Target type dropdown and Custom templates in the Group dropdown. Mark the checkbox next to C_Template_Linux in the Target section, then click on Copy. All triggers should be successfully copied. Of course, we don't have to create a host first, create entities on it, then copy them to a template—when creating a fresh template, you'll want to create entities on the template directly. If you have been less careful and haven't thought about templating beforehand, copying like this is a nice way to create the template more quickly.