Great, Thanks !!
i will check it ... the first thing what i
saw, which could be problematical for me is,
that my tsm-log-file is not proberly sorted with date
but only in one file .. but i figure it out ..
many thanks
martin
On Fri, 4 Jan 2008, Kern, Thomas wrote:
This is what I use for backing up a server with TSM and reporting the
outcome to an email list and to hobbit.
I am not very experienced with linux and shell scripting (being an
old-time mainframer), so the hobbit reporting script was stolen from a
bigbrother example at deadcat and mercilessly mangled into this.
linux:~ # cat /etc/cron.d/tsm
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
MAILTO=user-f1ebafb19faf@xymon.invalid
#
# Run the TSM backup client and the Hobbit script for reporting
# every morning except Sunday when the TSM server is down.
00 3 * * 1-6 root /root/bin/run_dsmc
00 6 * * 1-6 root /usr/lib/hobbit/client/bin/hobbit-dsmc.sh
linux:~ # cat /root/bin/run_dsmc
#! /bin/sh
# /etc/init.d/oracle10 stop # stop whatever needs to be
stopped
/opt/tivoli/tsm/client/ba/bin/dsmc incremental / 2>&1 \
| tee -a /var/log/tsm/run_dsm.log \
| tee -a /var/log/tsm/run_dsm.`date '+%Y%m%d'` \
| grep -f /etc/tsm/tsmrpt.pattern \
| mail -s "TSM Backup Statistics" user-a0ecc2496b16@xymon.invalid
# /etc/init.d/oracle10 start # restart whatever
linux:~ # cat /etc/tsm/tsmrpt.pattern
Node Name:
Session established with server ADSM:
Server Version
Server date/time:
Successful incremental backup of
Total number of
Data transfer time:
Network data transfer rate:
Aggregate data transfer rate:
Objects compressed by:
Elapsed processing time:
ANS4037E
ANS1228E
ANS1802E
linux:~ # cat /usr/lib/hobbit/client/bin/hobbit-dsmc.sh
#!/bin/sh
#
# Leif Gustafsson
# Giga Consulting AB
# 2002-07-04 Initial
# 2002-07-05 Status Started for backup is NOT a fault
# and some nicer code. I will do some more
# during the vacation
# 2007-01-24 T.L.Kern - began modification for Hobbit client
#
HOME=/usr/lib/hobbit/client
BBCMD="/usr/lib/hobbit/client/bin/bbcmd -ENV=/etc/default/hobbit"
BB=$HOME/bin/bb
BBDISP="10.23.15.29"
# . $BBHOME/etc/bbdef.sh
TODAY=$1
if [ x${1}x == xx ];
then
TODAY=`date '+%Y%m%d'`
fi
LOG_HOME="/var/log/hobbit"
HOSTNAME=`/bin/hostname`
TSMLOG="/var/log/tsm/run_dsm.$TODAY"
LOGFILE="$LOG_HOME/tsmevent"
PATTERNFILE="/etc/tsm/tsmrpt.pattern"
grep -f $PATTERNFILE $TSMLOG > $LOGFILE
if [ $? = 0 ];
then
MSG="status+1440 $HOSTNAME.backup green `date` - TSM Backup was
successful `cat $LOGFILE`"
$BB $BBDISP "$MSG"
exit 0
fi
grep -f $PATTERNFILE $TSMLOG > $LOGFILE
if [ $? = 1 ]
then
MSG="status+1440 $HOSTNAME.backup yellow `date` - Problems with
TSM Backup.<br>Please check /var/log/tsm/run_dsmc.$TODAY `cat $LOGFILE`"
$BB $BBDISP "$MSG"
exit 0
fi
grep -f $PATTERNFILE $TSMLOG > $LOGFILE
if [ $? = 2 ]
then
MSG="status+1440 $HOSTNAME.backup red `date` - Problems with TSM
Backup.<br>File /var/log/tsm/run_dsmc.$TODAY does not exist."
$BB $BBDISP "$MSG"
exit 0
fi
/Thomas Kern
/XXX-XXX-XXXX (O)
/XXX-XXX-XXXX (M)
-----Original Message-----
From: Martin Flemming [mailto:user-f286aaa49a76@xymon.invalid]
Sent: Friday, January 04, 2008 09:14
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Monitor for client TSM-Backup
I want to monitor the tsm-backup on my clients ...
... and i myself be not the Scripting-master :-(
Any help or scripts are much appreciated
cheers,
Martin
Gruss
Martin Flemming
Martin Flemming
DESY / IT office : Building 2b / 008a
Notkestr. 85 phone : XXX - XXXX - XXXX
22603 Hamburg mail : user-f286aaa49a76@xymon.invalid