Skip to main content

PSLang Scripts for interface programs

All interface programs require PSLang scripts to configure event actions. Configuration file names match the appropriate interface program; for example, write pxnull.cfg to configure event actions triggered by the pxnull program. Programs are listed in Interface programs.

Modify the appropriate sample script in the samples directory and place it in the \<instance>\script\ directory. If you cannot find the sample file, try re-running setup to modify your installation. Sample files are automatically installed with complete (typical) installations. You can select them in custom installations.

Functions

When creating a configuration file, use the event option name as the function name. For example, if you want pxnull to handle failed administrator login attempts, enable the USER LOGIN FAILURE option, and include a USER_LOGIN_FAILURE entry function in your pxnull.cfg script.

Global variables

When an interface program runs a function, it automatically defines three associative array variables at global scope. These variables are:

general

Contains key-value pairs that describe the event, such as the operation name, date and time of the event, as well as the IP address of the user that generated the event. The key-value pairs include:

  • operation The name of the event

  • sessid The identifier for the event

  • batchsig The batch identifier for the event

  • hextime The number of seconds since January 1, 1970

  • ctime The time that the event occurred as a human-readable string

  • date The date the event occurred in YYYYMMDD format

  • hhmmss The time the event occurred in HH:MM:SS format

  • remote_addr The address of the person who made the request

  • logfilename The log file for the program that ran pxnull

  • adminid The target administrator for the external system, if configured for a IT Service Management (Ticket) system target

  • adminpwd The password for the external system administrator

  • sysid The system administrator for the external system, if supported by the target type

  • syspwd The system administrator password, if supported by the target type

  • targetaddress The target address for the external system, if configured for a ticket system target.

sessdat

Contains key-value pairs in the session of the user that generated the event. The contents will vary greatly from one event to another, but typically includes:

  • adminid The ID of the console/help desk user who made the request

  • userid The ID of the person who made the request

  • username The full name of the person who made the request

sesslog

This variable is an array of associative arrays. Each associative array in sesslog corresponds to a single entry in the session log for the current login.

Each associative array includes the following key-value pairs:

  • tstart Hexadecimal representation of the start time, in the Unix epoch, counted in seconds

  • tend End time (as above)

  • reqby The user that issued the operation user The user affected by the operation

  • hostid The ID of the target system affected by the operation

  • host The description of the target system affected by the operation

  • longid This is the account ID of the user on the target specified in the hostid value

  • oper The type of operation

  • result The result code or the error message

    Key names are case sensitive and must be lowercase.

Additional variables

There are three additional associative arrays available. These arrays are passed into interface programs via event settings. Each array includes key-value pairs for corresponding attributes.

  • reqattrs for REQUESTER_ATTRIBUTES trap file sections.

    This array cannot be used with any module login success or failure event settings.

  • recattrs for RECIPIENT_ATTRIBUTES trap file sections.

    This array can be used with any event setting, except for USER_CREATE_FAILURE.

  • rattrs for REQUEST_ATTRIBUTES trap file sections.

    This array can be used with any workflow-related event settings except for USER_DELETE_FAILURE, USER_ENABLE_FAILURE, USER_CREATE_FAILURE, and USER_DISABLE_FAILURE.

Initialization function

To set up an interface with a ticket system, the script must call the initializeInterface() PSLang function for each operation. This function takes an associative array that must include key-values for the target server and administrative credentials. Some target systems require more; for example, Remedy Action Request System requires the form name and language.

See the appropriate IT Service Management (Ticket) Systems chapter for required key-values for each type of external program.

Once initialized, actions related to the operation can be performed. This includes searching, assigning, and updating records or tickets.

Use pxnull when you need to integrate with systems or business processes that cannot be supported through any of our other interfaces. Note that the search, assign, and append functions are not available to pxnull due to its generic nature.

Using ticket target systems

You can can specify interface targets in event settings. When you do this, the administrator credentials for the interface system are sent to the interface binary for use in the PSLang script. This allows you to support multiple servers/systems without having to place the administrator credentials into the interface’s configuration file; for example:

$initlist["userid"] = $general["adminid"];
$initlist["password"] = $general["adminpwd"] ;
$initlist["server"] = $general["targetaddress"] ;

If you use a target ID as one of your comma-separated values in an event setting, Bravura Security Fabric includes appropriate administrative credentials in the data it sends to the interface executable. The interface will then provide this additional information to the PSLang script via the $general associative array.

If a ticket system target supports additional system credentials, the session information can also include the system administrator ID (sysid) and password (syspwd).

Target types are listed in IT Service Management (Ticket) Systems. See the appropriate chapter for your external system type to learn how to target the system.