Chapter 9. Customizing Your Environment

This chapter describes how you can use environment variables and default files to customize your NQE environment. The following topics are discussed:

Environment Variables Automatically Set

Your request begins execution with your login environment. A request is executed under your user name unless you specify another user name. (For information about using an alternative user name, see “Using Alternative User Names” in Chapter 5).

When a request begins execution, the following events occur:

  • NQS determines the shell to use. By default, NQS uses your default login shell. To specify a shell, modify your request file as described in “Specifying a Shell” in Chapter 5.

  • The shell invoked by NQS executes login files. These files are the .profile (sh or ksh shell) or .cshrc and .login (csh or tcsh shell) files of the request owner's user name.

  • NQS saves the HOME, LOGNAME, MAIL, PATH, SHELL, TZ, and USER environment variables and renames them with the QSUB_ prefix, as shown in Table 9-1.

  • NQS also sets the environment variables shown in Table 9-2.

  • If you send your request to the NQE database, the LWS sets the environment variables shown in Table 9-3.

Table 9-1. Environment Variables Set by NQS

Name

NQS name

Description

HOME

QSUB_HOME

Path name of the home directory for the user who submitted the request

LOGNAME

QSUB_LOGNAME

Login ID (user name) of the user who submitted the request

MAIL

QSUB_MAIL

Path name of the mail box for the user who submitted the request

PATH

QSUB_PATH

Search path for commands for the user who submitted the request

SHELL

QSUB_SHELL

 

TZ

QSUB_TZ

Time zone for the user who submitted the request

USER

QSUB_USER

User name of the user who submitted the request


Table 9-2. Additional Environment Variables Set by NQS

Name

Description

NQE_SHEPHERD_PID

Shepherd process ID (PID) of the job

QSUB_HOST

Host name of the NQS server

QSUB_REQID

Request identifier for the request

QSUB_REQNAME

Name of the request

QSUB_WORKDIR

Current directory when the request was submitted

QSUB_NQC

Host name of the NQE client

TMPDIR

Request's temporary directory, created by NQS, as described in “Using the Request /tmp Directory” in Chapter 4.

ENVIRONMENT

NQS sets the ENVIRONMENT environment variable to a value of BATCH. You can use this variable, for example, in .profile, .login, or .cshrc files to differentiate between interactive and batch sessions. This environment variable can be used to avoid performing terminal setup operations for a batch request. A benefit of NQS initiating the batch request as a login shell is that .profile, .login, or .cshrc scripts are run, and your environment is set up as expected.


Table 9-3. Environment Variables Set by the LWS

Name

Description

NQEDB_CLIENTHOST

Host from which the request was submitted

NQEDB_ID

Database name and the task ID (for example, nqedb.t123)

NQEDB_USER

NQE database user name that owns the task (usually $LOGNAME)


Customizing Your NQE Environment

In addition to setting the environment variables that you must set to use NQE (see “Setting Environment Variables” in Chapter 2), you can also set the environment variables described in this section.


Note: Setting any of the environment variables listed in Table 9-4 overrides your NQE system's default setting, which is the value in the NQE system configuration file.

If you use the NQE GUI, you can set the equivalent of the following environment variables by selecting specific menu options. You can use the Config display to set (configure) the interface to your individual preferences. You can then specify a profile for use with a specific request during the submit or job-launching process. You can also use the Config display to view how your variables are currently set.

You can specify that all environment variables that you have set whose names do not conflict with the automatically exported variables also be exported. If you use the NQE GUI, select Submit ->  Configure -> General Options -> Export ENV Variables. If you use the cqsub command or the qsub command, use the -x option.

Table 9-4. NQE Environment Variables You Can Set

Name

Description

QSUB_QUEUE

Names a specific queue to be used, as described in “Unsuccessful Submissions” in Chapter 4.

NQSATTR

Lists attributes associated with the request, as described in “Using Request Attributes” in Chapter 4.

NQSCHGINVOKE

Specifies that NQS invoke one shell instead of two shells, as described in “Specifying a Shell” in Chapter 5.

NQEINFOFILE

Specifies the path name of the NQE configuration file, which is the nqeinfo file. If this is set, the values for all environment variables that are set within the nqeinfo file will be used. If you use the command line interface, this environment variable is effective only when using the client commands (cevent, cload, cqdel, cqstatl, and cqsub). For more information on the nqeinfo variables, see the nqeinfo(5) man page.

NQE_GROUP

Specifies a name associated with one or more job dependency events, as described in “Using Job Dependency” in Chapter 8. If you do not set this variable, you must specify a group name on each cevent command line. NQS automatically exports the value of the environment variable if you have set it, so you do not have to export all environment variables each time you submit the request. For information about using job dependency, see Chapter 8, “Using Job Dependency”. If you use the command line interface, this environment variable is effective only when using the client commands (cevent, cload, cqdel, cqstatl, and cqsub).

NQE_DEST_TYPE

Designates the destination of your request (either nqs or nqedb), as described in “Directing Your Request to the NQE Database” in Chapter 4, and the cqsub(1) man page. If you use the command line interface, this environment variable is effective only when using the client commands (cevent, cload, cqdel, cqstatl, and cqsub ).

