コード例 #1
0
def loopdatabases():
    excludelist = ['generic', 'rman', 'zfssa', 'autorestore', 'netapp']
    sections = Configuration.sections()
    if action is not None:
        if action[0] == "!":
            excludelist.append(action[1:])
        else:
            sections = [action]
    for configname in sections:
        if configname not in excludelist:
            if Configuration.get('autorestoreenabled', configname) == '1':
                yield configname
コード例 #2
0
def loopdatabases():
    excludelist = ['generic', 'rman', 'zfssa', 'autorestore', 'netapp']
    for configname in Configuration.sections():
        if configname not in excludelist:
            if Configuration.get('autorestoreenabled', configname) == '1':
                yield configname
コード例 #3
0
        print "  Archivelog job: %s, last: %s, duration: %s, last failure: %s" % (
            jobinfo['archlog']['state'], jobinfo['archlog']['last_start_date'],
            jobinfo['archlog']['last_run_duration'],
            jobinfo['archlogexec']['last_failed'])
        if len(snaps) > 0:
            firstsnap = zfs.getsnapinfo(snaps[0])
            lastsnap = zfs.getsnapinfo(snaps[-1])
            print "  Snapshots: %d, latest: %s, oldest: %s" % (
                len(snaps), firstsnap["creation"], lastsnap["creation"])
        else:
            print "  Snapshots: none"
        if autorestoreinfo is not None:
            print "  Last successful restore: %s, last restore failure: %s, last successful validation: %s, avg difference from target (s): %d, avg restore time (min): %d" % (
                autorestoreinfo["last_success"], autorestoreinfo["last_fail"],
                autorestoreinfo["last_validated"], autorestoreinfo["avgdiff"],
                autorestoreinfo["avgrestoremin"])
    except:
        print "  Error getting information."


excludelist = ['generic', 'rman', 'zfssa', 'autorestore']
includelist = []
if len(sys.argv) == 2:
    includelist = sys.argv[1].split(",")

# Loop through all sections
for dbname in Configuration.sections():
    if dbname not in excludelist and (len(includelist) == 0
                                      or dbname in includelist):
        process_database(dbname)