Introduction
Why should I configure the hostagent, secure and with Outside Discovery enabled?
Because it is easy and It only takes a little to connect correctly the satellite systems to the LMDB with all data suppliers.
And least but not last: to get better Landscape Data in your LMDB to make better Upgrades! (see further Information, at the bottom)
What do I have to do?
On SAP Host Agent folder /usr/sap/hostctrl/exe/ (UNIX) or C:\Program Files\SAP\hostctrl\exe\ (Windows), create some shell scripts or textfiles and run this commands:
1. Make hostagent secure
As root:
export password=secure
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/sap/hostctrl/exe/
export SECUDIR=/usr/sap/hostctrl/exe/sec
if [ ! -d "$SECUDIR" ]; then
mkdir /usr/sap/hostctrl/exe/sec
cd /usr/sap/hostctrl/exe/sec
/usr/sap/hostctrl/exe/sapgenpse get_pse -p SAPSSLS.pse -noreq -x $password CN=`hostname`
/usr/sap/hostctrl/exe/sapgenpse seclogin -p SAPSSLS.pse -x $password -O sapadm
chmod 640 /usr/sap/hostctrl/exe/sec/SAPSSLS.pse
fi
This will enable Port 1129 for hostagent
2. Configure Outside Discovery for hostagent
As root:
export fqhn=`hostname -f`
export port=50000
export user=SL_user_DS
export password=secure
/usr/sap/hostctrl/exe/saphostctrl -function ConfigureOutsideDiscovery -enable -sldhost $fqhn -sldport $port -sldusername $user -sldpassword $password
3. Connect to the SLD (Create "slddest.cfg" and "slddest.cfg.key Files)
As root:
/usr/sap/hostctrl/exe/sldreg -configure /usr/sap/hostctrl/exe/slddest.cfg -usekeyfile
older existing files will be renamed as backup
4. Sent Data to SLD
as root:
export sidadm=sitadm
export SID=SIT
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/sap/hostctrl/exe/
# for the hostagent
/usr/sap/hostctrl/exe/saposcol -b | /usr/sap/hostctrl/exe/sldreg -connectfile /usr/sap/hostctrl/exe/slddest.cfg -stdin -ol dtransferdtd
# for the <SID> (ABAP)
DIR=/sapmnt/$SID/global
if [ -d "$DIR" ]; then
cp /usr/sap/hostctrl/exe/slddest.cfg $DIR
cp /usr/sap/hostctrl/exe/slddest.cfg.key $DIR
fi
su - $sidadm -c "setenv LD_LIBRARY_PATH /usr/sap/hostctrl/exe; /usr/sap/hostctrl/exe/saposcol -b | /usr/sap/hostctrl/exe/sldreg -connectfile /usr/sap/hostctrl/exe/slddest.cfg -stdin -ol dtransferdtd"
# for the <SID> (HANA)
DIR=/hana/shared/$SID/global
if [ -d "$DIR" ]; then
cp /usr/sap/hostctrl/exe/slddest.cfg $DIR
cp /usr/sap/hostctrl/exe/slddest.cfg.key $DIR
fi
su - $sidadm -c "setenv LD_LIBRARY_PATH /usr/sap/hostctrl/exe; /usr/sap/hostctrl/exe/saposcol -b | /usr/sap/hostctrl/exe/sldreg -connectfile /usr/sap/hostctrl/exe/slddest.cfg -stdin -ol dtransferdtd"
5. Register Hana DB into the SLD
Create config.txt File
[General]
# SLD Host Name
sld_hostname=<hostname.domain>
# SLD Port
sld_port=<Port-Nr.>
# Remote Execution ( Default: ssh; Valid values: ssh | saphostagent )
remote_execution=ssh
# SLD User Name
sld_username=<USER>
# SLD Password
sld_password=<Password>
# Use HTTPS
https=n
[Action]
action=configure_sld
now execute
As root:
export SID=SIT
/hana/shared/$SID/hdblcm/hdblcm --configfile=/tmp/hostagent/config.txt
Bonus
Register SystemDB to saphostctrl Agent
as root:
export passwort=secret
SYSTEMDB
/usr/sap/hostctrl/exe/saphostctrl -host name -user sidadm $passwort -dbname SYSTEMDB@SID -dbtype hdb -dbuser SYSTEM -dbpass $passwort -function SetDatabaseProperty DBCredentials=SET -dboption User=SAPDBCTRL -dboption Password=$passwort
TENANT
/usr/sap/hostctrl/exe/saphostctrl -host name -user sidadm $passwort -dbname TENANT@SID -dbtype hdb -dbuser SYSTEM -dbpass $passwort -function SetDatabaseProperty DBCredentials=SET -dboption User=SAPDBCTRL -dboption Password=$passwort
That's all, see the result:
Technical System Application Server ABAP
Technical System SAP Hana Database
Hosts
that's what I want !!!
Logfiles to check
under /usr/sap/hostctrl/work/
dev_saphostexec
outsidediscovery.log
dev_sapdbctrl
under /usr/sap/hostctrl/exe
sldreg.log
Conclusion
spend a little time at the beginning will save a lot of time at the end.
Further Information:
Motivation and Basis of my work is this article - not very fresh anymore but still up to date:
How to Get Reliable Landscape Data in SAP Support Portal
Thank you
wolf.hengevoss