TSMIL
asked on
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
At line 8 replace NODENAME with the name (all UPPERCASE!) of the desired node.
ASKER
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
~
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
~
Ok, for several nodes:
Again, replace NODENAMEx with the names (all UPPERCASE!) of the desired 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
Again, replace NODENAMEx with the names (all UPPERCASE!) of the desired nodes.
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.
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.
As you already noticed, the script above does not handle a month change correctly. See our other thread:
https://www.experts-exchange.com/questions/28682984/TSM-backup-results.html
Corrected version:
https://www.experts-exchange.com/questions/28682984/TSM-backup-results.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
ASKER
And if I want To filter by node like node=xxx
Where can I add this line ?