Please login or register. December 14, 2017, 04:43:03 PM

Author Topic: When SUMA software is ready to download  (Read 1884 times)

0 Members and 1 Guest are viewing this topic.

giovanniditoro

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
When SUMA software is ready to download
« on: July 28, 2016, 01:40:47 PM »
The AIX Service Update Management Assistant (SUMA) to download AIX Technology Levels (TL’s), Service Packs (SP’s), and PTF’s from a designated AIX fix server is a very useful method.
But the problem is: how do we know when a new software package is available on the SUMA server to be downloaded?

I also point out that to use SUMA is necessary that IBM knows the hostname of your server and that it is properly enabled.
If you execute the simple test with the command "suma –x –a Action=Preview –a RqType=Latest" and receive a similar message "0500-013 Failed to retrieve list from fix server" something is wrong into the configuration ... please download this useful document
https://www-304.ibm.com/webapp/set2/sas/f/best/Managing_AIX_Updates_Best_Practices.pdf

When this was done and when you have configured everything as described in the official doc you can also automate the check for the software availability.
I wrote this simple but useful procedure that does this check. Is only required to run the script trough AIX crontab and you will be alerted by automatic email when a new AIX software (TL or SP) is available for download.


#!/usr/bin/ksh
#
# only for crontab use
# Useful to see if a new software AIX was released
#
# Author_name: GDiToro
#
checkin() # preliminary checks
{
# please customise follow dir and files
#########################################################
## INPSWF = please insert the SP or TL level to be check
## OUTSWF = procedure auto generate this file
## OUTSWFLOG= procedure auto generate this file
#########################################################
INPSWF=/export/SUMA/utility/cronf-input.txt
OUTSWF=/export/SUMA/utility/cronf-output.txt
OUTSWFLOG=/export/SUMA/utility/cronf-log.txt
#
# Customise the mail address
print "To:AIXsupport@mydomain.com \nFrom:suma_user@Suma_Server\nSubject:SUMA check for new software AIX" >$OUTSWF
print "*************************************************************************\n" >>$OUTSWF
print "       Verify SUMA for availability new software AIX                         \n" >>$OUTSWF
print "       DATE: $HTODAY                                                     \n" >>$OUTSWF
print "*************************************************************************\n" >>$OUTSWF
#set -x
if [ -f $INPSWF ]; then   
   cat $INPSWF|while read TLSP LEVEL
   do
      case $TLSP in
        TL)   QSOFT="Technical Level"
        L2=`echo $LEVEL|awk '{print substr($0,1,4)}'`
        FILTER="${L2}-00"
        ;;
        SP)   QSOFT="Service Pack"
        L2=`echo $LEVEL|awk '{print substr($0,1,7)}'`
        FILTER="${L2}"
        ;;
        *)
        print "Error , indeterminable filter" >${OUTSWF}
      ;;
    esac
   #echo $TLSP $LEVEL $FILTER
   L2=`echo $LEVEL|awk '{print substr($0,1,4)}'`
   FILTER="${L2}-00"
   suma -x -a Action=Preview -a RqType=${TLSP} -a RqName=${LEVEL} -a FilterML=$FILTER >/dev/null 2>&1
    echo $?|read RC
    if (($RC == 0)); then
     print “Check availability AIX ${TLSP} ${LEVEL}: the software is available for DOWNLOAD\n" >>$OUTSWF
     cat $OUTSWF |sendmail -t AIX_support@mydomain.com
    else
     print "${HTODAY}: check availability for AIX ${TLSP} ${LEVEL}: software NOT YET available" >>$OUTSWFLOG
   fi
   done
else
print "File "$INPSWF" not found. Procedure ended”
exit 0
fi
exit 0
}

# MAIN
#
#set -x
TODAY=`date -u`
######################################################
checkin
######################################################
« Last Edit: July 28, 2016, 03:27:08 PM by giovanniditoro »

giovanniditoro

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
Re: When SUMA software is ready to download
« Reply #1 on: July 28, 2016, 02:25:07 PM »
I forgot one important thing: the input sample file format to run the procedure
$INPSW
-----------------------------
SP 6100-09-08
SP 7100-03-08
TL 6100-10
TL 7100-05
-----------------------------
where SP for Service Pack and TL for Technology Level

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1056
  • Karma: +0/-0
Re: When SUMA software is ready to download
« Reply #2 on: August 16, 2016, 07:17:06 AM »
Thanks for the post. Would you like to see it as an article on rootvg.net? (I know I would!). If you are interested just send a PM.