當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。