How to manually remove the CA NSM System, Log and/or Performance Agents after a corrupt install or uninstall on UNIX or Linux

Document ID : KB000049725
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This document was designed to resolve issues such as reinstalling NSM System, Log, and Performance Agents after a failed or corrupted install or uninstall. The new install fails because the lsm installer is detecting that NSM components are already installed on the system.

Important! This procedure can only be used if only NSM System, Log and/or Performance Agents are installed on the system. The procedure specified in this document will remove files and directories that may be used by other CA Applications, such as ITCM Desktop and Service Management.

Solution:

NOTE: The steps in this procedure must be executed from the root user account.

Establish the current NSM environment:

If the /etc/profile.CA files currently exists on the system, source this to set the current NSM environment:

. /etc/profile.CA

Terminate any running NSM processes:

Check to see if there are any NSM processes running using unifstat if it is still installed, otherwise, use "ps -ef".

unifstat
ps -ef

Terminate any NSM processes that may still be running with the UNIX kill command.

kill -9 <pid>

Delete all installed NSM files and directories:

Delete the installed NSM files and directories pointed to by the $CAIGLBL0000, $CANSM, and $CASHCOMP environment variables if they are set. Remember to back up each of these directories before you execute the following UNIX commands:

[ -d "$AGENTWORKS_DIR" ] && rm -rf $AGENTWORKS_DIR
[ -d "$CAIGLBL0000" ] && rm -rf $CAIGLBL0000
[ -d "$CANSM" ] && rm -rf $CANSM
[ -d "$CASHCOMP" ] && rm -rf $CASHCOMP
rm -rf /opt/CA

The first 4 commands will test that the environment variable is set to an existing directory. If it is, the directory and all of it's contents will be removed.

On Linux only: in addition to deleting the installed NSM files and directories, you must also remove all NSM specific rpm packages from the Linux rpm database. To identify the NSM rpm packages in this database, execute the following command:

rpm -qa | grep "^ca-"

This command will give you a list of all rpm packages that start with "ca-".

Important: If you are not sure whether a specific rpm package is a CA NSM package or not, you should open a Support issue on CA Support Online (support.ca.com) before removing any of the rpm packages in the Linux rpm database.

For each NSM rpm package listed, you need to remove it from the rpm database using the following command:

rpm -e --noscripts --nodeps --notriggers <CA NSM rpm package name>

For example, if the ca-cs-utils-11.2.10057-0000 is returned in the "rpm -qa" command, you would delete this package as follows:

rpm -e --noscripts --nodeps --notriggers ca-cs-utils-11.2.10057-0000

Delete the installed NSM init bootstrap scripts:

Next, you need to delete all of the NSM init bootstrap scripts that are installed in the OS specific directory. Do not make copies of any of the NSM init bootstrap scripts in the directory where they are currently located. This may cause problems with the OS reboot processing as well as the NSM unisrvcntr utility. Make backup copies of these files in another directory somewhere else on the file system.

The OS specific commands to remove the installed NSM init bootstrap scripts are as follows:

For AIX:

cd /etc/rc.d
rm -f CA-*

For HP-UX:

cd /sbin/init.d
rm -f CA-*

For Linux or Solaris:

cd /etc/init.d
rm -f CA-*

Remove NSM from login environments:

Finally, you need to remove NSM from user login environments by renaming the CA NSM login scripts in the /etc/directory.

mv /etc/profile.CA /etc/profile.CA.old
mv /etc/csh_login.CA /etc/csh_login.CA.old

Check your system login scripts in the /etc directory (profile, csh.login, .login, etc.) and remove any lines that the NSM install may have added. The following are samples of changes NSM installs will make to the system login scripts which need to be removed:

If NSM 3.x or earlier was previously installed, look for and delete lines similar to the following:

# *---------------------------------------------- * 
# Modifications made by setupNSM for 
# Unicenter NSM Agent Technology 
# *---------------------------------------------- * 
if [ "$AGENTWORKS_DIR" = '' ] 
then 
AGENTWORKS_DIR=<defaultNSMhomedirectory> 
export AGENTWORKS_DIR 
fi 
if [ -f "$AGENTWORKS_DIR"/scripts/envset ] 
then 
. "$AGENTWORKS_DIR/scripts/envset" 
fi 
# *---------------------------------------------- * 
# End of Modifications made by setupNSM for 
# Unicenter NSM Agent Technology 
# *---------------------------------------------- *
test -r /etc/profile.CA && . /etc/profile.CA # Added by Computer Associates

If NSM r11 was the only version of NSM installed, look for and delete the line similar to the following:

test -r /etc/profile.CA && { CA_SECTION=ccs; export CA_SECTION;
. /etc/profile.CA; unset CA_SECTION; } # Added by Computer Associates

Remove NSM environment before reinstalling:

Log out and then log back into the system using root user account to remove the old NSM environment settings.

At this point you are ready to perform a new install of the System, Log, and/or Performance agents.