| eG Administration |
|---|
Generate - Test - Integration Console Once all the measurements of a test have been specified, the next step is to specify the implementation of the test. After all the measurements of the Script/Batch File test have been specified, the Generate tab will be enabled.
Note: While associating a test with multiple script / batch files, make sure that the “main” script that needs to be executed is specified last. Otherwise, no measures will be reported by the eG Enterprise system. Any script used for a script/batch File test should provide one or more lines of output. Entries in a line are separated by whitespaces (space or tab). The first entry of a line should be “NONE”, if the test is not descriptor-based. Alternatively, if a test is descriptor-based, it can have multiple lines of output, with the first entry of each line being the descriptor. Output of a script for a descriptor-based test DESC 1 Value 1 Value 2 . Value N DESC 2 Value 1 Value 2 . Value N . . DESC N Value 1 Value 2 . Value N
Output of a script for a non-descriptor-based test NONE Value 1 Value 2 . Value N
A script on linux would look like this : #!/bin/sh df -k | grep "/" | awk ‘{print $6 " " $5 -1}’
The above example showed a test that did not take any arguments. To offer more flexibility in script execution, the Integration Console allows a user to specify multiple arguments for a script/batch file test. When the script/batch file is executed each time, the test’s arguments are passed to the script/batch file. Note that the arguments are typically passed to a script with a hyphen (i.e., ‘-’) preceding them. Each argument is expected to be followed by its value (e.g., −argument1 <argument1Val> −argument2 <argument2Val>). The script/batch file has to parse the arguments that are passed to it at the time of invocation and perform the appropriate functions. The following example provides an illustration of how a script can parse the arguments provided to it: #!/bin/sh # This script takes two arguments and outputs the values of the arguments. out1=“”; while [ $# -ge 1 ] do case $1 in -argument1) shift; out1=$1;; # if the current argument is argument1 -argument2) shift; out2=$1;; # if the current argument is argument2 esac shift; done echo “NONE $out1 $out2” |
|
The Back button enables the administrator to go back to the previous screen. |
|