Package Products :: Package ZenHub :: Package services :: Module SyslogConfig |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenHub.services.SyslogConfig

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2011, all rights reserved.
     4  #
     5  # This content is made available according to terms specified in
     6  # License.zenoss under the directory where your Zenoss product is installed.
     7  #
     8  ##############################################################################
     9
    10
    11  __doc__ = '''SyslogConfig
    12
    13  Provides configuration for syslog message to Zenoss event conversions.
    14  '''
    15
    16  import logging
    17  log = logging.getLogger('zen.HubService.SyslogConfig')
    18
    19  import Globals
    20
    21  from Products.ZenCollector.services.config import CollectorConfigService
    22  from Products.ZenHub.zodb import onUpdate, onDelete
    23
    24
    25 -class FakeDevice(object):
    26      id = 'Syslog payload'
    27
    28
    29 -class SyslogConfig(CollectorConfigService):
    30 -    def _filterDevices(self, deviceList):
    31          return [ FakeDevice() ]
    32
    33 -    def _createDeviceProxy(self, device):
    34          proxy = CollectorConfigService._createDeviceProxy(self, device)
    35          proxy.configCycleInterval = 3600
    36          proxy.name = "Syslog Configuration"
    37          proxy.device = device.id
    38
    39          proxy.defaultPriority = self.zem.defaultPriority
    40          return proxy
    41
    42
    43  if __name__ == '__main__':
    44      from Products.ZenHub.ServiceTester import ServiceTester
    45      tester = ServiceTester(SyslogConfig)
    46 -    def printer(config):
    47          print "Default syslog priority = ", config.defaultPriority
    48      tester.printDeviceProxy = printer
    49      tester.showDeviceInfo()
    50