I'm new here, and planned to lurk for a while, but I can perhaps help a
bit. I am NOT a TSM guru, but I'm a serious student of the game.

I just did a DR exercise, and found that my DB backup didn't seem to
exactly match my COPYPOOL tapes. When I restored a server, I found that a
very few small and frequently changed files were not restored, apparently
because they were not on the COPYPOOL tapes, to judge from the TSM logs.
After the test, I checked my admin schedules to make sure all the backups
were getting done before the copy to the COPYPOOL tapes, and such, and
was unable to find anything wrong that needed fixing.

Yesterday, I wrote a Python script on my AIX TSM server that does a "q
occupancy" and does some simple analysis on the results. I have the
(probably) normal pools: BACKUPPOOL, TAPEPOOL, and COPYPOOL. My script
simply verifies that for every filesystem, the number of files in
COPYPOOL equals the sum of the number of files in BACKUPPOOL and TAPEPOOL.

It's a simple script that has had about 10 minutes of testing, so it's
not ready for prime time, but it does seem to do a quick sanity check,
like you were asking about. You may not know Python and/or have it
available, but you can probably divine what this is doing, and write a
Perl (or other) script to do the same thing. Here is it, for better or
worse. No, I'm not a Python guru either.

---------- start of script

#!/usr/local/bin/python
import os
import string

# Global data


# One entry for each filesystem. Key is "node concatenated with
# filesystem". Value is an array of three integers, the number of
# files in backuppool, tapepool, and copypool, respectively.
info = {}


def do_line(f):
    global info
    # print f[0], f[2], f[4], f[5]
    key = f[0] + ' ' + f[2]
    if not info.has_key(key):
        info[key] = [0, 0, 0]
    a = info[key]
    count = string.atoi(string.replace(f[5], ',', ''))
    if f[4] == 'BACKUPPOOL':
        a[0] = count
    elif f[4] == 'TAPEPOOL':
        a[1] = count
    elif f[4] == 'COPYPOOL':
        a[2] = count


# For each filespace, it should be true that a[0] + a[1] = a[2]
# where a is the value of info[filespace]
def check_data():
    global info
    for key in info.keys():
        a = info[key]
        # print key, a
        if a[2] <> a[0] + a[1]:
            print 'ERROR:', key, a


# begin execution here

in_header = 1

#WARNING. My email client is probably wrapping the following line:
for line in os.popen('dsmadmc -id=admin -pa=admin -tabdelimited q occ
2>/dev/null').readlines():
    # print '/', line,
    if in_header:
        if line.find('ANS8000I') <> -1:
            in_header = 0
        continue
    line = string.replace(line, 'SYSTEM OBJECT', 'SYSTEM_OBJECT')
    f = line.split()
    if len(f) == 0 or f[0] == 'ANS8002I':
        continue
    do_line(f)

check_data()

---------- end of script

-----Original Message-----
From: "Jolliff, Dale" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Tue, 23 Jul 2002 06:32:41 -0500
Subject: Re: Occupancy comparison script

> We are just trying to do sanity checks prior to shipping offsite
> copypools
> off for a DR exercise.
>
> -----Original Message-----
> From: Seay, Paul [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 11:19 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Occupancy comparison script
>
>
> They often do not exactly match because of the agregates and other
> factors
> related to expiration, but they are usually close.
>
> May I ask what the problem is you are trying to solve that you think
> the
> successful completion of a backup stgpool command does not?
>
> Paul D. Seay, Jr.
> Technical Specialist
> Naptheon, INC
> 757-688-8180
>
>
> -----Original Message-----
> From: Jolliff, Dale [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 3:02 PM
> To: [EMAIL PROTECTED]
> Subject: Occupancy comparison script
>
>
> I know someone has already invented this wheel...
>
> I need to create a script to compare occupancy of primary sequential
> pools
> to copypools to verify a complete stgpool backup.
>
> Anyone got one handy that won't bring a server to it's knees?
>

Reply via email to