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


Python CollectorDaemon.run方法代码示例

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


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

示例1: main

# 需要导入模块: from Products.ZenCollector.daemon import CollectorDaemon [as 别名]
# 或者: from Products.ZenCollector.daemon.CollectorDaemon import run [as 别名]
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,代码行数:14,代码来源:zenpython.py

示例2: run

# 需要导入模块: from Products.ZenCollector.daemon import CollectorDaemon [as 别名]
# 或者: from Products.ZenCollector.daemon.CollectorDaemon import run [as 别名]
 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,代码行数:16,代码来源:CollectorCmdBase.py

示例3: displayStatistics

# 需要导入模块: from Products.ZenCollector.daemon import CollectorDaemon [as 别名]
# 或者: from Products.ZenCollector.daemon.CollectorDaemon import run [as 别名]
        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,代码行数:31,代码来源:zeuscollector.py

示例4: main

# 需要导入模块: from Products.ZenCollector.daemon import CollectorDaemon [as 别名]
# 或者: from Products.ZenCollector.daemon.CollectorDaemon import run [as 别名]
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,代码行数:8,代码来源:zenpython.py


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