Esempio n. 1
0
def _getEdges(node, path_string, attempt_fix, counters, log):
    cls = node.aq_base
    attempted_fix = False

    # Fixes ZEN-18368: findposkeyerror should detect/fix _lastPollSnmpUpTime
    if isinstance(node, Device):
        try:
            try:
                counters['item_count'].increment()
                test_reference = node._lastPollSnmpUpTime
                test_results = test_reference.getStatus()
            #Fixes ZEN-20252: findposkeyerror won't attempt fix on attributeError for getStatus()
            except (POSKeyError, AttributeError) as fixableException:
                if attempt_fix:
                    counters['repair_count'].increment()
                    attempted_fix = True
                    node._lastPollSnmpUpTime = ZenStatus(0)
                    transaction.commit()
                raise
        except Exception as e:
            counters['error_count'].increment()
            log.critical("%s: %s on %s '%s' of %s",
                         type(e).__name__, e, "attribute",
                         "_lastPollSnmpUpTime", path_string)
        if attempted_fix:
            log.info("Repairing '_lastPollSnmpUpTime' attribute on %s", node)

    names = set(node.objectIds() if hasattr(cls, "objectIds") else [])
    relationships = set(node.getRelationshipNames(
    ) if hasattr(cls, "getRelationshipNames") else [])
    return (names - relationships), relationships
Esempio n. 2
0
 def __init__(self, id, buildRelations=True):
     ManagedEntity.__init__(self, id, buildRelations=buildRelations)
     os = DellEqualLogicDeviceOS()
     self._setObject(os.id, os)
     hw = DeviceHW()
     self._setObject(hw.id, hw)
     self._lastPollSnmpUpTime = ZenStatus(0)
     self._snmpLastCollection = 0
     self._lastChange = 0
     self.buildRelations()
Esempio n. 3
0
 def __init__(self, id, buildRelations=True):
     ManagedEntity.__init__(self, id, buildRelations=buildRelations)
     os = AIXOperatingSystem()
     self._setObject(os.id, os)
     hw = AIXDeviceHW()
     self._setObject(hw.id, hw)
     #self.commandStatus = "Not Tested"
     self._lastPollSnmpUpTime = ZenStatus(0)
     self._snmpLastCollection = 0
     self._lastChange = 0
    def __init__(self, id, buildRelations=True):
        '''
        Initialize a new device.

        Overridden so that the os property can be created as subclass
        of the standard OperatingSystem class.
        '''
        ManagedEntity.__init__(self, id, buildRelations=buildRelations)

        os = OperatingSystem()
        self._setObject(os.id, os)

        hw = DeviceHW()
        self._setObject(hw.id, hw)

        self._lastPollSnmpUpTime = ZenStatus(0)
        self._snmpLastCollection = 0
        self._lastChange = 0

        if hasattr(self, '_create_componentSearch'):
            self._create_componentSearch()