Location:  WebCFG documentation > XML specification

Action

Type: Action
Parent: Button, WCapp, Handler

This element references to an external script or program to be executed. It can be invoked locally or remotely using the shell attribute.

Attributes
Attribute Description Usage
id Unique ID of the current element. optional
execute The command string to be executed. It must be reachable by the shell or on the local system (the system WebCFG is running on). required
shell Defines a remote shell to execute the given command in. Available protocols are:
  • ssh
  • rexec
  • rsh
  • local
See below for some examples.

If not set, the command will be executed locally.
optional
timeout Defines the time im ms for waiting for finishing the command.
Defaults to 10000. This attribute works only for ssh at the moment
optional
silent Allowed values: true, false

If set to true, only error messages are printed to the command output window. If set to false the everything printed to STDOUT will also be printed to the command output window.

Defaults to false.
optional
popup Allowed values: true, false

If set to true, the command output will be printed to a popup windows, otherwise to a new site in the same window.

Defaults to true.
optional
reload Allowed values: true, false

If set to true, the browser will refresh the metaconfiguration after executing the action.

Defaults to false.
optional
Examples
<button id="save" displayname="Active Setup" scope="global">
   <save/>
   <action execute="${activation.script} /> 
</button>

This example defines a button that saves the configuration and afterwards executes the defined action.

<button id="showDeskfree" displayname="Show free space on disks">
   <action execute="/usr/bin/df -h shell="ssh://${user}:${password}@${host}" /> 
</button>
    	

An action on a remote host is executed like shown above. This is done using the shell attribute. The syntax is always as follows:

protocol://user:password@host
e.g.
ssh://user:password@host
rexec://user:password@host
rsh://user:password@host
local://user:password@host

rexec makes it possible to run commands on servers running Microsoft Windows.

If you encounter problems using the SSH shell, check the following settings in /etc/ssh/sshd_config on the server you want to connect to:

Make sure the following setting is not commented out:
PasswordAuthentication yes

Make sure the following setting is commented out:
#Ciphers aes256-cbc,aes128-cbc

top