Performing Functions by Using a Command Line

Overview

You can issue commands to call SAS Environment Manager script files, which enable you to perform actions such as running the ETLs, installing kits, or enabling new HTTP checks. The files (.sh files for UNIX and .bat files for Windows) are provided in the directory [levelroot]/Web/SASEnvironmentManager/emi-framework/bin (UNIX) or [Levelroot]\Web\SASEnvironmentManager\emi-framework\bin (Windows). Some commands are for commonly used functions, and others are for utilities or functions that are used infrequently. The following commands are provided:
  • commonly used commands
    • apm_init
    • emi_init
    • master_acm_etl
    • master_apm_etl
    • master_kits_etl
    • validate
  • utility commands
    • agentClone
    • create_event
    • create_http_checks
    • ev_kit_installer
    • runSASJob
Specify the -h option on any command to display the Help.

Working with Commonly Used Commands

Initializing the APM Processes by Using apm_init

Use the apm_init command to initialize the APM ETL processes. Manual steps are also required after you run this command. See Enabling and Initializing the APM ETL for complete information about the initialization process.
The syntax of the command is: apm_init(.sh|.bat) [-fvdh -–hostAlias]
Options are:
-d (--debug)
enables debug output
-f (--force)
forces configuration to occur, even if a previous version of APM is found or if APM has already been initialized
-h (--help)
displays help for the command
--hostAlias
specifies the host alias for the machine
-v (--verbose)
enables verbose output

Initializing the EMI Framework Using emi_init

Use the emi_init command to initialize the EMI framework (provided as part of SAS Environment Manager Extended Monitoring), or to enable the ACM ETL, APM ETL, or solution kits ETL. Issue this command as part of the process of initializing and enabling the components of SAS Environment Manager Service Management Architecture. See Initializing and Enabling the Service Management Architecture for more information about using this command.
The syntax of the command is: emi_init(.sh|.bat) [-dfhiksv] [(—–enable|—–disable) <ACM,APM,KITS,ALL)] [—–vafeed <ON|OFF>] [—–resetDB —–resetFlags]
Options are:
-d (--debug)
enables debug output
-f (--force)
re-initializes the framework and overwrites settings
-h (--help)
displays help for the command
-i (--initialize)
initializes the framework
-k (--loadKits)
loads solution kits by issuing the command evKitInstaller -k ALL
-s (--status)
reports the operational status of the EMI framework
-v (--verbose)
enables verbose output
- -enable <[APM,ACM,KITS,ALL]>
specifies the components to enable
- -disable <[APM,ACM,KITS,ALL]>
specifies the components to disable
--vafeed <ON|OFF>
enables or disables the nightly feed of SAS Environment Manager Data Mart tables to a drop zone directory, where they are autoloaded into SAS Visual Analytics
-- resetDB
resets the SAS Environment Manager Data Mart and purges all data; you cannot recover the data after issuing this command
--resetFlags
resets the flags that identify the components that have been initialized and enabled

Running the APM ETL Processes by Using master_apm_etl

The APM ETL processes are specified to run at 1 AM. Use the master_apm_etl command if you want to run the processes manually or at another time. The command runs the processes to extract the information from the SAS logs and load it into the SAS Environment Manager Data Mart. You can use a scheduler to issue the command at a specified time to run the ETL processes at a time other than the default. You can also issue the command yourself to run the processes immediately. However, because the SAS logs roll over at midnight, whenever the ETL processes run after midnight, they always use the same data that was collected during the previous 24 hours.
Although you can run the ETL process at any time, the stored process reports expire at midnight. When you display a report, it uses data from the SAS Environment Manager Data Mart, and then the report is cached. When you display the report again, the cached report is displayed. After midnight, the cached report expires and the report is generated again when you select it. Suppose you display a report that uses data from the APM ETL, and then run the master_apm_etl command. If you then display the report again, the report will still use the cached data, rather than the data that the ETL process just loaded.
The syntax of the command is: master_apm_init(.sh|.bat) [-dhv -–evdebug <0–3>]
Options are:
-d (--debug)
enables debug output
-h (--help)
displays help for the command
-v (--verbose)
enables verbose output
--evdebug <0–3>
specifies the debug level for SAS sessions

Running the ACM ETL Processes Using master_acm_etl

