Technical Articles
Connect Client systems to the “Solution Manager”: Easier, faster and better – Via Outside Discovery with saphostctrl
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
Hello Christoph,
thank you for the great overview.
Just one remark: I am not totally agree with the headline "connect satellite systems".
The outside discovery is just a part for hosts - technical systems (ABAP and Java) are synchronized with specific data suppliers: RZ70; NWA (>AS Java 7.02) or Visual Admin (</= AS Java 7.02) directly to a LMDB (since Solman 7.2 SPS 06; see Note 2836143) or via the synchronization from a SLD instance.
Your blog describes one necessary prerequisite (next to the SMD Agent rollout and assignment; setup EFWK; creation of scenarios...) for capabilities in the area of the Application Operations. If a customer is just looking for using ChaRM; ITSM; Process Management; Test Suite; Basis Operations like Maintenance Planner or SLM ... the outside discovery is not a functional requirement since we are using technical instances or iObjects in the iBase to manage satellite systems.
Kind regards Tim
Hi Tim,
Your right, so I changed to "Client" ! My Intension is to connect easy Systems direct to sld and have all nessesary Data supplier for Kernel, Host, Database in one go
my inspiration was also: https://launchpad.support.sap.com/#/notes/2556432
thank you for your feedback
kind regards
Christoph
Hello Christoph,
sorry - but I'm still struggeling with it:
Your blog describes how to connect hosts (instead of technical systems) via SAPOSCOL into the LMDB. In the second half you describe how to fully register a SAP HANA DB.
"Client system" is kind of confusing because "clients" (like 000; 066...) and "systems" (like technical systems) are already used differently in the SAP'S language.
BR, Tim
Good stuff. Will give it a try. Thanks for posting.