HOSTAGENT Concepts and Installation in SAP
What is SAP Hostagent?
The SAP Host Agent is a tool that can be used for monitoring and control of SAP instances and non-SAP instances, operating systems, and databases. The SAP Host Agent is automatically installed with every SAP instance based on SAP NetWeaver 7.0 Enhancement Package 2 and higher. As part of an SAP instance, the SAP Host Agent is automatically upgraded with the SAP kernel. However, it can also be installed and upgraded independently from an SAP instance. For a correct execution of the update procedure, make sure that you have installed at least the relevant minimum SAP Host Agent version on all application server instances. Hostagent is used by ACC (Adaptive Computing Controller) to manager the system. Hostagent is also used by SUM (Software Update Manager) to do the automatic updates.
Few of the commands generally used for host agent are listed below:
- How to check if you can access your Host Agent?
In Unix: The SAPHOSTAGENT is located at /usr/sap/exe
In Windows: The SAP Hostagent is usually installed at C:Program FilesSAPhostexe
- How to check SAP HOST CONTROL status?
- How to check SAP HOST CONTROL version?
- How to start SAP HOST CONTROL?
- How to stop a running SAP HOST CONTROL?
- How to start or restart SAP HOST CONTROL?
- How to uninstall SAP HOST CONTROL?
Note for Windows
Use the additional parameter -verify to verify the content of the installation package against the SAP digital signature:
saphostexec.exe -install -verify
Information about different files of SAPHOSTAGENT:
With the help of host agent the SOLMAN/LVM/SAP MC … collects information of the system to monitor the system status and these are connected to host agent of a particular system using a web service Runtime.
The functionalities of host agent are performed by using the following executables.
- Sap Host Control
- Sap Host Exec
Functionalities of Different Executables:
It runs under privileged user account such as root in UNIX.
It is used for host agent installation and upgrade purposes.
It runs under the sidadm user.
It is the agent that monitors hosts.
It runs independent of instances and we have exactly one agent for each host.
The data collected by Saposcol is placed in a shared memory which makes the information available to all instances in a host and to various applications.
It collects the information of following OS resources such as
Physical and virtual memory usage
Utilization of physical disks and file systems.
Resources usage of running processes.
It contains all the parameters required to proper functioning of host agent and it is identified as host_profile file.
It is available under executable directory.
The following files available under work directory.
Sapstartsrv_ccms.log – log file for central monitoring and it is stored under sapccmsr directory.
Sapstartsrv.log – developer trace of sapstratsrv.
Dev_saphostexec – developer trace of hostexec.
Dev_sapdbctrl – developer trace of sapdbctrl.
Logfiles of the SAP Hostagent
- You can change the loglevels on the hostagent and saphostcontrol processes by sending the SIGUSR2 (increase loglevel) or SIGUSR1(decrease loglevel) Signals to the saphostexec and sapstartsrv processes without restarting the hostagent.
- Add the profile-parameters hostexec/trace = 3 and service/trace = 3 in the profile of the SAP Hostagent default <Instdir-SAP Hostagent>/exe/host_profile) or send the SIGUSR2 (increase loglevel) or SIGUSR1(decrease loglevel) signals to the saphostexec and sapstartsrv processes without restarting the hostagent.
- Stop the SAP Host agent
- move only the requested log file(s) in the <Instdir-SAP Hostagent>/work folder to a backup location to create a clean logfile on startup.
- Start the SAP Host agent with the modified profile
- Reproduce the issue, e.g. through the SAP LVM
- Upload all files within the <Instdir-SAP Hostagent>/work folder to the message
- reset the profile-parameters hostexec/trace and service/trace to its previous value or to 0 or send SIGUSR1 signals to the processes. (level 3 can produce very large log files)
- Restart the SAP Host agent with the reverted profile if you changed the host_profile file.
Installation of SAP host agent in Windows and Unix
Login to Windows System
C drive – Program files – SAP – hostctrl.exe
Right click on Exe -cmd prompt
Then Execute the command
>saphost exec –stop
Now create the folder host agent under D-USR-SAP i.e.
D-USR-SAP -Host agent
Now download hostagent from SMP
Software Downloads – Browse our download catalog-SAP Technology components-SAP hostagent-Select SAP version (go to cmd prompt and execute >saphostexec –version)-Select system bit number. Then download highest patch host agent (click on patch for sorting) at local folder.
Now copy this .SAR file under D-USR -SAP-Host agent
Now uncar .SAR file as
Right click on Hostagent folder-cmd prompt
Execute >SAPCAR –xvf filename
Upgrade the patch
Execute >saphostexe –upgrade
Note: Absence of SAP folder under C-Program files implies Hostagent is not present and we are installing it for the first time. For this download hostagent from SMP and execute as >saphostexe –install
For Unix/Linux systems:
Execute >saphostexec –stop
Download host agent from SMP
Create a directory Hostagent under /usr/sap, then copy and uncar .sar file
>cp –Rpf sourcepath targetpath
>sapcar –xvf filename
If you face Permission denied error while extracting
Go to root level
Give chmod 777 <filename>
chown <sidadm>: sapsys <filename>
From root level goto the path where you have extracted the file i.e. /usr/sap/Hostagent
Execute >./saphostexec upgrade
Why to upgrade SAP Host agent?
There could be multiple reasons to upgrade SAP Host agent like to have latest functionalities, to remove existing bugs, to improve performance.
But for us, one of the reasons for upgrading SAP Host Agent was mismatch between managed system and solution manager.
We got an error as shown below when we configured managed system in Solution Manager
Our managed system Host agent version was 720.44 whereas Solution Manager System Host Agent Version was 720.116
After upgrading SAP Host Agent our version became 720.116
Hence now, both managed system and solution manager are on same host agent version.