
368 Implementing a Tivoli Solution for Central Management of Large Distributed Environments
exit 5
fi
# Subscribe the endpoint to the appropriate profile manager
wsub -r @$profile_manager @Endpoint:$ep_label
if [ $? -eq 0 ]; then
echo “Endpoint $ep_label subscribed to Profile Manager $profile_manager
successfully.” >> $LOG_FILE
else
echo “Endpoint $ep_label failed to subscribe to Profile Manager
$profile_manager.” >> $LOG_FILE
echo “Either the profile manager or the endpoint is unreachable.” >>
$LOG_FILE
exit 6
fi
A.3.9 ep_login_notif.sh
This script in Example A-16 is used by the after_login policy to initiate an initial
inventory scan of new endpoints.
Example: A-16 ep_login_notif.sh
#!/bin/sh
set -x
ep_label=$1
INTERP=$2
POL_DIR=”/mnt/code/tivoli/scripts/policies”
JRE_DIR=”$POL_DIR/../../ITM/5.1.2/base/generic/Tools/JRE”
LOG_FILE=”$DBDIR/../policies/logs/wdistinv.log”
REGION=‘echo $ep_label | cut -d “_” -f2‘
STORE=‘echo $ep_label | cut -d “_” -f3 | cut -d “-” -f1‘
policy_region=$(wlookup -ar PolicyRegion|grep $REGION’_’EP|awk ‘{print $1}’)
TMR_NAME=$(idlattr -tgv ‘wlookup ServerManagedNode‘ label string |sed -e
“s/\”//g”)
# Check if the EP is running...
echo “Sleeping for 5 minutes waiting for the EP to complete the first normal
login, please wait...” >> $LOG_FILE
sleep 300
echo “Sleep complete!” >> $LOG_FILE
echo “Entering in Inventory section...” >> $LOG_FILE
wupdate -r Endpoint All >> $LOG_FILE
echo “wupdate complete!” >> $LOG_FILE
echo “Checking if the EP is alive...” >> $LOG_FILE
wep $ep_label status >> $LOG_FILE