Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    Jun 2010
    Posts
    84
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default find and detect error in act log **SCRIPT for TSM on AIX**

    vi /usr/local/scripts/tsm_log.ksh

    LOGFILE=/tmp/tsm_log_kontrol.out
    SEARCHFILE=/usr/local/scripts/exclude.lst
    MFILE=/tmp/tsm_log.out.$$
    kayit=0
    echo "From: TSM Activity Log <xx>" > $MFILE
    echo "Subject: TSM Activity Log Control" >> $MFILE
    echo "To: mail.adres@com.tr" >> $MFILE
    echo "" >> $MFILE
    #echo "Content-type: text/html; charset=US-ASCII" >> $MFILE
    #echo "Content-transfer-encoding: 7BIT" >> $MFILE
    #echo "<HTML><BODY>" >> $MFILE
    #echo "<table border=1 style=\"font-size: 9pt; font-family: Tahoma\">" >> $MFILE
    #echo "<tr><td>TSM Activity Log Analysis</td></tr>" >> $MFILE
    dsmadmc -id=admin -password="xx" -outfile=$LOGFILE "select * from (select NODENAME,DATE_TIME,SEVERITY,MESSAGE from actlog where date_time>=current_timestamp-2 hours) where SEVERITY='D' OR SEVERITY='E' OR SEVERITY='W'"
    if [ -r $LOGFILE ]
    then


    if [ -r $SEARCHFILE ]
    then

    #y=`echo $x | awk '{ print $1 }'`
    while read x
    do
    say=`grep -E -p -v "$x" $LOGFILE|wc -l`
    if [ $say -gt 0 ]
    then
    kayit=`expr $kayit + 1`
    #echo "<tr><td>" >> $MFILE
    grep -E -p -v "$x" $LOGFILE >> $MFILE
    #echo "</td></tr>" >> $MFILE
    fi
    done < $SEARCHFILE
    if [ $kayit -eq 0 ]
    then
    echo "No record found!" >> $MFILE
    fi
    #echo "</table>" >> $MFILE
    #echo "</BODY></HTML>" >> $MFILE
    say=`cat $MFILE|grep NODENAME|wc -l`
    if [ $say -gt 0 ]
    then
    /usr/sbin/sendmail -t < $MFILE
    /usr/bin/rm -f $MFILE
    fi
    fi
    #/usr/bin/rm -f $LOGFILE
    fi




    and;

    SEARCHFILE=/usr/local/scripts/exclude.lst

    ANR0482W|ANR1401W|ANS8000I|ANR0516E|ANR0162W|ANR05 16E|ANR2034E|StdPutText|OutDiagToCons|ANR2000E|Rep ortSQLDiagInfo|eportSQLDiagInfo|outDiagfExt|DbiEva lSQLOutcome|tbSQLExecuteSelect|NewAdmSQLExecute|Ad mCommandLocal|SmAdminCommandThread|admCommand|tbSQ LExecuteSelect|StartThread|ANR0568W|ANR8216W|ANR14 04W|AdmSQLExecute|ANR2939E|Thread<13917>|issued message 9999 from|ANR2939E|ANE4037E|ANR0944E|ANR2022E DELETE PATH|ANR2024EA|ANR2020E|ANR4976W|S170SQLLOG|ANR834 5E


    Thanks

  2. #2
    Newcomer
    Join Date
    Apr 2012
    Location
    Bangalore
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hi
    i am new to TSM and i am working on TSM 5.5. pls give me step by step procedure for implementing this script.

    Many thanks!!!!

  3. #3
    Member
    Join Date
    Jun 2010
    Posts
    84
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default

    Hello ir2160

    if you have aix platform,
    1)mkdir /usr/local/scripts
    2)vi /usr/local/scripts/tsm_log.ksh
    3)copy and paste include script
    4)wq! exit
    5)vi /usr/local/scripts/exclude.lst
    6) copy and paste include it
    7)edit crontab file

    i hope this helpfulyy

  4. #4
    Newcomer
    Join Date
    Apr 2012
    Location
    Bangalore
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you so much, that worked.

  5. #5
    Newcomer
    Join Date
    Apr 2012
    Location
    Bangalore
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hello unpaired.
    Could u pls Help me in creating an automated script for AIX which runs every friday. i am actually trying to schedule the script for damaged files.
    here is the script that i need to schedule for every week.

    $ cat rwd_FLETCH_tsm.ksh
    #!/usr/bin/ksh

    pass=`tail -1 /var/tmp/tsm`
    user=`head -1 /var/tmp/tsm`
    DATE=`date +%m%d%y`



    # FOR STORAGE POOL BACKUP
    dsmadmc -id=$user -password=$pass run SPCSTATS_FLETCH >> /tmp/tsmqcss/selectSPCS tats_FLETCH_$DATE.txt
    # dsmadmc -id=$user -password=$pass select ACTIVITY,START_TIME,END_TIME,substr ( cast(max(end_time) - (min(start_time)) as char(29)),1,10) AS "ELAPTIME (D HHMMSS )",CAST((SUCCESSFUL) as char(10)) as "SUCCESSFUL",CAST(FLOAT(SUM(BYTES))/1024/10 24/1024 as DEC(9,4)) AS "GB Xfer'd",cast((end_time-start_time)seconds/60/60 as d ecimal(9,4)) as "HOURS",CAST(CAST((BYTES)/1024/1024/1024 as DEC(10,4))/CAST((end _time-start_time)seconds/60/60 as DEC(10,4)) AS DEC(10,5)) AS "XFER_RATE" from s ummary WHERE activity='STGPOOL BACKUP' and BYTES<>0 group by activity,start_time ,end_time,successful,bytes >> /tmp/tsmqcss/selectSPCStats_FLETCH_$DATE.txt

    # FOR ARCHIVES
    dsmadmc -id=$user -password=$pass run ARCH_FLETCH >> /tmp/tsmqcss/selectARCH_FL ETCH_$DATE.txt
    # dsmadmc -id=$user -password=$pass select ADDRESS,ACTIVITY,START_TIME,END_TIME, substr (cast(max(end_time) - (min(start_time)) as char(29)),1,10) AS "ELAPTIME ( D HHMMSS)",CAST((SUCCESSFUL) as char(10)) as "SUCCESSFUL",CAST(FLOAT(SUM(BYTES)) /1024/1024/1024 as DEC(9,4)) AS "GB Xfer'd",cast((end_time-start_time)seconds/60 /60 as decimal(9,4)) as "HOURS",CAST(CAST((BYTES)/1024/1024/1024 as DEC(8,4))/CA ST((end_time-start_time)seconds/60/60 as DEC(8,4)) AS DEC(8,5)) AS "XFER_RATE" f rom summary WHERE activity='ARCHIVE' group by address,activity,start_time,end_ti me,successful,bytes >> /tmp/tsmqcss/selectARCH_FLETCH_$DATE.txt

    # FOR RETRIEVES
    dsmadmc -id=$user -password=$pass run RETR_FLETCH >> /tmp/tsmqcss/selectRETR_FL ETCH_$DATE.txt
    # dsmadmc -id=$user -password=$pass select ADDRESS,ACTIVITY,START_TIME,END_TIME, substr (cast(max(end_time) - (min(start_time)) as char(29)),1,10) AS "ELAPTIME ( D HHMMSS)",CAST((SUCCESSFUL) as char(10)) as "SUCCESSFUL",CAST(FLOAT(SUM(BYTES)) /1024/1024/1024 as DEC(9,4)) AS "GB Xfer'd",cast((end_time-start_time)seconds/60 /60 as decimal(9,4)) as "HOURS",CAST(CAST((BYTES)/1024/1024/1024 as DEC(8,4))/CA ST((end_time-start_time)seconds/60/60 as DEC(8,4)) AS DEC(8,5)) AS "XFER_RATE" f rom summary WHERE activity='RETRIEVE' and BYTES<>0 and end_time<>start_time grou p by address,activity,start_time,end_time,successful,by tes >> /tmp/tsmqcss/selec tRETR_FLETCH_$DATE.txt

    # FOR TAPE STATUS
    dsmadmc -id=$user -password=$pass run FRAG_LTO_FLETCH >> /tmp/tsmqcss/selectFRA G_LTO_FLETCH_$DATE.txt
    # dsmadmc -id=$user -password=$pass select VOLUME_NAME,STGPOOL_NAME,CAST(float(E ST_CAPACITY_MB) as DEC(9,2)) as "MB of Data",PCT_UTILIZED,PCT_RECLAIM,STATUS,sub str(char(ERROR_STATE),1,3) as "Errors?",ACCESS,substr(char(TIMES_MOUNTED),1, 5) a s "# of Mounts" from VOLUMES GROUP BY stgpool_name,volume_name,est_capacity_mb,p ct_utilized,pct_reclaim,status,error_state,access, times_mounted >> /tmp/tsmqcss/ selectFRAG_LTO_FLETCH_$DATE.txt



    # FOR STATISTICS AND STATUS

    dsmadmc -id=$user -password=$pass q stg f=d >> /tmp/tsmqcss/qstgFD_FLETCH_$DATE. txt
    dsmadmc -id=$user -password=$pass q libv f=d >> /tmp/tsmqcss/qlibvFD_FLETCH_$DAT E.txt
    dsmadmc -id=$user -password=$pass q occ >> /tmp/tsmqcss/qocc_FLETCH_$DATE.txt
    dsmadmc -id=$user -password=$pass q auditocc >> /tmp/tsmqcss/qauditocc_FLETCH_$D ATE.txt
    dsmadmc -id=$user -password=$pass q actlog begind=today-31 begint=00:00:00 >> /t mp/tsmqcss/qactlog_FLETCH_$DATE.txt
    sleep 300

    dsmadmc -id=$user -password=$pass q actlog begind=today-31 begint=00:00:00 searc h="Copy" >> /tmp/tsmqcss/qactlogSEARCHCOPY_FLETCH_$DATE.txt
    sleep 150

    # dsmadmc -id=$user -password=$pass q media * stg=CRTHRLT04 f=d >> /tmp/tsmqcss/ qmediaFD_PRIM_FLETCH_$DATE.txt
    dsmadmc -id=$user -password=$pass run Q_FLETCH_PRIM_MEDIA >> /tmp/tsmqcss/qmedia FD_PRIM_FLETCH_$DATE.txt

    # dsmadmc -id=$user -password=$pass q media * stg=CRTHRLTO4_BACKUP_POOL f=d >> / tmp/tsmqcss/qmediaFD_COPY_FLETCH_$DATE.txt
    dsmadmc -id=$user -password=$pass run Q_FLETCH_COPY_MEDIA >> /tmp/tsmqcss/qmedia FD_COPY_FLETCH_$DATE.txt

    dsmadmc -id=$user -password=$pass q log f=d >> /tmp/tsmqcss/qlogFD_FLETCH_$DATE. txt
    dsmadmc -id=$user -password=$pass q db f=d >> /tmp/tsmqcss/qdbFD_FLETCH_$DATE.tx t
    dsmadmc -id=$user -password=$pass q drm f=d >> /tmp/tsmqcss/qdrmFD_FLETCH_$DATE. txt
    dsmadmc -id=$user -password=$pass q volhist type=all >> /tmp/tsmqcss/qvolhistALL _$DATE.txt
    dsmadmc -id=$user -password=$pass q sys >> /tmp/tsmqcss/qsys_FLETCH_$DATE.txt
    dsmadmc -id=$user -password=$pass show DAMAGED CRTHRLT04 >> /tmp/tsmqcss/Prim_da maged_FLETCH_$DATE.txt
    dsmadmc -id=$user -password=$pass show DAMAGED CRTHRLTO4_BACKUP_POOL >> /tmp/tsm qcss/Copy_damaged_FLETCH_$DATE.txt

    Many thanks!!!

  6. #6
    Member
    Join Date
    Jun 2010
    Posts
    84
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default

    Hello ir2160

    Of course i do.
    1)crontab -e
    2) add "05 09 * * 5 /usr/local/scripts/script_name 1>/dev/null 2>/dev/null"
    3)wq!

    exit

    "5" number is every friday.

  7. The Following User Says Thank You to unpaired For This Useful Post:

    ir2160 (06-08-2012)

  8. #7
    Newcomer
    Join Date
    Apr 2012
    Location
    Bangalore
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thank you so much, But i did not understand; as u know i am new to AIX and i need step by step procedure to implement this.
    my script name is: rwd_FLETCH_tsm.ksh

    many thanX!!

  9. #8
    Newcomer
    Join Date
    Apr 2012
    Location
    Bangalore
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hi, thank you for your Help again,
    i would also like to schedule an email after the script is executed. Pls advice.

    Many thanks !!!

  10. #9
    Member
    Join Date
    Jun 2010
    Posts
    84
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default

    You're welcome.

    if you have the same script please share it the platform.

    Thank you.

  11. #10
    Newcomer
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi ir2160,
    This is nice. I am new to TSM and could you please send me followings. It would be to clear understand of this script.

    SPCSTATS_FLETCH
    ARCH_FLETCH
    RETR_FLETCH
    FRAG_LTO_FLETCH
    Q_FLETCH_PRIM_MEDIA
    Q_FLETCH_COPY_MEDIA

    Thanks in advance..

Similar Threads

  1. TSM act log growing much rapidly
    By kvk in forum TSM Operation
    Replies: 1
    Last Post: 10-16-2010, 10:28 PM
  2. Error in Act log
    By newguy538 in forum TSM Installation, Upgrade and Configuration
    Replies: 1
    Last Post: 06-25-2009, 05:43 AM
  3. Cant Query the act log
    By djchopps0013 in forum Restore / Recovery Discussion
    Replies: 10
    Last Post: 11-01-2007, 02:23 AM
  4. Log(s) to find out why TSM DB 'died'
    By Rouen in forum Others
    Replies: 3
    Last Post: 09-07-2007, 01:56 PM
  5. Replies: 1
    Last Post: 04-21-2004, 10:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •