Listing 2

#!/usr/bin/ksh

# Directories
GLOBAL=/usr/global/invscout

# Exe's
INVSCOUT=/usr/sbin/invscout
CURL=/usr/global/pkgs/curl-7.14.0/bin/curl
PARSH=/usr/local/sysadmin/parsh

# Misc
EMAIL=you@yourcompany.com
POWER=power5

# Run on all nodes
$PARSH "$INVSCOUT -q -catl $GLOBAL/catalog.mic"
$PARSH "cp /var/adm/invscout/\`hostname|cut -f1 -d.\`.mup /usr/global/invscout/$POWER"

# Create a final combined file for upload
rm -f $GLOBAL/$POWER/$POWER.mup
cat $GLOBAL/$POWER/*.mup > $GLOBAL/$POWER/$POWER.mup

# This uploads the MUP to IBM and saves to resulting HTML file
$CURL -s -2 -F mdsData=@$GLOBAL/$POWER/$POWER.mup -F sendfile="Upload file" -o $GLOBAL/$POWER.html http://www14.software.ibm.com/webapp/set2/mds/mds

# Email results
print "\n$POWER Curl result is $?" | mail -s "Invscout Results" $EMAIL

exit 0


