[hobbit] Monitor for client TSM-Backup
Kern, Thomas
Thomas.Kern at hq.doe.gov
Fri Jan 4 16:24:46 CET 2008
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=Thomas.Kern at hq.doe.gov
#
# 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" syslog at vm1.hqadmin.doe.gov
# /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
/301-903-2211 (O)
/301-905-6427 (M)
> -----Original Message-----
> From: Martin Flemming [mailto:martin.flemming at desy.de]
> Sent: Friday, January 04, 2008 09:14
> To: hobbit at hswn.dk
> 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
More information about the Xymon
mailing list