Talk:QuickBooks support phone number,(1-800-919-0992) QuickBooks technical support phone number, QuickBooks customer support phone number,

From Zenoss Wiki
Revision as of 04:06, 31 October 2015 by Hackman238 (Talk | contribs)

Jump to: navigation, search
DevOps and Security services

As the zenoss user on the ZenMaster, zendmd.

Copy and paste in the following definition:

## Copyright 2015 GoVanguard Inc. Written by Shane William Scott.
def exciseObjectTumor(deviceOrganizerToSearch = '/zport/dmd/Devices', typeToFix = {'meta_type': 'Software', 'id': 'os'}, doItForReal = False):
    problemsFound = 0
    if deviceOrganizerToSearch != None and typeToFix.has_key('id'):
        print "Getting organizer..."
        organizerOb = dmd.Devices.getOrganizer(deviceOrganizerToSearch)
        if organizerOb:
            print "Collecting device list..."
            devicesToSearch = organizerOb.getSubDevices()
    if len(devicesToSearch) > 0:
        print 'Searching %s devices in %s for duplicates of %s in _objects...' % (str(len(devicesToSearch)), deviceOrganizerToSearch, str(typeToFix['id']))
        for d in devicesToSearch:
            obs = []
            oldObs = d._objects
            newObs = None
            obsCount = 0
            for ob in oldObs:
                if ob['id'] == typeToFix['id']:
                    obsCount = obsCount + 1
            if obsCount > 1:
                problemsFound = problemsFound + 1
                print "Device %s has too many %s obs in _objects. Fixing." % (d.titleOrId(), typeToFix['id'])
                newObs = tuple(obs)
                d._objects = newObs
                if doItForReal == True:
        print "No devices scanned."
    if problemsFound > 0:
        print "Found and cut out a total of %s %s object duplicates." % (str(problemsFound), typeToFix['id'])
        if doItForReal == False:
            print "...but doItForReal was set to False so the changes are not commited"
        print "Congrats! You're clean! Nothing showed up during the scan for duplicated %s objects." % (typeToFix['id'])

Execute the method supplying the object dictionary exhibiting duplication. Pass doItForReal to 'True' for actions to be committed. Actions are not committed by default.


exciseObjectTumor(typeToFix = {'meta_type': 'Software', 'id': 'os'}, doItForReal = True)
exciseObjectTumor(typeToFix = {'meta_type': 'DeviceHW', 'id': 'hw'}, doItForReal = True)
exciseObjectTumor(typeToFix = {'meta_type': 'ZCatalog', 'id': 'componentSearch'}, doItForReal = True)