Follow

How to Add an Indexed Event Detail

Applies To

  • Resource Manager 5.1.x
  • Resource Manager 6.x

Summary

The Resource Manager event console is a powerful tool for sorting and filtering events from your infrastructure.  However, filtering and sorting can only be performed against event fields that have been indexed.  If you find it necessary to index a new field, the following steps will take you through the process.

Procedure

To begin, we will create a ZenPack to contain your indexed event details.  Create your new ZenPack from the Control Center command line and note that the ZenPack name given is for example purposes only.  Please note that this step may take several minutes and will exit back to the command line when complete.

 

serviced service run zope zenpack-manager create ZenPacks.companyName.NewEventAttributes

 

Launch a new zope shell:

 

serviced service shell zope

 

Change to the zenoss user:

 

su - zenoss

 

Change to the zep directory in the new ZenPack with

 

cd /opt/zenoss/ZenPacks/ZenPacks.companyName.NewEventAttributes/ZenPacks/zenoss/NewEventAttributes/zep/

 

Copy the zep.json.example to zep.json:

 

cp zep.json.example zep.json

 

Edit the zep.json file to include your indexed event details, like so:

 

{
    "EventDetailItem": [
        {
            "key": "rig",
            "type": "1",
            "name": "Rig"
        },
        {
            "key": "host",
            "type": "1",
            "name": "Host"
        },
        {
            "key": "app",
            "type": "1",
            "name": "App"
        }
    ]
}

 

EventDetailItem is the required reserved keyword and is a list of dictionaries where each dictionary specifies a field. The key attribute must match the name of the event attribute; the name field is the user-friendly name used in the GUI. Help for the type field is given in the sample zep.json.example, where a type of 1 defines a string value.  Additional information on event detail types can be found in the zep.json.example file.

In the above example, an event transform creates evt.rig, evt.host and evt.app. The GUI Event Console will allow you to select Rig, Host and App as event columns to filter on.  Note the capitalization difference; these are the "friendly" names defined in the "name" fields above.  

 

Build your egg and move it to your home directory:

 

cd $ZENHOME/ZenPacks/ZenPacks.companyName.NewEventAttributes
python setup.py bdist_egg
cd dist
cp ZenPacks.companyName.NewEventAttributes* /mnt/pwd

 

Drop back to the root user and copy the ZenPack to /mnt/pwd.

 

cp /opt/zenoss/ZenPacks/ZenPacks.companyName.NewEventAttributes/dist/ZenPacks.companyName.NewEventAttributes-1.0.0-py2.7.egg /mnt/pwd/

 

Exit the container and install the ZenPack:

 

exit
serviced service run zope zenpack-manager install ZenPacks.companyName.NewEventAttributes*

 

Stop zeneventserver and rebuild the Lucene indices:

 

serviced service stop zeneventserver
TENANT_ID=$(serviced service status | grep Zenoss.resmgr | awk '{print $2}')
cd /opt/serviced/var/volumes/$TENANT_ID/zeneventserver/index/
rm -rf archive/ summary/
serviced service start zeneventserver

 

Restart Resource Manager:

 

serviced service restart Zenoss.resmgr

 

Log into the UI and add the new columns to the Event Console with the Configure > Adjust Columns button.  Make sure you scroll down in the Columns to display list - the new fields will be at the bottom.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk