You are here: 17 Object Triggers > Trigger Variables > References > Internal Variables

17.29 Internal Variables

Several internal variables are available for use in trigger scripts. These can be accessed using $<varName>.

Internal Variables
COMPLETIONCODE When used in conjunction with the config parameter "JOBCFG" and a trigger event type of "end", it provides the trigger with the return code of the job.
ETYPE The type of event that signals that the trigger can fire. ETYPE values include cancel, checkpoint, create, end, fail, hold, migrate, preempt, standing, start, and threshold.
OID The name of the object to which the trigger was attached
OTYPE The type of object to which the trigger is attached; can be rsv, job, node, vm, or sched
OWNERMAIL A variable that is populated only if the trigger's parent object has a user associated with it and that user has an email address associated with it
REQUESTGEOMETRY

Passed to the Elastic Computing trigger script as a variable. Action="$HOME/geometry.pl $REQUESTGEOMETRY

Example:

QOSCFG[sample] TRIGGER=EType=start,AType=exec,TType=elastic,Action="$HOME/geometry.pl $REQUESTGEOMETRY",timeout=5:00
TIME

The time of the trigger launch in the following format:

Wed Mar 10 12:35:12 2012

USER The user (when applicable)

17.29.1 Object-specific Internal Variables

Job Variables
HOSTLIST The entire hostlist of the job
JOBID

String that identifies the job

You must also have REQUESTGEOMETRY=PRIORITYJOBSIZE to get the JOBID.

MASTERHOST The primary node for the job
Reservation Variables
HOSTLIST The entire hostlist for the reservation
OBJECTXML The XML representation of an object output is the same that is generated by mdiag -r --xml
OS The operating system on the first node of the reservation
OWNER The owner of the reservation

Example 17-2: Internal variable example

AType=exec,Action="/tmp/trigger.sh $OID $HOSTLIST",EType=start

The object ID ($OID) and hostlist ($HOSTLIST) will be passed to /tmp/trigger.sh as command line arguments when the trigger executes the script. The script can then process this information as needed.

© 2016 Adaptive Computing