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          CollectorConfigService.__init__(self, dmd, instance, deviceProxyAttributes)
    31
    32 -    def _filterDevice(self, device):
    33          include = CollectorConfigService._filterDevice(self, device)
    34
    35          if getattr(device, 'zWmiMonitorIgnore', False):
    36              self.log.debug("Device %s skipped because zWmiMonitorIgnore is True",
    37                             device.id)
    38              include = False
    39
    40          elif not getattr(device, 'zWinEventlog', True):
    41              log.debug("Device %s skipped because zWinEventlog is False",
    42                        device.id)
    43              include = False
    44
    45          return include
    46
    47 -    def _createDeviceProxy(self, device):
    48          proxy = CollectorConfigService._createDeviceProxy(self, device)
    49
    50          # for now, every device gets a single configCycleInterval based upon
    51          # the collector's eventlogCycleInterval configuration.
    52          # TODO: create a zProperty that allows for individual device schedules
    53          proxy.configCycleInterval = self._prefs.eventlogCycleInterval
    54
    55          return proxy
    56