KnowledgeBase Content Details

March 09, 2015


Is there an example Event Engine script for GeneSifter Laboratory Edition?


Is there an example Event Engine script for GeneSifter Laboratory Edition?

The instructions below detail an example script and test case for using the Event Engine as a means to trigger a custom script.

  1. Background

    These instructions are targeted at developers and administrators with basic Linux experience. The demo will use the "Template Creation" Event for demonstration purposes, but the principals apply to all GeneSifter events.

  2. Choose an Installation Directory

    First, establish an SSH login onto your server (SSH) and chose a directory you want to put your script in. You can use any directory on the server so long as the script is readable and executable to the software. The following example uses our default bin directory.

  Event Engine Script - Picture 1
    Figure 1 - Event Engine Script - Picture 1.
  3. Install Script

    Next copy our demo script into the directory. You can download it here or download it directly to your GSLE server via commnd line tool. For example:

  Event Engine Script - Picture 2
    Figure 2 - Event Engine Script - Picture 2.

    The script needs to be executable by the software which is owned by the Linux user "geospzia". The next two commands will ensure the software can call the script successfully.

  Event Engine Script - Picture 3
    Figure 3 - Event Engine Script - Picture 3.

    You can test the script by executing it via command line.

  Event Engine Script - Picture 4
    Figure 4 - Event Engine Script - Picture 4.
  4. Create a new handler

    Now that your script is in place and ready to use you will need to teach the software of its existence, and tie and event to it. To do this navigate to your Event Handler page by clicking System Tab → View Handlers → Add Handler. Then use the pulldown to change the Type to "Script".

    Next give your script a name (label), set it to active, and provide the script location. The location is the path (dir) viewable by the GSLE server. It is not a path on your local computer. If you are unsure what path to use please contact your local Linux Systems Administration resource or IT department. In the example below we are using the GSLE bin path of "/usr/local/geospiza/bin".

  Event Engine Script - Picture 5
    Figure 5 - Event Engine Script - Picture 5.
  5. Assign to Event

    Now that you have a working script and you have made the GSLE software aware of it in a handler, the last step is to assign it to an Event. Navigate System Tab → View Events. Click on "Bind Handlers" for the "TemplateCreated" event. Follow the prompts on subsequent pages to select the handler we created above for this event. After saving you should be ready to test everything.

  6. Test

    The last thing you need to do is test the process to make sure it is working. To do this simply create a new template in the system. With each newly added template you should also see a new entry in the /usr/local/geospiza/bin/ee-demo-out.txt file.

    This concludes the test case for using a custom script with our Event Engine. If you have any further questions please feel free to contact us by writting support. Note that we do not provide help for writing or troubleshooting your custom scripts.


Q: Do I have to use Perl?

A: No, you are free to use any language installed on your server.

Q: The demo script is great for testing and getting started, but do you have any other scripts that do more?

A: What the script accomplishes is up to you. Some ideas to get you started are:

  1. Sending information to 3rd party systems or databases.
  2. Sending updates to an RSS/Twitter feed to alert the lab on certain events
  3. Auto printing submitted orders
  4. Using the event engine in conjunction with our SQL and/or Input API as a means of further extending and automating your GSLE server.

Back to KnowledgeBase