3.2 Creating a UAP that executes during collection
The external program processing for collection is the processing that is started before or after file collection. The external program processing for collection is divided into the external program processing before collection, which is executed before collection, and the external program processing after collection, which is executed after collection.
This subsection describes the procedure for using the external program processing for collection, notes on creating the external program processing for collection, and a creation example.
Procedure for using the external program processing for collection
To use the external program processing for collection:
-
Create the program of the external program processing for collection.
Create the external program processing for collection to return the following return codes after the processing.
Normal end: 0
Abnormal end: Other than 0
-
Set the external program processing for collection at the managing server.
When you create the file collection job at the managing server, set the external program processing for collection for the following items in the Specify external programs to start on destination agent.
Before collection: path-name-of-external-program-processing-before-collection
After collection: path-name-of-external-program-processing-after-collection
Use the absolute path name to specify the external program processing for collection.
Note on creating the external program processing for collection
-
You can create the external program processing for collection in any directory. The path name must be 63 characters or less when the absolute path name is used.
-
The data output by the external program processing for collection to the standard output or the standard error output is stored in the following location. To output this data to a console or other location, specify so in the external program processing for collection.
-
For systems other than HP-UX: /NETMRDS/rdsprm/CF.LOGF
-
For HP-UX: /var/opt/NETMDMW/rdsprm/CF.LOGF
-
-
Grant the execution permission for the external program processing for collection.
-
When the external program processing for collection is executed, the standard input is allocated to /dev/null. Therefore, do not include the processing for data entry from the standard input in the external program processing for collection.
-
No operand is specified when the external program processing for collection is started.
Example of creating the external program processing for collection
The following shows an example for creating an external program processing for collection.
-
External program processing before collection (/local/usr/etc/cat_files)
This processing combines multiple files and creates a single collected resource file (/tmp/DataFile).
-
External program processing after collection (/local/usr/etc/logprint)
This processing deletes the collected resource file (/tmp/DataFile) created by the external program processing before collection and acquires the history of completed file collection in the log file.
- Contents of the external program processing before collection
DATADIR=/local/usr/data /bin/cat $DATADIR/DataFile_1 \ $DATADIR/DataFile_2 \ $DATADIR/DataFile_3 > /tmp/DataFile exit $?
- Contents of the external program processing after collection
/bin/rm /tmp/DataFile DATE= '/bin/date' /bin/echo "Collection completed ($DATE)" >> /local/usr/data/CF_LOG exit 0