Index

ShellAction

  1. Description
  2. Configuration

run any arbitrary local system command.

Description

This event handler can be configured to run an arbitrary local system command subject to local security restrictions. This is one of the ways to connect events to external activity. It is not expected for it to be used for any activity that is run very frequently, i.e. less than once every 5 minutes.

Configuration

    <eventInterface module='EventHandlers.ShellAction' name='ShellAction'>
        <eventtype type="http://id.webbrick.co.uk/events/webbrick/TD">
            <eventsource source="webbrick/100/TD/0" >
	        <event>
		    <command cmd='cmd.exe' params=' echo response string1> TestShellAction.txt' />
	        </event>
            </eventsource>
        </eventtype>
    </eventInterface>
    

Environment

The attribute cmd is not actually used, it is the section in params that is passed to the command processor

For the Gateway Appliance this is the /bin/bash shell. For a Windows environment this is cmd.exe

Linux Example

    <eventInterface module='EventHandlers.ShellAction' name='ShellAction'>
        <eventtype type="phones">
            <eventsource source="doorbell" >
	        <event>
		    <command cmd='bash' params=' python pushchime --ip ext210 doorbell2.raw' />
	        </event>
            </eventsource>
        </eventtype>
    </eventInterface>
    

From build number 3043

The facility to make string substitutions for the attributes within events was added.

Example:

    <command cmd='bash' params=' python pushchime.py --ip %(adr)s --sound %(sound)s' />