Forum Stats

  • 3,757,668 Users
  • 2,251,254 Discussions
  • 7,869,883 Comments

Discussions

script to add web logic domain to oem group is failing

4202120
4202120 Member Posts: 1
edited Apr 29, 2020 10:23AM in Enterprise Manager

i have a script which adds a web logic domain to oem group, the connectivity is working between the admin server for weblogic and oem server, the sync is working and only this step is failing #add VM Host to OEM group .

the arguements passed to this script being

admin-server=bha-weblogic-domain-x2-node1.<domainname>.com

oem_server=em-app-server-private-dev-test.<domainname>.com

SLA=99

customer=gtc1

domain_name=bhaweblogicdomainx2

for this step i am getting the error as

Error: Invalid target in record: /gtc1_domain_name=bhaweblogicdomainx2/domain_name=bhaweblogicdomainx2:weblogic_domain:Customer

version of emcli 13c EM CLI Version 13.2.0.0.0

this is the shell script which is used in my source machine which tried to add the wls domain to the target machine using ansible playbook and all the parameters have been checked for correction and the last 2 steps only are failing

admin_server="$1"

OEM_HOST="$2"

SLA="$3"

customer="$4"

domain_name="$5"

domain_id="/""$customer"_"$domain_name"/"$domain_name"

echo domain_id="$domain_id"

export JAVA_HOME=/opt/jdk1.7.0_80

export PATH=$JAVA_HOME/bin:$PATH

export EMCLI_STATE_DIR=/opt/tools/emcli

#Authenticate to OEM on each invokation in case that OEM was restarted and the credentials caching was reset

"$EMCLI_STATE_DIR"/emcli setup -url=https://"$OEM_HOST":7803/em -username=sysman -password=**********  -trustall -autologin -dir=/opt/tools/emcli

"$EMCLI_STATE_DIR"/emcli sync

if [ -n "$SLA" ]; then

   if [ "$SLA" = "99.5" ]; then

      ls_status="P"

      echo ls_status: "$ls_status"

   else

   if [ "$SLA" = "99" ]; then

      ls_status="D"

      echo ls_status: "$ls_status"

   else

   if [ "$SLA" = "99.9" ]; then

      ls_status="MC"

      echo ls_status: "$ls_status"

   else

      echo "unknown SLA"

      exit 1

  fi

  fi

fi

#add VM Host to OEM group

"$EMCLI_STATE_DIR"/emcli set_target_property_value -property_records=""$domain_id":weblogic_domain:Customer:"$customer"" >>/tmp/set_wls_cust_target_result_group.txt 2>&1

"$EMCLI_STATE_DIR"/emcli set_target_property_value -property_records=""$domain_id":weblogic_domain:LifeCycle Status:"$ls_status"" >>/tmp/set_wls_target_target_result_group.txt 2>&1

I am new to this web logic domain . Your help is highly appreciated. Thanks