TSM backup results in a email notification

Hi

i found a script that send backup result per day i use this - q event * * nodes=<nodegroup> begind=-1 begint=18:00 endd=today endt=08:00

the problem is that is only show info about node that associated with schedule  
i have some UNIX server  that run a backup from ksh script from the node and i don't get any status about the backup

Is there a way to get the information from the TSM DB about the backup status ? maybe with select statement or something else .

Thx

TSMIL
TSMILAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

woolmilkporcCommented:
Unfortunately TSM doesn't keep an event-like track of non-scheduled backups.

You can query the "Summary" table anyway, which will at least show whether the backup operation was successful or not.
Use a query like this:

select cast(entity as char(18)) Node, -
 cast(activity as char(6)) Task, -
 date(start_time) Date, -
 time(start_time) Time, -
 successful -
from summary -
 where activity='BACKUP' -
  and ( -
   (day(START_TIME)=day(current_timestamp)-1 and hour(start_time)>=18) -
  or -
   (day(START_TIME)=day(current_timestamp) and hour(start_time)<8) -
      ) -
order by START_TIME

Open in new window


The "Summary" table contains further info such as number of files and bytes, number of failed items (which includes retries) etc. which you could include in your query.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TSMILAuthor Commented:
Hi
And if I want To filter by node like node=xxx
Where can I add this line ?
woolmilkporcCommented:
select cast(entity as char(18)) Node, -
 cast(activity as char(6)) Task, -
 date(start_time) Date, -
 time(start_time) Time, -
 successful -
from summary -
 where activity='BACKUP' and -
    entity='NODENAME' -
  and ( -
   (day(START_TIME)=day(current_timestamp)-1 and hour(start_time)>=18) -
  or -
   (day(START_TIME)=day(current_timestamp) and hour(start_time)<8) -
      ) -
order by START_TIME

Open in new window

At line 8 replace NODENAME with the name (all UPPERCASE!) of the desired node.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

TSMILAuthor Commented:
hi

thanks for the fast response .

im sorry but if i need to check several nodes , and how i create from this a log file

i copy to this post another script that i write

#!/bin/bash

ID=
PAS=

# truncate the file because we don't want dsmadmc to append to it

outfile=/tmp/status.txt
mailfile=/tmp/status.txt

/usr/bin/dsmadmc -id=$ID -pass=$PAS -outfile=$outfile  \
"query event * * nodes=* begind=today-1 begint=08:00:00 endd=today endt=06:59:00" >/dev/null


sed -n '7,$p' $outfile > $mailfile
/usr/bin/mutt -s "Missed/Failed schedule report"  -a $mailfile dudure@clalit.org.il < /dev/null



~
woolmilkporcCommented:
Ok, for several nodes:

select cast(entity as char(18)) Node, -
 cast(activity as char(6)) Task, -
 date(start_time) Date, -
 time(start_time) Time, -
 successful -
from summary -
 where activity='BACKUP' and -
    entity in ( 'NODENAME1','NODENAME2','NODENAME3','NODENAME4' )  -
  and ( -
   (day(START_TIME)=day(current_timestamp)-1 and hour(start_time)>=18) -
  or -
   (day(START_TIME)=day(current_timestamp) and hour(start_time)<8) -
      ) -
order by START_TIME

Open in new window


Again, replace NODENAMEx with the names (all UPPERCASE!) of the desired nodes.
woolmilkporcCommented:
Now for the log file and the mail.

Put the query code into a file named e.g. backup_summary, then run this:

/usr/bin/dsmadmc -id=$ID -pass=$PAS -dataonly=yes -displaymode=table 'macro /path/to/backup_summary' > $mailfile
/usr/bin/mutt -s "TSM Backup report"  -a $mailfile dudure@clalit.org.il < /dev/null

"/path/to/backup_summary" means name and full path to  your new file containing the suggested SQL query.
woolmilkporcCommented:
As you already noticed, the script above does not handle a month change correctly. See our other thread:
http://www.experts-exchange.com/Software/Backup_Restore/Q_28682984.html

Corrected version:

select cast(entity as char(18)) Node, -
 cast(activity as char(6)) Task, -
 date(start_time) Date, -
 time(start_time) Time, -
 successful -
from summary -
 where activity='BACKUP' and -
    entity in ( 'NODENAME1','NODENAME2','NODENAME3','NODENAME4' )  -
  and ( -
   (date(START_TIME)=date(current_timestamp-1 day) and hour(start_time)>=18) -
  or -
   (date(START_TIME)=date(current_timestamp) and hour(start_time)<8) -
      ) -
order by START_TIME

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage Software

From novice to tech pro — start learning today.