WebSphere

Creating an event filter with scripting

You can create an event filter using a Jacl or Jython script.

Before you begin

Before starting this task, the wsadmin tool must be running. See the WebSphere® Application Server documentation for more information.

About this task

Perform the following steps to configure a new event filter.
Procedure
  1. Identify the Common Event Infrastructure provider ID.
    • Using Jacl:
      set providerid [$AdminConfig getid \
      /Cell:mycell/Node:mynode/Server:myserver/ \
      EventInfrastructureProvider:/]
    • Using Jython:
      providerid =
      AdminConfig.getid('/Cell:mycell/Node:mynode/Server:myserver/EventInfrastructureProvider:/')
      print providerid
    Example output:
    EventInfrastructureProvider(cells/mycell/nodes/mynode/servers/myserver|resources-cei.xml#
    EventInfrastructureProvider_1)
  2. Set the required attributes.
    • Using Jacl:
      set Name [list name "EventFilterName"]
      set JndiName [list jndiName "Put JNDI name for new event filter here"]
      set Description [list description "Set description of event filter here"]
      set Category [list category "Set category for event filter here"]
      
      # escape all ‘[‘ characters in the configuration string
      # (for example, "CommonBaseEvent\[@severity=50\]"
      set filterConfigurationString [list filterConfigurationString \
        "Set filter configuration string here"]
    • Using Jython:
      Name = ['name', 'EventFilterName']
      JndiName = ['jndiName',  'Put JNDI name for new event filter here']
      Description = ['description', 'Set description of event filter here']
      Category = ['category', 'Set category for event filter here']
      FilterConfigurationString = ['filterConfigurationString', \
        'Set filter configuration string here']
  3. Set the properties for the new event filter.
    • Using Jacl:
      set properties [list $name $jndiName $description $category \
      $filterConfigurationString]
    • Using Jython:
      properties = [Name,JndiName,Description,Category,FilterConfigurationString]
      print properties
    Example output:
    [['name', 'EventFilterName'], ['jndiName', 'Put JNDI name for new 
    event filter here'], ['description', 'Set description of event 
    filter here'], ['category', 'Set category for event filter 
    here'], ['filterConfigurationString', 'Set filter configuration 
    string here']]
  4. Create the event filter.
    • Using Jacl:
      set filterProf [$AdminConfig create FilterFactoryProfile \
      $providerid $properties]
    • Using Jython:
      print AdminConfig.create('FilterFactoryProfile', providerid, properties)
    Example output:
    EventFilterName(cells/mycell/nodes/mynode/servers/myserver|resources-cei.xml#FilterFactoryProfile_1)
  5. Save the configuration changes.
  6. In a network deployment environment only, synchronize the node.
  7. Restart the server.

task Task topic

Terms of use | Feedback


Timestamp icon Last updated: 22 June 2010


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic/com.ibm.websphere.cei.620.doc/doc/tcei_create_filter_profile_script.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).