The ACM ETL processes are specified to run at 12 midnight. Use the master_acm_etl command if you want to run the processes manually or at another time. The command runs the processes to extract the ACM data and load it into the SAS Environment Manager Data Mart. You can use a scheduler to issue the command at a specified time to run the ETL processes at a time other than the default. You can also issue the command yourself to run the processes immediately.
Although you can run the ETL process at any time, the stored process reports expire at midnight. When you display a report, it uses data from the SAS Environment Manager Data Mart, and then the report is cached. When you display the report again, the cached report is displayed. After midnight, the cached report expires and the report is generated again when you select it. Suppose you display a report that uses data from the ACM ETL, and then run the master_acm_etl command. If you then display the report again, the report will still use the cached data, rather than the data that the ETL process just loaded.
The syntax of the command is: master_acm_init(.sh|.bat) [-dhv -–evdebug <0–3>]
Options are:
-d (--debug)
enables debug output
-h (--help)
displays help for the command
-v (--verbose)
enables verbose output
--evdebug <0–3>
specifies the debug level for SAS sessions

Running the Solution Kit ETL Processes by Using master_kits_etl

The solution kit ETL processes that load data collected by the installed solution kits run at 2 AM. Use the master_kits_etl command if you want to run the processes manually or at another time. The command runs the processes to extract the solution kit data and load it into the SAS Environment Manager Data Mart. You can use a scheduler to issue the command at a specified time to run the ETL processes at a time other than the default. You can also issue the command yourself to run the processes immediately.
Although you can run the ETL process at any time, the stored process reports expire at midnight. When you display a report, it uses data from the SAS Environment Manager Data Mart, and then the report is cached. When you display the report again, the cached report is displayed. After midnight, the cached report expires and the report is generated again when you select it. Suppose you display a report that uses data from a solution kit, and then run the master_kits_etl command. If you then display the report again, the report will still use the cached data, rather than the data that the ETL process just loaded.
The syntax of the command is: master_kits_init(.sh|.bat) [-dhvx -–evdebug <0–3>]
Options are:
-d (--debug)
enables debug output
-h (--help)
displays help for the command
-v (--verbose)
enables verbose output
-x (--noexit)
specifies that the Java virtual machine should not exit after the command is completed
--evdebug <0–3>
specifies the debug level for SAS sessions

Validating the SAS Environment Manager Framework by Using validate

Use the validate command to validate the structure of the SAS Environment Manager framework and to find any errors or changes. This command runs during the initialization process to verify that the framework is correct before anything new is added. The command has four levels:
1
verifies that the command-line interface is functioning properly
2
validates connections to the SAS execution environment and the SAS Environment Manager server
3
verifies that the framework is initialized and functioning properly and that all enabled ETL components are running successfully
4
checks all of the files associated with SAS Environment Manager that should not be changed and notes any changes to any of these files
The syntax of the command is: validate(.sh|.bat) [-qvdh] [–l <1|2|3|4>] [-p| -–userPolicy <IGNORE|WARN|ERROR>]
Options are:
-q (--quiet)
specifies that the command should run in quiet mode
-v (--verbose)
enables verbose output
-d (--debug)
enables debug output
-h (--help)
displays help for the command
-l --level <1|2|3|4>
specifies the level of validation to perform; default value is 1
-p --userPolicy <IGNORE|WARN|ERROR>
specifies the policy if the current user does not match the install user

Working with Utility Commands

Cloning an Agent by Using agentClone

Use the agentClone command to create a machine-neutral archive (.tar) file of the SAS Environment Manager agent. You can then copy the file to a server (such as a SAS grid server) that is not part of the standard SAS environment installed by the SAS Deployment Wizard. The agent provides monitoring support for servers in a SAS grid.
The syntax of the command is: agentClone(.sh|.bat) [-vdh] [-t <Minimal|Select>] [–w <workingDir>] [tarfile]
Options are:
-v (--verbose)
enables verbose output
-d (--debug)
enables debug output
-h (--help)
displays help for the command
-t (--type) <Minimal|Select>
specifies whether certain plug-ins are included (Select) or omitted (Minimal) to minimize the size of the clone file and the memory required
-w (--workdir) <workingDir>
specifies the directory to use when constructing the .tar file
tarfile
specifies the name of the .tar file that contains the clone of the SAS Environment Manager agent

Creating an Event by Using create_event

Use the create_event command to manually create a SAS Environment Manager event. After it is created, the event appears in the SAS Environment Manager Event Center.
The syntax of the command is: createEvent(.sh|.bat) [-vdh] [-f <file>] [–l <INFO|WARN|ERROR>] [–s <source>]
Options are:
-v (--verbose)
enables verbose output
-d (--debug)
enables debug output
-h (--help)
displays help for the command
-f (--file) <file>
specifies the event file
-l (--level) <INFO|WARN|ERROR>
specifies the level of the event to create (INFO is the default value)
-s (--source)source
specifies the source of the event