NQEDB_USER

Designates the NQE database user name for a request being submitted to the NQE database, as described in “Specifying a Database User Name for Your Request” in Chapter 4, and the cqsub(1) man page. If you use the command line interface, this environment variable is effective only when using the client commands (cevent, cload, cqdel, cqstatl, and cqsub).

NQS_PASSWORD_NEEDED

Prompts for a password when you submit requests, request status, delete requests, or send signals to requests from the client; for information about how to set this environment variable, see “Using Password Prompting” in Chapter 5. If you use the command line interface, this environment variable is effective only when using the client commands (cevent, cload, cqdel, cqstatl, and cqsub).

NQS_SERVER

Directs your request to run on a specified server or to communicate with the specified server. If you use the command line interface, this environment variable is effective only when using the client commands (cevent, cload, cqdel, cqstatl, and cqsub).

NLB_SERVER

Designates a specified host in your network on which the NLB software is located. This environment variable is used for system load displays. If you use the command line interface, this environment variable is effective only when using the client commands (cevent, cload, cqdel, cqstatl, and cqsub).

You can set the ilb environment variables, as described in Table 9-5; for information about executing a load-balanced interactive command, see the ilb(1) man page:

Table 9-5. ilb Environment Variables

Name

Description

ILB_USER

Defines the login name to use on the remote system. This variable also alters the value of $USER in the ilbrc files. The default value is whatever $LOGNAME is set to be in your environment.

ILB_PROMPT

A regular expression that identifies your prompt on a remote machine. The default value is "^.*\[%$#:\] $", which looks for any string ending with %, $, #, or :.



Note: The NLB_SERVER environment variable can also be used when using the ilb environment variables; NLB_SERVER defines the machine name and port number of the NLB server.


Configuring NQE Load Window Elements

You can configure elements in the NQE GUI Load window. To configure elements, edit the .Xdefaults files or use the nqe(1) command. For information about the nqe command options, see the nqe(1) man page.

Some of the items you can configure are as follows:

  • Creation, modification, configuration, and removal of charts

  • Colors used in the displays for such things as menu bars and for indicating different queues, requests, or old data

  • How often the data in the displays is updated

  • The interval during which data can remain in a display without being updated before it is marked as old

  • The chart formulae that are used in the Load displays

  • The number and names of the charts in the Load displays

  • Which mouse buttons cause which actions to occur

  • The height, width, and location of the initial displays

Alternatively, you can include your preferences in your $HOME/.Xdefaults file.

If you edit $HOME/.Xdefaults, the lines that customize your display are prefixed by the command name, as follows:

nqe*critcolor: red

This line makes red the default color to use when a bar is displayed with a value that is over the critical threshold.

If you create separate files, you can eliminate the name of the command.


Note: You can vary fonts in the displays, but only titles on the displays change. The fixed portions of the display will not change. For more information, see the nqe(1) man page.

The following is an example of an .Xdefaults file:

*server:                poplar
*ident:                 NLB
*age:                   90
*refresh:               3
*chartnames:            memdem syscpu idlecpu totio
*attributes:    {{NLB_HARDWARE ""} {NLB_OSNAME ""} {NLB_RELEASE ""}\
        {NLB_NCPUS ""} {NLB_PHYSMEM Kbytes} {NLB_FREEMEM Kbytes}\
        {NLB_SYSCPU %} {NLB_IDLECPU %} {NLB_NUMPROC ""}\
        {NLB_PSWCH /sec} {NLB_IOTOTAL Kbytes/sec}\
        {NLB_SWAPPING Kbytes/sec} {NLB_TMPNAME ""}\
        {NLB_FREETMP Mbytes} {NLB_SWAPSIZE Mbytes}\
        {NLB_SWAPFREE Mbytes}}
*regcolor:      green
*critcolor:     red
*memdem.title: Memory Usage
*memdem.expr:   100.0 * (NLB_PHYSMEM - NLB_FREEMEM + \
                        1024.0 * (NLB_SWAPSIZE - NLB_SWAPFREE)) / NLB_PHYSMEM
*memdem.min:    0
*memdem.max:    200
*memdem.log:    false
*memdem.abrv:   mem
*memdem.critical: 150
*memdem.suffix: %

*syscpu.min:    0
*syscpu.max:    50
*syscpu.log:    false
*syscpu.abrv:   sys
*syscpu.critical: 25
*syscpu.suffix: %

*idlecpu.min:   0
*idlecpu.max:   50
*idlecpu.log:   false
*idlecpu.abrv: idl
*idlecpu.critical: 25
*idlecpu.suffix:        %
*idlecpu.critcolor:     green
*idlecpu.regcolor:      red

*totio.min:     0
*totio.max:     50
*totio.log:     false
*totio.abrv:    i/o
*totio.critical: 25
*totio.suffix: %
*totio.critcolor:       violet

*command1: popup_hostinfo $thishost
*command2: exec xterm -title $thishost -n $thishost -e rsh $thishost &"
*command3: popup_minichart $thishost