Enabling Auto-Correction for Test(s)
Corrective scripts help automate recovery actions when problems occur while executing tests in the target environment. By enabling auto-correction capability for a test, eG Enterprise enables eG agents to initiate corrective actions automatically to resolve the problem in the environment based on the recovery solution defined in the corrective script file. Once a corrective script for a test or a measure is built, you need to make sure that the option to enable / disable the auto-correction capability for the test in question, is made available. In other words, you need to ensure that the test configuration page consists of the CORRECT parameter, which when turned on, displays the alarmtype, userparams, and correctivescript parameters.
To enable the auto-correction for one or more tests other than the tests for which auto-correction is enabled by default, you can use the corrective scripts page. This page appears when you select the Corrective Scripts option from the Agents menu in the Admin interface (see Figure 1).
Figure 1 : Selecting Corrective Scripts Option
Clicking the Corrective Scripts option will open the corrective scripts page as shown in Figure 2.
Figure 2 : The CORRECTIVE SCRIPTS Page
By default, Figure 2 displays all available tests for which the corrective scripts can be enabled within the target environment. This includes tests associated with all managed components in the target environment. However, if you wish to view the list of tests mapped to a specific component type, select the desired component type from the Component Type list. By default, the All option is chosen from this list, displaying tests across all component types. A
icon against each test indicates that the auto-correction has been enabled. A
icon appears against each test implying that the test is has not been enabled with auto-correction capability. A
icon against each test indicates that the corrective script has not been uploaded. While the
icon indicates that the corrective script file has been uploaded.
To enable the auto-correction for a specific test, click the
icon appears against each test, this will invoke a prompt as shown in .
Figure 3 : ENABLE CORRECTIVE SCRIPT prompt
Click Yes in Figure 3 to enable the auto-correction for the selected test. If the test is associated with multiple components, auto-correction will be enabled for the selected test across all those components. If a test is mapped to only one component, the
icon will not be displayed for that test on the CORRECTIVE SCRIPTS page when All is selected from the Component type list. This is because enabling auto-correction from the CORRECTIVE SCRIPTS page applies the capability to all components associated with the selected test.
Figure 4 : The component specific tests in the CORRECTIVE SCRIPTS page
However, when you select a specific component from the Component type list, the auto-correction icon is displayed for all tests mapped to the selected component (see Figure 5), allowing you to configure auto-correction settings for those tests.
Figure 5 : The list of tests for chosen component type
To enable the auto-correction for more than one test mapped to a component type, click the Enable/Disable Corrective Scripts button in Figure 2. This will open the Enable/Disable Corrective Scripts page (see Figure 6).
Figure 6 : The ENABLE/DISABLE CORRECTIVE SCRIPTS Page
By default, no component type is selected from the Component type list. You may select a component type of interest from the list. Based on the selection, the page displays the associated tests such that the tests for which corrective scripts are enabled, by default, are shown in the Enabled Tests section. On the other hand, the remaining tests mapped to the selected component are displayed in the Available Tests section as shown in Figure 7.
Figure 7 : Selecting the tests associated with the chosen component type
To enable the corrective scripts for one or more tests, first select the test(s) from the Available Tests list. Then, click the < button in Figure 7. This will transfer the selection to the Enabled Tests list, as shown by Figure 8.
Figure 8 : Enabling the corrective scripts for the chosen tests
Finally, click the Update button in Figure 8 to save the changes. Likewise, to disable corrective scripts for one or more tests from the chosen component type, select the test(s) from the Enabled Tests list of Figure 8, click the > button, and then click Update. Once, you updated the changes, click the Back button to switch to the Corrective Scripts page (Figure 9).
Figure 9 : Viewing the tests for which Auto-correction capability is enabled
To view the tests for which auto-correction capability has been enabled, scroll down the page or use the Search box in Figure 9. You may also select a specific component from the Component Type list to filter and view the associated tests. Next, click the
icon to upload the corrective script file for the test. A new corrective script window will then appear as shown in Figure 10.
Figure 10 : The NEW CORRECTIVE SCRIPT window
To upload the script file, select a measure or all measures from the Choose corrective script for list box which lists the measures reported by the selected test. Next, select the operating system of the agent host from the Operating system list. By default, All is specified in the Component type field and the name of the selected test is displayed in Test name text box. Then, use the Browse button to select a script file for upload (see Figure 11). Note that, the script file extension should be supported by the operation system of the agent host.
Figure 11 : Uploading a script file
After specifying the required details and selecting the script file, click the Upload button in Figure 11 to upload the selected script file. Upon successful upload of the script file, the Corrective Scripts prompt displays a success message, and you are redirected to the Corrective Scripts page, where you can view the details as shown in Figure 12.
Figure 12 : Corrective script enabled test details
Once auto-correction is enabled for a test, a Correct flag is added to the test configuration and is set to No by default. To activate the auto-correction capability, set the Correct flag to Yes. When the Yes option is selected, three additional parameters namely, ALARMTYPE, USERPARAMS, and CORRECTIVESCRIPT are displayed in the test configuration page (see Figure 13), allowing you to configure the auto-correction settings for the test.
Figure 13 : The test configuration of auto-correction enabled test
-
alarmtype parameter indicates when the auto-corrective script should execute. You can set the corrective script to execute when a specific type of alarm is generated, by selecting an option from the ALARMTYPE list box.
-
The user-defined parameters that are to be passed to the corrective script are specified in the USERPARAMS text box.
-
By default, the value None is displayed in the CORRECTIVESCRIPT text box, indicating that the script (if any) configured through the Corrective Scripts page will be used for auto-correction. On the other hand, if no script has been configured through the Corrective Scripts page and auto-correction has been enabled for the test, you can upload a script directly using the Upload Corrective Script icon provided next to this parameter (see Figure 13).
After configuring all the required parameters, click Update button to save the changes. If you want to apply the same auto-correction settings to other components of the selected component type, click Apply to other components button before updating the test configuration. This ensures that the configuration is applied to all applicable components of that type.
By default, No is displayed in the Applied to Component? column, indicating that either the test has not yet been configured for auto-correction or the configured settings have not been applied to other components of the selected component type.
To enable auto-correction for a measure reported by a test, select the specific measure from the Choose corrective script for list in Figure 10, specify the Operating system, and upload the corresponding script file (see Figure 14).
Figure 14 : Enabling auto-correction for a measure
Upon successful upload of the script file, you are redirected to the Corrective Scripts page, where you can view the details as shown in Figure 15.
Figure 15 : Auto-correction enabled measure details
By default, auto-correction is enabled for certain tests. For example, the Processes test is configured with auto-correction capability for the Number of processes measure across all supported operating systems. The details of this default configuration are displayed in Figure 16.
Figure 16 : The details of the Processes test
Even if auto-correction is enabled by default for a specific measure, you can also enable this capability for other measures reported by the test by following the steps described above.