Creating Custom Collectors For Unix Systems - IBM Prerequisite Scanner User Manual

Table of Contents

Advertisement

Creating custom collectors for UNIX systems

You can create custom connectors if the basic set collectors do not collect values for
the prerequisite properties required for the product to be installed. When you
create custom collectors, the file name must be the same as the prerequisite
property though without the subtype in its name. The collector is stored in
the/UNIX_Linux subdirectory. The collector can contain code to obtain actual values
for one or many prerequisite properties. It can also use the common functions to
obtain those values if required.
Before you begin
Ensure that you review the set of functions in the following appendixes before you
create the collectors. Determine whether you can use any of them to obtain the
actual values:
v Appendix I, "Common functions for UNIX systems," on page 135
v Appendix J, "Other functions for UNIX systems," on page 141
v Appendix K, "Logging utility functions for UNIX systems," on page 149
Determine whether the collector must check that the prerequisite property exists
and if it does, what other information must be gathered. Each check must return a
value, whether one exists. For example:
v Check whether a product is installed, for example, a package installed with
v Check what version of the product is installed.
v Check whether the available disk space for a mounted file system
If you want to use subtypes, suffix_identifier, and further categorize a prerequisite
property by application, utility, or service subtype, you can create a common
collector. 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
the differentiator_suffix_identifier differentiator.
Procedure
1. Create a shell script file. Save the file in the ips_root/Unix_Linux directory, with
2. Using an editor, open the file and include the path to the common_function.sh if
50
Prerequisite Scanner: User's Guide
RPM.
a variant of the following file naming convention but without a file extension:
[prefix_identifier.]property_name
where:
v prefix_identifier is an identifier for a predefined category of prerequisite
properties as outlined in Table 3 on page 4. This prefix identifier is required
by some of the predefined categories, for example, env.
v property_name is the name of the prerequisite property, for example, path.jre
you must use common functions, as follows:
. ../lib/common_function.sh

Advertisement

Table of Contents
loading

Table of Contents