
3.
Add the code to obtain the value for the prerequisite property by using
commands and options specific to that platform to access elements of the host
environment. For example, the custom
env.path.jar
prerequisite property
needs to check whether the JRE is set in the
PATH
variable. The following code
runs the
env
command, searches the output for
PATH
variable, and then searches
its value for the JRE path.
envJRE=`env | grep "PATH" | grep -w "/opt/IBM/Java60/jre/bin"`
4.
Ensure the check returns standard output:
echo "True"|"False" ’If the scan checks for the existence of the prerequisite
property
echo $res ’If the scan checks returns the value, for example, product version,
’of the prerequisite property
echo "Unavailable" ’If the scan returns no value for the prerequisite property
echo "Available" ’If the scan returns a valid check for the prerequisite property
In the example, based on the value of the
$envJRE
variable, the check either
returns
True
or
False
:
if [ $envJRE ]; then
echo "True"
else
echo "False"
fi
5.
Run the custom collector to ensure that there are no runtime errors and debug
as necessary.
6.
Edit the
ips_root
/UNIX_Linux/packageTest.sh
script to call and run the custom
collector.
7.
Create a custom evaluator only if the custom collector returns values other than
boolean values.
Editing the package test script for UNIX systems
You can update the
packageTest.sh
script file to call custom collectors on UNIX
systems.
Before you begin
Ensure that you know the names of the collectors associated with predefined
prerequisite properties, as outlined in Appendix D, “Predefined collectors for UNIX
systems,” on page 107. If the prerequisite property is further categorized by
application, utility, or service subtype, pass the differentiator for the
suffix_identifier
subtype, that is,
differentiator_suffix_identifier
to its collector.
For example,
os.package
is the common collector to check for the existence of
packages. To check for the existence of
openssh
, pass the name of the package
when invoking the
os.package
collector in the
packageTest.sh
script file, as
follows:
./os.package openssh
Where
openssh
is the name of the package, that is, the
suffix_identifier
subtype and
differentiator_suffix_identifier
differentiator.
Procedure
1.
Using an editor, open the
ips_root
/UNIX_Linux/packageTest.sh
script.
2.
Add the code to read the custom prerequisite property from the configuration
file and parse its value.
Chapter 3. Extending Prerequisite Scanner
51
Summary of Contents for Prerequisite Scanner
Page 1: ...Prerequisite Scanner Version 1 1 1 10 User s Guide ...
Page 2: ......
Page 3: ...Prerequisite Scanner Version 1 1 1 10 User s Guide ...
Page 8: ...vi Prerequisite Scanner User s Guide ...
Page 10: ...viii Prerequisite Scanner User s Guide ...
Page 40: ...Figure 6 result txt file on Windows systems 30 Prerequisite Scanner User s Guide ...
Page 46: ...36 Prerequisite Scanner User s Guide ...
Page 68: ...58 Prerequisite Scanner User s Guide ...
Page 78: ...Figure 11 precheck log file with the debug data 68 Prerequisite Scanner User s Guide ...
Page 84: ...74 Prerequisite Scanner User s Guide ...
Page 88: ...78 Prerequisite Scanner User s Guide ...
Page 92: ...82 Prerequisite Scanner User s Guide ...
Page 116: ...106 Prerequisite Scanner User s Guide ...
Page 122: ...112 Prerequisite Scanner User s Guide ...
Page 136: ...126 Prerequisite Scanner User s Guide ...
Page 138: ...128 Prerequisite Scanner User s Guide ...
Page 140: ...130 Prerequisite Scanner User s Guide ...
Page 158: ...148 Prerequisite Scanner User s Guide ...
Page 164: ...154 Prerequisite Scanner User s Guide ...
Page 166: ...156 Prerequisite Scanner User s Guide ...
Page 170: ...160 Prerequisite Scanner User s Guide ...
Page 171: ......
Page 172: ... Printed in USA ...