Forum Discussion

George_Dicu's avatar
10 years ago

OpsCenter Custom Report

Hello,   So I have OpsCenter 7.6.0.3 and I`m trying to create a report on some clients in order to see only the Active Data on our dedup pools/tapes(basicly everything). None of the predefin...
  • VoropaevPavel's avatar
    10 years ago

    Sorry, missed the active part of your request.

    My guess, your next question will be distibution by policy and schedule and if SLP is finished. =)

    For catalog assesment I use following script and excel pivot tables.

    Python 2.x, field are

    backup_id, client, policy, schedule, backup date, expire date, SLP, size (KB), SLP status(3 - complete), residense.

    __author__ = 'Pavel Voroapev'
    from codecs import open
    from datetime import datetime
    from re import split
    import os
    import argparse
    
    parser = argparse.ArgumentParser()
    parser.add_argument("-p", "--path", help='path to bpimagelist -l -d "01/01/2000 00:00:00"', required=True)
    args = parser.parse_args()
    filepath = args.path
    (_ , out) = os.path.split(filepath)
    out += "out.csv"
    handle = open(filepath, 'r', encoding='utf-8')
    data = handle.readlines(2)
    imglist = dict()
    i = 0
    for line in data:
        i += 1
        if line[:5] == u'IMAGE' or line[1:6] == u'IMAGE':
            image = split(' ', line)
            imglist[image[5]] = list()
            imglist[image[5]].append(image[1])
            imglist[image[5]].append(image[6])
            imglist[image[5]].append(image[10])
            imglist[image[5]].append(datetime.fromtimestamp(float(image[13])).strftime('%Y-%m-%d %H:%M:%S'))
            imglist[image[5]].append(datetime.fromtimestamp(float(image[15])).strftime('%Y-%m-%d %H:%M:%S'))
            imglist[image[5]].append(image[20])
            imglist[image[5]].append(image[51])
            imglist[image[5]].append(image[18])
            imglist[image[5]].append(image[52])
        elif line[:4] == 'FRAG':
            frag = split(' ', line)
            if len(frag) > 4:
                if len(imglist[image[5]]) == 9:
                    imglist[image[5]].append(frag[8])
                    FRAG = frag[8]
                elif len(imglist[image[5]]) == 10:
                    if FRAG != frag[8]:
                        FRAG = frag[8]
                        imglist[image[5]][9] = imglist[image[5]][9] + ',' + FRAG
    handle.close()
    
    handle = open(out, 'w', encoding='utf-16')
    for image in imglist:
        line = image + u';'
        for val in imglist[image]:
            line += val + u';'
        line += u"\u000A"
        handle.write(line)
    handle.close()
    

     

    Note that imagelist expected to be encoded in utf-8, so you will need to do iconv before running.