Open topic with navigation

# Configure an Event Handler

Use the following procedure to configure an event handler.

To configure an event handler

1. Open the HPE Media Server configuration file in a text editor.

2. Use the `OnStart`, `OnFinish`, or `OnError` parameter to specify the name of a section in the configuration file that contains event handler settings for the corresponding event.

   - To run an event handler for all asynchronous actions, set these parameters in the `[Actions]` section. For example:

         [Actions]
         OnStart=NormalEvents
         OnFinish=NormalEvents
         OnError=ErrorEvents

   - To run an event handler for a specific action, set these parameters in the `[ActionName]` section, where `ActionName` is the name of the action. The following example runs an event handler when the `Process` action starts and finishes successfully:

         [Process]
         OnStart=NormalEvents
         OnFinish=NormalEvents

3. Create a new section in the configuration file to contain the settings for your event handler. You must name the section using the name you specified with the `OnStart`, `OnFinish`, or `OnError` parameter.

4. In the new section, set the following parameters.

   `LibraryName` | (Required) The name of the library to use to handle the event. To write event data to a text file, set this parameter to `TextFileHandler`, and then set the `FilePath` parameter to specify the path of the file. To send event data to a URL, set this parameter to `HttpHandler`, and then use the HTTP event handler parameters to specify the URL, proxy server settings, credentials, and so on.

   For example:

       [NormalEvents]
       LibraryName=TextFileHandler
       FilePath=./events.txt

       [ErrorEvents]
       LibraryName=HTTPHandler
       URL=http://handlers:8080/lo-proxy/callback.htm?

5. Save and close the configuration file. You must restart HPE Media Server for your changes to take effect.

The following XML is an example of the ACI response sent to the event handler on the `OnFinish` event:

    <action>
    	<status>Finished</status>
    	<queued_time>2009-Jun-08 17:57:29</queued_time>
    	<time_in_queue>0</time_in_queue>
    	<process_start_time>2012-Jun-08 17:57:29</process_start_time>
    	<time_processing>86</time_processing>
    	<token>MTkyLjE2OC45NS4yNDoxMTAwMDpJTkdFU1Q6LTEyOTc5NjgxODY=</token>
    </action>

© 2017 Hewlett Packard Enterprise Development LP | Send documentation feedback to HPE Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to AutonomyTPFeedback@hpe.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_HP_HTML5_bannerTitle.htm