Administer > Event Synchronization > How to Write Perl Scripts for Event Synchronization

How to Write Perl Scripts for Event Synchronization

The ombacksync process on the Operations Connector server receives event updates from the OMi data processing server. To forward these changes to the third-party system, you must provide the OMBackSync.pl Perl script that closes the event in the third-party system.

The Perl script must call the subroutine OMBackSync, which supports the following parameters:

  • Operation (Init or Close)

  • ID (Close only)

When the ombacksync process starts, it processes the Perl script and calls the subroutine OMBackSync with the parameter Init. When the process receives an event with the status closed, ombacksync calls the subroutine OMBackSync with the parameters Close and ID.

The script must be named OMBackSync.pl. Only one instance of the script can exist in Operations Connector. If multiple integrations are hosted on Operations Connector, all integrations must merge their event synchronization code into a single OMBackSync.pl file. When uninstalling an integration, the integration must remove its event synchronization code from the file.

Operations Connector provides an example Perl script (OMBackSync.pl) that writes the time, date, operation, and ID to the file OMBSOutput.txt.

The OMBackSync.pl file is located at:

Windows: "%OvDataDir%\conf\backsync\OMBackSync.pl"

Linux: /var/opt/OV/conf/backsync/OMBackSync.pl

The OMBSOutput.txt file is located at:

Windows: "%OvDataDir%\tmp\OMBSOutput.txt"

Linux: /var/opt/OV/tmp/OMBSOutput.txt

The OMBackSync.pl script does not encrypt user credentials. If you need to add user credentials to the script, for example for connecting to an external management tool, use file system permissions to restrict access to the script.

To forward event changes to the third-party system:

  1. Write a Perl script that calls the subroutine OMBackSync with the parameters Operation and ID.

  2. Name your Perl script OMBackSync.pl and place it in the following folder on the Operations Connector server:

    Windows: "%OvDataDir%\conf\backsync\OMBackSync.pl"

    Linux: /var/opt/OV/conf/backsync/OMBackSync.pl

  3. Restart the ombacksync process on the Operations Connector server:

    ovc -restart ombacksync

Troubleshooting:

If the ombacksync process encounters syntax errors in the Perl script, it generates an event describing the problem and stops. Correct the syntax and restart the ombacksync process.