In this blog I’ll explain how you can achieve automation for uninstallation & installation of Diagnostic Agent.

Important Notes for Reference –

1858920 – Diagnostics Agent installation with SWPM

 

Diagnostic Agent wiki page

https://wiki.scn.sap.com/wiki/display/SMSETUP/Diagnostics+Agents

 

Official guide for Diagnostic Agent can be downloaded as follows –

https://support.sap.com/sltoolset à System Provisioning à Installation option

Guide for Diagnostics Agent (choose your OS/DB)

 

Products used

SWPM 1.0 SP17 patch 8

Kernel version 745

 

Prerequisite – You will need to successfully complete one Diagnostic Agent Installation manually using SWPM as you’ll need the following files from the install directory

Windows – C:Program Filessapinst_instdirGENERICSMDINST

Files required –

inifile.xml

keydb.dtd

keydb.xsl

 

1         Uninstallation

1.1        Preparation

1.1.1       Create a folder structure on the target host

SMDAgent_Install

SMDAgent_InstallInstall

SMDAgent_InstallUnInstall

 

1.1.2        Create an uninstallation properties file uninstall.properties with the following content – under SMDAgent_InstallUnInstall

NW_readProfileDir.profileDir=/usr/sap/DAA/SYS/profile

NW_System_Uninstall.completeSystem=true

NW_System_Uninstall.uninstallHostAgent=true

NW_System_Uninstall.removeUsers=true

NW_System_Uninstall.instance=97

 

Please note the following for the above contents –

  • path to profile works for both Windows & Unix
  • change the Agent instance number to reflect the actual
  • this procedure will remove all the Diagnostic & HostAgent files including the sapadm & daaadm users.

1.1.3        Create a Run file smdagent_uninstall.bat (or .sh for Unix) – under SMDAgent_InstallUnInstall

sapinst.exe SAPINST_INPUT_PARAMETERS_URL=uninstall.properties SAPINST_EXECUTE_PRODUCT_ID=NW_Uninstall:GENERIC.IND.PD SAPINST_SKIP_DIALOGS=true -nogui -noguiserver

 

1.2        Execute the Uninstallation

Shutdown the Diagnostic Agent (you can script the shutdown using stopsap or SAPCONTROL)

execute SMDAgent_InstallUnInstallsmdagent_uninstall.bat

The uninstallation logs will be created in the folder SMDAgent_InstallUnInstall.

The uninstallation was successful if the file installationSuccesfullyFinished.dat has been generated.

 

2         Installation

2.1        Preparation

2.1.1        Create a Run file smdagent_install.bat (or .sh for Unix)                        – under SMDAgent_InstallInstall

sapinst.exe SAPINST_INPUT_PARAMETERS_URL=install.properties SAPINST_PARAMETER_CONTAINER_URL=inifile.xml SAPINST_EXECUTE_PRODUCT_ID=NW_DiagnosticsAgent:NW740.IND.PD SAPINST_SKIP_DIALOGS=true

 

2.1.2        Create an installation properties file install.properties with the following content – under SMDAgent_InstallInstall

DiagnosticsAgent.SID=DAA

DiagnosticsAgent.InstanceNumber=

DiagnosticsAgent.dasidAdmPassword=

DiagnosticsAgent.sapServiceDASIDPassword=

hostAgent.sapAdmPassword=

DiagnosticsAgent.SLD.Connection=sld

DiagnosticsAgent.SLD.HostName=

DiagnosticsAgent.SLD.PortNumber=

DiagnosticsAgent.SLD.UserName=slddsuser

DiagnosticsAgent.SLD.Password=

DiagnosticsAgent.SLD.UseHTTPS=false

DiagnosticsAgent.SolMan.Connection=solman

DiagnosticsAgent.SolMan.UseSSL=false

DiagnosticsAgent.SolMan.HostName=

DiagnosticsAgent.SolMan.PortNumber=

DiagnosticsAgent.SolMan.UserName=

DiagnosticsAgent.SolMan.Password=

 

Please note the following for the above contents –

* End of each line should not have any spaces

* adapt the values based on your system environment

* the password need not be put into this file. this can be done in the next file inifile.xml

 

2.1.3        Adapt the inifile.xml

Copy the following files (extracted from an already installed system) to SMDAgent_InstallInstall

  • inifile.xml
  • keydb.dtd
  • keydb.xsl

The values (mainly passwords) need to be provided in the inifile.xml in clear text.

however, once the sapinst starts, the passwords in the inifile.xml are encrypted. the inifile.xml from a successfully completed install can then be used for subsequent installation.

The values in the inifile.xml that needs to be adapted are marked between $ (dollar).

e.g.,

when adapting the values ensure the above lines looks like this –

e.g.,

Once all the values have been adapted, open the inifile.xml in IE and check if it looks like this (with the actual values)

Note:

Before opening the inifile.xml in edit mode, open the file in IE and check if it looks like this –

Diagnostic Agent – Mass Deployment

if it doesn’t look like above – check if keydb.dtd & keydb.xsl files are in the same folder.

Once you have updated the inifile.xml, saved & closed; open the file in IE and check if the view is similar to the above picture. if not then re-check the changes you just made.

 

2.1.4        Download the 745 kernel for your OS/DB (or the latest 749)

Most of the time, the downloaded kernel DVD is often lower version than the check done by SWPM.

Therefore, the following patch work is required for a smooth silent installation.

Download the latest SAPEXE, SAPJVM & SAPHOSTAGENT files from the SAP Marketplace for the OS/DB of your system environment.

ensure the downloaded files are renamed as SAPEXE.SAR, SAPJVM6.SAR & SAPHOSTAGENT.SAR respectively.

overwrite the newly downloaded files to the kernel DVD folder – under the following path

— Kernel DVDDATA_UNITSK_745_U_WINDOWS_X86_64DBINDEP

 

2.1.5        Create a start_dir.cd file to specify the source files/DVD with the following content – under SMDAgent_InstallInstall

Z:SMDAgent_745Kernel_7.45DATA_UNITSK_745_U_WINDOWS_X86_64

Z:SMDAgent_745SWPM10_17

Please adapt the actual drive/location based on your system environment.

Note:

  • The location of the Kernel and SWPM cannot be a network path, they will need to be mapped to a local drive.

 

2.2        Execute the Installation

Execute SMDAgent_InstallInstallsmdagent_install.bat

The installation logs will be created in the folder SMDAgent_InstallInstall.

The Installation was successful if the file installationSuccesfullyFinished.dat has been generated.

Additionally check the following –

* Service SAPDAA_98 has been created and started

* SAP MMC contains the system DAA and has been started

 

3.    General Note

  1. One Central share with all the folder structures and files would ease subsequent deployments.
  2. The Installation & Uninstallation (script & parameter files) have to be on the Local Server/System. You cannot run it from the mapped share.
  3. Try the scripts for Uninstallations & Installations on Sandbox or Test systems before dev/QA/Prod systems.

 

New NetWeaver Information at SAP.com

Very Helpfull

User Rating: Be the first one !