The Tivoli Enterprise Console is a powerful tool for gathering alert information across an environment, meaning that there is often a large number of users who want to see the events relevant to them. Creating all the Event Groups and filters required to service all these users can be quite a task.
For example, a group of DBAs will want event groups which only show DB related events, events from systems running databases, or a mixture of both. Setting up such groups using the existing GUI or CLI tools can be extremely time consuming, especially if a filter needs to match a large number of hostnames, as each has to be entered individually.
This tip presents a script - smartfilter.pl - designed to ease this process. This script creates filters based on sources where information about events is already grouped: in BAROC files and Framework resources.
The smartfilter.pl script is run as follows:
smartfilter.pl -E <group> -n <name> [-o] [-D <desc>] [-u <user>] [-p <pwd>] [-h <host:[port]>] <item> [<item>...]
The command line parameters function as follows:
| Parameter | Type | Function |
|---|---|---|
| -E <group> | Required | The name of Event Group to create the filters for. The Event Group must exist. |
| -n <name> | Required | The name of the filter to be created. |
| -D <desc> | Optional | A description for the new filter. |
| -o | Optional | Makes the script output the commands it would run instead of actually executing them. |
| -u <user> | Optional | Tivoli Administrator Login ID, if required by wconsole. |
| -p <pwd> | Optional | Tivoli Administrator password, if required by wconsole. |
| -h <host[:port]> | Optional | Host to log in to, if required by wconsole. |
| <item> [<item>...] | Required | Item(s) used to create filter. See below for details. |
The following items can be used to create filters:
| Item | Example | Filter Created |
|---|---|---|
| BAROC File | database.baroc | A filter is created which will match on any of the BAROC classes defined in the file. |
| Profile Manager | @ProfileManager:sub.pm.dbs | A filter is created which matches the hostname slot against the labels of any Endpoints subscribed to the Profile Manager. |
| Gateway | @Gateway:mn01-gw | A filter is created which matches the hostname slot against the labels of any Endpoints connect to the Gateway. |
| Endpoint | @Endpoint:myep | A filter is created which matches the hostname slot against the Endpoint label. |
When mutiple items are specified the list of possible matches increases. For example, if two Profile Managers are specified, a match can come from the Endpoints subscribed to either.
smartfilter.pl -E DBA -f dbevents SQLServer.baroc DB2.baroc
This creates a filter which will show any event which has a class from the SQLServer.baroc file or the DB2.baroc file.
smartfilter.pl -E DBA -f dbservers @ProfileManager:sub.db.sql @ProfileManager:sub.db.db2
This creates a filter which will show any event which has a hostname which matches the label of an Endpoint subscribed to either the sub.db.sql Profile Manager or the sub.db.db2 Profile Manager.
smartfilter.pl -E DBA -f sqlserver @ProfileManager:sub.db.sql SQLServer.baroc
This creates a filter which will show any event which has a class from the SQLServer.baroc file and hostname which matches the label of an Endpoint subscribed to either sub.db.sql profile manager.
smartfilter.pl -E Tivoli -f gw01 -D "Gateway Filter" -o @Gateway:gw01
This will display the command used to create a filter which will show any event which has a hostname which matches the label of an Endpoint connected to Gateway gw01. The filter will not actually be created.