Skip to content

Asynchronous Discovery (ASD)

Mat Davis edited this page Nov 6, 2019 · 1 revision

Generating ASD packages with proper permissions

When running TADDM on Linux or UNIX, the default umask can be set too restrictively. For example, if the default umask is set to 027, this means that created files are not world readable. If the script package generation scripts are run with this umask in place, the generated script packages also lack the world readable bit. This causes problems during execution, specifically during MQ discovery where the discovery must change to the mqm user to execute. In order to avoid this, you must change the umask (for example 022) before running the dist/bin/makeASDScriptPackage.sh. You can download and place this wrapper script under dist/custom/ that will change the umask, generate the Linux, SunOS, and AIX packages under dist/custom and then change the umask back to the default.

Request for enhancement has been opened to address this issue. Although the RFE states that the enhancement was delivered, it appears that the problem still exists in v7.3.0.6 (FP6), so please use the makeASDScriptPackageWrapper.sh file regardless.

There is another issue in 7.2.2.2 and lower where the copying and chmod of the files is not done correctly by the scriptsRunner.sh file during execution. The following script snippet corrects this problem for the AIX package. This issue is fixed in 7.3.

tar -xf taddmasd_AIX.tar
# change chmod command in scriptsRunner.sh
sed -i 's/chmod +x /chmod a+rx /g' taddmasd/scriptsRunner.sh
tar -uf taddmasd_AIX.tar taddmasd/scriptsRunner.sh

Custom servers do not work

As of TADDM 7.2.2 FP2, custom servers do not work with ASD. The CustomAppSensor will not launch during an ASD discovery so you will not be able to create custom app servers.

Request for enhancement has been opened to address this issue.

WebSphere server dependencies are not created

As of TADDM 7.2.2 FP2, when discovering distributed WebSphere the runtime process is not attached to the WebSphere server while discovering with ASD (asynchronous script-based discovery). See the wiki page on Dependencies for WebSphere servers when using ASD for more information and a work-around.

Request for enhancement has been opened to address this issue.

Script variable may get overloaded and cause 'no space' and/or 'broken pipe' error

There is a general purpose script called bin/scriptHelper.sh that gets added to all the ASD packages and is used to run the commands needed for each sensor. This script contains a runCmd function that evaluates the command output and adds the output to the output file in the proper format. But because of the way it is written, the command output is first captured in a script variable, and then it is written to the output file. In certain situations, for example some DB2 discoveries running on AIX, the size of the output can be too big to fit in the script variable and you will see the 'no space' and/or 'broken pipe' in the output and the ASD discovery will fail. IBM support is working (as of 9/29/2014) on changing the way that the DB2 script sensor works to avoid this error, but theoretically it is possible for it happen in some other scenario. This issue still exists in TADDM 7.3.0.0 GA.

There is a work-around for this issue that involves changing the scriptHelper.sh file. It is not recommended to change the base file located in the TADDM distribution, but rather to create the ASD packages first, then change the script only for the system(s) where you are seeing the issue. Below is the updated runCmd function that will avoid the error (the original lines are commented out with double #).

#
# Evaluate the output of command, adds output to output file in required format.
# First argument is a key_name, rest are treated as command to execute.
# e.g. runCmd version cat /etc/redhat-release
#
runCmd() {
        echo TADDM_DATA_NAME >> "${MAIN}"
        echo $1 >> "${MAIN}"
        echo TADDM_DATA_TYPE >> "${MAIN}"
        echo COMMAND >> "${MAIN}"
        shift
        CMD=$*
        echo TADDM_DATA_COMMAND >> "${MAIN}"
        echo ${CMD} >> "${MAIN}"
        echo TADDM_DATA_VALUE >> "${MAIN}"

        ##VALUE=`eval ${CMD} 2>"${ERROR}"`
        ##echo "${VALUE}" >> "${MAIN}"
        eval ${CMD} >> "${MAIN}" 2>"${ERROR}"
        EC=$?
        # if no output is produced by command add blank line
        if [ "`tail -c 1 ${MAIN}`" != "" ] || [ "`tail -1 ${MAIN}`" == "TADDM_DATA_VALUE" ];
        then
                echo >> ${MAIN}
        fi
        
        echo TADDM_DATA_EXITCODE >> "${MAIN}"
        echo ${EC} >> "${MAIN}"
        echo TADDM_DATA_ERROR >> "${MAIN}"
        echo "`cat "${ERROR}"`" >> "${MAIN}"
        echo TADDM_DATA_END >> "${MAIN}"
}

As previously stated, it is not recommended to apply this script change widely, but you may deem it necessary to apply this script change for DB2 discovery on AIX. In this case, copy bin/scriptHelper.sh to bin/scriptHelperDb2.sh and make the changes there. Then you can use the following script commands after generating the AIX tar package to make the change.

tar -xf taddmasd_AIX.tar
# apply scriptHelpher.sh workaround for DB2 on AIX
if [ -d taddmasd/com.ibm.cdb.discover.sensor.app.db.db2.db2_7.5.0 ]; then
    cp $COLLATION_HOME/bin/scriptHelperDb2.sh taddmasd/com.ibm.cdb.discover.sensor.app.db.db2.db2_7.5.0/scriptHelper.sh
    tar -uf taddmasd_AIX.tar taddmasd/com.ibm.cdb.discover.sensor.app.db.db2.db2_7.5.0/scriptHelper.sh
elif [ -d taddmasd/com.ibm.cdb.discover.sensor.app.db.db2.db2_7.6.0 ]; then
    cp $COLLATION_HOME/bin/scriptHelperDb2.sh taddmasd/com.ibm.cdb.discover.sensor.app.db.db2.db2_7.6.0/scriptHelper.sh
    tar -uf taddmasd_AIX.tar taddmasd/com.ibm.cdb.discover.sensor.app.db.db2.db2_7.6.0/scriptHelper.sh
else
    echo "DB2 sensor has been upgraded from 7.6.0, not applying DB2 sensor workaround for 'broken pipe'/'no space'"
fi
rm -fr taddmasd

TADDM 7.3 ASD Ping Sensor does not detect Windows ASD ZIP packages

A feature released in TADDM 7.3 is the ASD discovery for Windows targets. That discovery generates a ZIP file as output. However, when properly staged under var/asdd, the ASD Ping Sensor does not detect that file like it does the other .tar files. As of February 2015, an APAR (IV68901) has been opened for this issue and it should be resolved in 7.3.0.1 (FP1).

No way to ignore unmatched processes

The TADDM 7.3 user's guide documents how to ignore unmatched processes. For v7.3.0.0 there is no way to stop ASD discovery from creating these unmatched processes, which results in unknown servers being created. There is also a technote that documents a property that can be used to suppress creation of runtime processes, but this also does not work for ASD discovery on v7.3.0.0.

Clone this wiki locally