Creating an HTTP Check by Using create_http_checks

Use the create_http_checks command to create an HTTP check service based on the definitions in the file httpChecks.json. This file contains all of the predefined HTTP check definitions, but not all of these definitions are created by default. To create one of the definitions:
  1. After you have initialized the framework (part of SAS Environment Manager Extended Monitoring initialization), edit the file [levelroot]/Web/SASEnvironmentManager/emi-framework/Conf/httpChecks.json (UNIX) or [Levelroot]\Web\SASEnvironmentManager\emi-framework\Conf\httpCHecks.json (Windows).
  2. Locate the entry for the HTTP check that you want to create. This is an example entry:
    {
        "name": "HTTP Check for SASTheme_default",
        "desc": "[Auto-Generate] HTTP Monitoring URL: /SASTheme_default",
        "enable": "false",
        "method": "GET",
        "port": "7980",
        "sotimeout": "30",
        "platform": "ptnode19.ptest.sas.com",
        "path": "/SASTheme_default",
        "follow": "true",
        "pattern": "SASTheme_default"
      },
    
  3. Change the value of the enable parameter from false to true. "enable": "false",
  4. Save the httpChecks.json file.
  5. Run the create_http_checks command.
To verify that the service has been created, sign on to SAS Environment Manager and select Browsethen selectServices. The new HTTP check service is listed,
The syntax of the command is: create_http_checks(.sh|.bat) [-fxvdh] [-t <taskfile>]
Options are:
-t (--taskfile) <taskfile>
specifies that the HTTP checks should not be generated, but should be based on the specified JSON task file
-f (--force)
re-initializes the HTTP checks and overwrites settings
-x (--noexit)
specifies that the Java virtual machine should not exit after the command is completed
-v (--verbose)
enables verbose output
-d (--debug)
enables debug output
-h (--help)
displays help for the command

Installing a Solution Kit by Using ev_kit_installer

Solution kits provide customized metrics and reports to support specific SAS solutions and applications. Use the ev_kit_installer command to install new solution kits.
The syntax of the command is: ev_kit_installer(.sh|.bat) [-fvdh] [-k <kitname|ALL>]
Options are:
-f (--force)
replaces the existing kit configurations
-v (--verbose)
enables verbose output
-d (--debug)
enables debug output
-h (--help)
displays help for the command
-k (--kitName) <kitname|ALL>
specifies the name of the kit to install, or that all kits should be installed

Accessing SAS Environment Manager with a SAS Job by Using runSASJob

Use the runSASJob command to run a SAS program with the SAS autoexec and environment necessary for the program to access the SAS Environment Manager Data Mart and the EMI framework.
CAUTION:
Do not run this command unless directed to by SAS Technical Support. Running this command incorrectly could corrupt the SAS Environment Manager Data Mart and cause loss of data.
The syntax of the command is: runSASJob(.sh|.bat) [-bdhv] [––args <args>] [––autocall <autocall_dir>] [––autoexec <(BATCH|APM|KITS|STP) | <autoexec_file>] [––config <config_file>] [––evdebug <0–3>] [––log <log_results_file>] [––nodms] [––printfile <output_file>] [––work <saswork_dir>] [––workdir <working_dir>]
Options are:
-b (--batch)
specifies that the SAS program runs in batch mode (with the SAS options -batch -noterminal)
-d (--debug)
enables debug output
-h (--help)
displays help for the command
-v (--verbose)
enables verbose output
--args <args>
specifies any SAS command line arguments to be appended to the SAS invocation command
--autocall <autocall_dir>
specifies the autocall directory to use
--autoexec <(BATCH|APM|KITS|STP) | <autoexec_file>
specifies whether to use a defined autoexec file (such as BATCH or APM) or a specified autoexec file
--config <config_file>
specifies a custom configuration file to use
--evdebug <0–3>
specifies the debug level for the SAS session
--log <log_results_file>
specifies the file to contain the log results
--nodms
specifies that SAS should run in line mode with the framework enabled
--printfile <output_file>
specifies the output file for SAS procedures
--work <saswork_dir>
specifies the SAS Work directory
--workdir <working_dir>
specifies the relative working directory (or parent path) used when running a SAS program
Last updated: February 22, 2018