17.0 Object triggers > Trigger variables > How-to's > Requesting name space variables

Conventions

17.20.5 Requesting name space variables

To request a name space variable in a trigger

  1. Configure the trigger. If it is attached to a generic system job, verify that it meets all the generic system job trigger requirements.
  2. Create an argument list in the Action attribute (after the script path and before the closing quotes) and request the desired variable with an asterisk (*) in place of the name space.
    ...Action="$HOME/myTrig.py $*.IPAddr"...

    Each applicable name space variable is added to the argument list in the format <varName>=<val>.

    For instance, the example above would cause the script to run the following way:

    > myTrig.py vc1.IPAddr=/tmp/dir1 vc2.IPAddr=/tmp/dir2 vc4.IPAddr=/tmp/dir3

    Any other arguments provided here without name spaces will not change.

  3. Filter which name spaces are passed down to a job trigger by setting trigns when you submit the job. Its value is a comma-delimited list of the desired name spaces.
    msub -l ... -W x="trigns=vc2,vc4"

    If the new job is applied to the example in step 2, the script's arguments include vc2.IPAddr and vc4.Addr and exclude vc1.IPAddr. The script runs as follows:

    > myTrig.py vc2.IPAddr=/tmp/dir1 vc4.IPAddr=/tmp/dir2