> #### Using environment variables

> Environment variables define the context in which a job or job action runs. Fathom sets up an environment variable context to associate jobs with resources and alerts and provides a set of predefined environment variables that are common to all jobs you can run.

> There are additional, specific environment variables that will vary from one job to another, depending on the job to be executed. For example, jobs run in response to an alert have an alert context. Jobs for which associated database resources have been defined have a resource context. Fathom provides a unique context definition for a job run against the FathomTrendDatabase.

> Table 8–1 identifies environment variables that are common to all jobs.

> Table 8–1: Environment variables common to all jobs
> Environment variable | Description
> --- | ---
> FM_HTTPPORT | Fathom's Web server port.
> ADMSRVRPORT | The AdminServer's listening port.
> JOBNAME | The name of the job as defined in Fathom.
> FATHOMINSTALLDIR | Fathom's installation directory as defined in `fathom.init.params`.
> FM_CONTAINERNAME | The resources's container name and the resource name (for example, Dev01.sports2004).
> FATHOMCONFIGDIF | Fathom's directory for configuration data as defined in `fathom.init.params`.
> FATHOMLOGSDIR | Fathom's log directory as defined in `fathom.init.params`.
> FATHOMWORKDIR | Fathom's work directory as defined in `fathom.init.params`.
> FATHOMREPORTDIR | Fathom's directory for report data as defined in `fathom.init.params`.
> PROGRESSINSTALLDIR | Directory of Progress' version that Fathom is associated with as defined in `fathom.init.params`.
> PERL5BIN | Perl v5 interpreter bin directory as defined in `fathom.init.params`.
> PERL5LIB | Perl v5 library directory as defined in `fathom.init.params`.

> Table 8–2 identifies environment variables for jobs associated with database resources. If a job is associated with more than one database, the value of each of the variables will be identified in a comma-separated list. For example, if there are three databases associated with a job, and the databases are named `db1`, `db2`, and `db3`, the database names will be defined as follows:

>     RESRC_DBNAME=db1, db2, db3

> Table 8–2: Environment variables for jobs with associated database resources
> Environment variable | Description
> --- | ---
> RESRC_NAME | The name of the associated resource. This will be a database name because only databases can be associated with a job.
> RESRC_DBNAME | The name of the database as defined in the Progress Explorer.
> RESRC_DBPATH | The full pathname of the database. For example, `/usr1/myapp/sports.db.`
> RESRC_DBCONFIG | The database configuration name as defined in the Progress Explorer.
> RESRC_DBDISPLAY | The database display name as defined in the Progress Explorer.
> RESRC_DBPORT | The TCP port number of the database broker.
> RESRC_DBHOST | The TCP host name of the database DataServer.
> RESRC_DBADMSRVRPORT | The AdminServer TCP port number on the database server host.

> Figure 8–3 shows the Job Action field that appears on the bottom of the Job page. Select this option to enable these environment variables to be available to the job's alert context.

> Figure 8–3: Using a job as an action

> Table 8–3 identifies the environment variables that can also be run in response to an alert. These environment variables are available when you identify a job as a job action.

> Table 8–3: Alert environment variables for job actions
> Environment variable | Description
> --- | ---
> ALERT_ID | The ID of the generated alert.
> ALERT_NAME | The name of the alert (for example, "FathomTrendingUnavailable, NetworkResourceFailure").
> ALERT_SEVERITY | The alert severity: Severe, Error, Warning, or Informational.
> ALERT_MESSAGE | A text description of the alert.
> ALERT_COUNT | The number of times the alert has been thrown.
> ALERT_RESOURCE | The name of the resource that threw the alert.
> ALERT_DBNAME | If the resource was a database, this variable will be set to the full name of the database.
> ALERT_DBPATH | If the offending resource was a database, this variable will be set to the full name of the database.
> ALERT_DBCONFIG | If the offending resource was a database, this variable will be set to the database configuration as defined in the Progress Explorer.
> ALERT_DBDISPLAY | If the offending resource was a database, this variable will be set to the database display name as defined in the Progress Explorer.
> ALERT_DBPORT | If the offending resource was a database, this variable will be set to the database TCP port number.
> ALERT_DBHOST | If the offending resource was a database, this variable will be set to the database TCP host name.
> ALERT_DBADMSRVRPORT | If the offending resource was a database, this variable will be set to the AdminServer TCP port number on the database server host.

> Table 8–4 describes the environment variables that you can identify for jobs with database resource associations.

> Table 8–4: Environment variables for jobs associated with the FathomTrendDatabase
> Variable | Description
> --- | ---
> FM_DBNAME | The full name of the database. In this situation, it is FathomTrendDatabase.
> FM_DBPATH | The absolute pathname of the FathomTrendDatabase.
> FM_DBCONFIG | This variable will be set to the FathomTrendDatabase configuration as it is defined in the Progress Explorer.
> FM_DBDISPLAY | This variable will be set to the FathomTrendDatabase display name as it is defined in the Progress Explorer.
> FM_DBPORT | This variable will be set to the FathomTrendDatabase TCP port number.

Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095