Package Products :: Package ZenWin :: Package services :: Module EventLogConfig |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenWin.services.EventLogConfig

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2007-2009, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 as published by
     8  # the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  __doc__='''EventLogConfig
    15
    16  Provides configuration to zeneventlog clients.
    17  '''
    18
    19  from Products.ZenCollector.services.config import CollectorConfigService
    20
    21  import logging
    22  log = logging.getLogger('zen.ModelerService.EventLogConfig')
    23
    24 -class EventLogConfig(CollectorConfigService):
    25 -    def __init__(self, dmd, instance):
    26          deviceProxyAttributes = ('zWmiMonitorIgnore',
    27                                   'zWinUser',
    28                                   'zWinPassword',
    29                                   'zWinEventlogMinSeverity',
    30                                   'zWinEventlogClause')
    31          CollectorConfigService.__init__(self, dmd, instance, deviceProxyAttributes)
    32
    33 -    def _filterDevice(self, device):
    34          include = CollectorConfigService._filterDevice(self, device)
    35
    36          if getattr(device, 'zWmiMonitorIgnore', False):
    37              self.log.debug("Device %s skipped because zWmiMonitorIgnore is True",
    38                             device.id)
    39              include = False
    40
    41          elif not getattr(device, 'zWinEventlog', True):
    42              log.debug("Device %s skipped because zWinEventlog is False",
    43                        device.id)
    44              include = False
    45
    46          return include
    47
    48 -    def _createDeviceProxy(self, device):
    49          proxy = CollectorConfigService._createDeviceProxy(self, device)
    50
    51          # for now, every device gets a single configCycleInterval based upon
    52          # the collector's eventlogCycleInterval configuration.
    53          # TODO: create a zProperty that allows for individual device schedules
    54          proxy.configCycleInterval = self._prefs.eventlogCycleInterval
    55
    56          return proxy
    57