In this blog I’ll explain how you can achieve automation for uninstallation & installation of Diagnostic Agent.
Important Notes for Reference –
Diagnostic Agent wiki page
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 Files\sapinst_instdir\GENERIC\SMD\INST
Files required –
1.1.1 Create a folder structure on the target host
1.1.2 Create an uninstallation properties file uninstall.properties with the following content – under \SMDAgent_Install\UnInstall
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_Install\UnInstall
<mapped drive and path for SWPM>\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)
The uninstallation logs will be created in the folder \SMDAgent_Install\UnInstall.
The uninstallation was successful if the file installationSuccesfullyFinished.dat has been generated.
2.1.1 Create a Run file smdagent_install.bat (or .sh for Unix) – under \SMDAgent_Install\Install
<mapped drive and path for SWPM>\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_Install\Install
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_Install\Install
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).
when adapting the values ensure the above lines looks like this –
Once all the values have been adapted, open the inifile.xml in IE and check if it looks like this (with the actual values)
Before opening the inifile.xml in edit mode, open the file in IE and check if it looks like this –
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 DVD\DATA_UNITS\K_745_U_WINDOWS_X86_64\DBINDEP
2.1.5 Create a start_dir.cd file to specify the source files/DVD with the following content – under \SMDAgent_Install\Install
Please adapt the actual drive/location based on your system environment.
- 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
The installation logs will be created in the folder \SMDAgent_Install\Install.
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
- One Central share with all the folder structures and files would ease subsequent deployments.
- The Installation & Uninstallation (script & parameter files) have to be on the Local Server/System. You cannot run it from the mapped share.
- Try the scripts for Uninstallations & Installations on Sandbox or Test systems before dev/QA/Prod systems.