Differences between revisions 1 and 2
Revision 1 as of 2009-10-02 17:01:39
Size: 5678
Editor: ahasenack
Revision 2 as of 2019-05-06 16:44:44
Size: 0
Editor: bryanquigley
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Tags =
Very often we need to apply some action to several computers at once. Landscape, as we know, is very good at that. When we want to upgrade all computers, we just select them all and go to the package page and click on the available upgrades.

We might also need to send a script to just a few computers, say, all the file servers. Again we start with the computers page, select the ones we want and send the script.

But selecting computers every time can become boring, not to mention time consuming and prone to errors. What if one is forgotten? What if a hundred machines need to be selected out of a thousand?

This is where tags come in. Tags, simply put, are a way to group computers. They are like little text labels we attach to a computer.

To deal with the problem outlined previously, for example, we could create a tag called "file_server" and attach it to all the computers that have this role. Even better, the tag can be attached to the machines as we accept them in Landscape.

So whenever a script needs to be sent to all file servers, the "selecting computers" part of the work flow now only requires one click on the "file_server" tag.

Let's see how this all works!

 {i} There is a tags screencast available on youtube showing a demonstration about how to use tags in Landscape: [[http://www.youtube.com/watch?v=56Mfi6Dl8VY]]

== Tagging existing computers ==
These are the steps we need to take to tag existing computers:
 1. Click on "computers" in the left menu. This will display all computers in the account
 1. Once they are displayed, select the ones we want to tag
 1. Now click on "Info" in the lower toolbar
 1. Type in the tag or tags we want to attach to the selected computers, separating them with spaces
The screenshot below shows the info page and the tags "laptop" and "lenovo" being added to the selected machines:


After the tags were added, we see them under the "Computers" item in the left menu:


From now on, whenever we want to do something with those machines, we can use the tags "shortcut" to display them in the computers page instead of having all computers listed and then searching for these two in particular.

 {i} When a tag is clicked on, the computers associated with it are displayed, but not selected. You still have to select them before moving further. A quick way to do it is to click on "Select all", since we are now only displaying the machines with the selected tag.

== Tagging new computers ==
A great time to tag computers is when they are being accepted into Landscape. The "Pending computers" page allows the administrator to apply one or more tags to the computers that will be registered:


In this example, the first four machines will all be tagged with "server" and "ubuntu" when they are accepted into Landscape. Any of the existing tags could also be used by just clicking on them.

== Managing existing tags ==
Existing tags are managed via the "Info" page of selected computers. That's where we add or remove tags from the machines.

Let's say we want to remove the "server" tag from the machine "fw01":
 1. Click on "Computers" on the left menu and select only the "fw01" machine. Alternatively, since it has the "server" tag, one can also click on the tag instead. The important part is to only have the computer "fw01" selected before proceeding
 1. Click on "Info" in the lower toolbar, which brings us to the following screen:


 1.#3 This shows us which tags the machine already has. Here we can just click on the tag we want to remove ("server") to have the text box be filled with it automatically, or we can just type it in.
 1. Now when we click on "Remove", the tag will be removed from the selected computer.

If we want to remove a tag from several computers, the procedure is almost the same. Just start by selecting the computers first and then go to the same "Info" page.

== Where else tags are used ==
All over Landscape, tags are used mostly in the same way as computer selections, that is, any operation that affects computers can be started by clicking on a tag.

There are two other places, however, where this is slightly different: alerts and custom graphs.

In Custom Graphs, tags are used to select which computers will receive each graph script. For example, we would perhaps only send the database queries script to machines with the "database" tag, or the disk performance one to machines with the "file_server" tag. The default is to send all scripts to all machines.

Tags can be used in alerts to filter which machines are subject to which alerts. The only exception is the "new pending computer" alert, since it won't have any tag associated with it because it's noy yet a Landscape managed machine.

In both cases, more than one tag can be selected, so we are effectively performing a "union" between tags.

== Overlapping tags ==
A very useful features of tags is the fact that a computer can have several tags attached to it. For example, a file server could have these tags:
 * `file_server`: that's it's main duty
 * `hardy`: it's a Hardy installation
 * `24by7`: it should not be restarted lightly
And so on. In the future we may provide the capability of doing some filtering with several tags, like exclusions or unions. Stay tuned.