当前位置: 首页>>代码示例>>Python>>正文


Python daemon.CollectorDaemon类代码示例

本文整理汇总了Python中Products.ZenCollector.daemon.CollectorDaemon的典型用法代码示例。如果您正苦于以下问题:Python CollectorDaemon类的具体用法?Python CollectorDaemon怎么用?Python CollectorDaemon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CollectorDaemon类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runPostConfigTasks

 def runPostConfigTasks(self, result=None):
     # 1) super sets self._prefs.task with the call to postStartupTasks
     # 2) call remote createAllUsers
     # 3) service in turn walks DeviceClass tree and returns users
     CollectorDaemon.runPostConfigTasks(self, result)
     if not isinstance(result, Failure) and self._prefs.task is not None:
         service = self.getRemoteConfigServiceProxy()
         log.debug('TrapDaemon.runPostConfigTasks callRemote createAllUsers')
         d = service.callRemote("createAllUsers")
         d.addCallback(self._createUsers)
开发者ID:c0ns0le,项目名称:zenoss-4,代码行数:10,代码来源:zentrap.py

示例2: main

def main():
    preferences = Preferences()
    task_factory = SimpleTaskFactory(PythonCollectionTask)
    task_splitter = PerDataSourceInstanceTaskSplitter(task_factory)
    daemon = CollectorDaemon(preferences, task_splitter)
    pool_size = preferences.options.threadPoolSize

    # The Twisted version shipped with Zenoss 4.1 doesn't have this.
    if hasattr(reactor, 'suggestThreadPoolSize'):
        reactor.suggestThreadPoolSize(pool_size)

    daemon.run()
开发者ID:zenoss,项目名称:ZenPacks.zenoss.PythonCollector,代码行数:12,代码来源:zenpython.py

示例3: run

 def run(self):
     if "--worker" in sys.argv:
         executor = zope.component.getUtility(IWorkerExecutor)
         executor.setWorkerClass(self.workerClass)
         executor.run()
     else:
         myPreferences = self.prefsClass()
         myTaskFactory = zope.component.getUtility(IWorkerTaskFactory)
         myTaskFactory.setWorkerClass(self.workerClass)
         myTaskSplitter = SimpleTaskSplitter(myTaskFactory)
         daemon = CollectorDaemon(myPreferences, myTaskSplitter)
         myTaskFactory.postInitialization()
         self.log = daemon.log
         daemon.run()
开发者ID:SteelHouseLabs,项目名称:zenoss-prodbin,代码行数:14,代码来源:CollectorCmdBase.py

示例4: displayStatistics

        self._snmpProxy = None


    def displayStatistics(self):
        """
        Called by the collector framework scheduler, and allows us to
        see how each task is doing.
        """
        display = "%s using SNMP %s\n" % (self.name, self._snmpConnInfo.zSnmpVer)
        display += "%s Cycles Exceeded: %s; V3 Error Count: %s; Stopped Task Count: %s\n" % (
            self.name, self._cycleExceededCount, self._snmpV3ErrorCount, self._stoppedTaskCount)
        display += "%s OIDs configured: %d \n" % (
            self.name, len(self._oids.keys()))
        display += "%s Good OIDs: %d - %s\n" % (
            self.name, len(self._good_oids), self._good_oids)
        display += "%s Bad OIDs: %d - %s\n" % (
            self.name, len(self._bad_oids), self._bad_oids)

        if self._lastErrorMsg:
            display += "%s\n" % self._lastErrorMsg
        return display


if __name__ == '__main__':
    myPreferences = SnmpPerformanceCollectionPreferences()
    myTaskFactory = SimpleTaskFactory(SnmpPerformanceCollectionTask)
    myTaskSplitter = SimpleTaskSplitter(myTaskFactory)
    daemon = CollectorDaemon(myPreferences, myTaskSplitter)
    daemon.run()

开发者ID:whyzgeek,项目名称:ZenPacks.community.ZeusLoadBalancer,代码行数:29,代码来源:zeuscollector.py

示例5: main

def main():
    preferences = Preferences()
    task_factory = SimpleTaskFactory(PythonCollectionTask)
    task_splitter = PerDataSourceInstanceTaskSplitter(task_factory)
    daemon = CollectorDaemon(preferences, task_splitter)
    daemon.run()
开发者ID:ssbunyk,项目名称:ZenPacks.zenoss.PythonCollector,代码行数:6,代码来源:zenpython.py


注:本文中的Products.ZenCollector.daemon.CollectorDaemon类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。