[hobbit] Monitor for client TSM-Backup

Martin Flemming martin.flemming at desy.de
Fri Jan 4 17:59:20 CET 2008


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=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 
> 
> 
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
> 
> 
> 

Gruss

       Martin Flemming


______________________________________________________
Martin Flemming
DESY / IT          office : Building 2b / 008a
Notkestr. 85       phone  : 040 - 8998 - 4667
22603 Hamburg      mail   : martin.flemming at desy.de
______________________________________________________



More information about the Xymon mailing list